using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Drawing;
using System.Data.SqlClient;

public partial class OtherMargin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["LOGINID"] == null && Session["USERNAME"] == null)
            {
                Response.Redirect("../login.aspx");
            }
        }
        catch (Exception ex)
        {
            throw (ex);
        }  
    }
    protected void ddlPAyment_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            SqlParameter[] param = new SqlParameter[]
            {                    
                new SqlParameter("@ServiceType",ddlPAyment.SelectedItem.Text),
                new SqlParameter ("@userType","Agent"),
                new SqlParameter ("@comissionCategory","2")
                //new SqlParameter("@Fromdate",txtFrmDate.Text.Trim()),
                //new SqlParameter("@Todate",txtToDate.Text.Trim())
            };
            DataSet ds = SqlHelper.GetDataSet(SqlHelper.mainConnectionString, CommandType.StoredProcedure, "UDP_GetMarginDetail", param);
            if (ds.Tables[0].Rows.Count != 0)
            {
                GridRetailer.DataSource = ds;
                GridRetailer.DataBind();

            }
        }
        catch (Exception ev)
        {

        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            SqlParameter[] param = new SqlParameter[]
            {                   
                new SqlParameter("@ServiceType",ddlPAyment.SelectedItem.Text),                    
            };
            DataSet ds = SqlHelper.GetDataSet(SqlHelper.mainConnectionString, CommandType.StoredProcedure, "UDP_GetMarginDetail", param);
            if (ds.Tables[0].Rows.Count != 0)
            {
                GridRetailer.DataSource = ds;
                GridRetailer.DataBind();
            }
        }
        catch (Exception ev)
        {
            throw (ev);
        }
    }
}
