Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if ((string)Session["AdminSessionID"] != null)
            {
                ViewState["xCode"]  = Session["AdminSessionID"].ToString();
                ViewState["xPRole"] = Session["LoginRole"].ToString();

                if (ViewState["xPRole"].ToString() != "Admin")
                {
                    btn_trash.Visible = false;
                }
                string xCode = Session["AdminSessionID"].ToString();

                // select code for Session Name
                SqlDataAdapter GDA = new SqlDataAdapter(" " +

                                                        " select * from fp_Planner where UserID='" + ViewState["xCode"] + "' " +
                                                        "  ", Con);

                DataSet GDS = new DataSet();
                Con.Open();
                GDA.Fill(GDS);
                Con.Close();

                if (GDS.Tables[0].Rows.Count > 0)
                {
                    ViewState["xSessionName"] = GDS.Tables[0].Rows[0]["PlannerName"].ToString();
                    ViewState["xSessionCode"] = GDS.Tables[0].Rows[0]["Code"].ToString();
                }

                // Select Code for Lead Type Combo
                SqlDataAdapter RDA = new SqlDataAdapter(" " +

                                                        " select Code, Name from fp_ComboDetail where ComboCode=19 order by 2 " +
                                                        "  ", Con);

                DataSet RDS = new DataSet();
                Con.Open();
                RDA.Fill(RDS);
                Con.Close();

                DDLeadType.DataSource     = RDS;
                DDLeadType.DataTextField  = "Name";
                DDLeadType.DataValueField = "Code";
                DDLeadType.DataBind();
                DDLeadType.Items.Insert(0, new ListItem("Lead Type", "-1"));
            }
            else
            {
                Response.Redirect("SessionExpired.aspx");
            }
        }

        //FillGridLMS();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if ((string)Session["AdminSessionID"] != null)
            {
                // Select Code for Lead Type Combo
                SqlDataAdapter RDA = new SqlDataAdapter(" " +
                                                        " select Code, Name from fp_ComboDetail where ComboCode=19 order by 2 " +
                                                        "  ", Con);

                DataSet RDS = new DataSet();
                Con.Open();
                RDA.Fill(RDS);
                Con.Close();

                DDLeadType.DataSource     = RDS;
                DDLeadType.DataTextField  = "Name";
                DDLeadType.DataValueField = "Code";
                DDLeadType.DataBind();
                DDLeadType.Items.Insert(0, new ListItem("All Lead Type", "-1"));


                SqlDataAdapter IMDA = new SqlDataAdapter(" select Code, PlannerName from fp_Planner where plannername not in ('Admin','Planner','Operator') ", Con);

                DataSet IMDS = new DataSet();
                Con.Open();
                IMDA.Fill(IMDS);
                Con.Close();

                ddlplanner.DataSource     = IMDS;
                ddlplanner.DataTextField  = "PlannerName";
                ddlplanner.DataValueField = "Code";
                ddlplanner.DataBind();
            }
            else
            {
                Response.Redirect("SessionExpired.aspx");
            }
        }
    }