protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataView dv = new DataView(Rolemaster.Get_RoleMaster().Tables[0]); dv.RowFilter = "Isactive = 1"; ddlrole.DataSource = dv; ddlrole.DataBind(); ddlrole.Items.Insert(0, new ListItem("--Select Role--", "0")); ddlrole.Focus(); } }
private DataTable Roles() { DataTable dt = null; if (Session["roleu"] == null) { DataView dv = new DataView(Rolemaster.Get_RoleMaster().Tables[0]); dv.RowFilter = "Isactive = 1"; dt = dv.ToTable(); Session["roleu"] = dt; } else { dt = (DataTable)Session["roleu"]; } return(dt); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { LblEmpID.Visible = false; DdlRole.DataSource = Rolemaster.Get_RoleMaster(); DdlRole.DataBind(); fillQualification(); fillDesignation(); PnlLoginDetails.Visible = false; grdEmpDetails.DataSource = BindGvEmpDetail(); grdEmpDetails.DataBind(); // // DDLsuperzone.DataSource = SuperZone.GetSuperzonemaster(); // DDLsuperzone.DataBind(); DDLSDZone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(0, "SDZone"); DDLSDZone.DataBind(); DDLSDZone.Items.Insert(0, new ListItem("All", "0")); DDLsuperzone.Items.Insert(0, new ListItem("All", "0")); DDLzone.Items.Insert(0, new ListItem("All", "0")); DDLareazone.Items.Insert(0, new ListItem("All", "0")); // DDLarea.Items.Insert(0, new ListItem("All", "0")); // DDLstate.DataSource = Customer_cs.Get_DestinationMaster("state"); DDLstate.DataBind(); DDLstate.Items.Insert(0, new ListItem("--Select State--", "0")); DDLcity.Items.Insert(0, new ListItem("--Select City--", "0")); SetView(); // txtjoin.Text = DateTime.Now.ToString("dd/MM/yyyy"); txtResign.Text = "30/01/2050"; EmpId(); } else { } }
public void BindDataForMenus() { DataTable dt = new DataTable(); dt.Columns.Add("MenuName"); foreach (DataRow row in Rolemaster.Get_RoleMaster().Tables[0].Rows) { dt.Columns.Add(row[1].ToString()); } int aa = 0; string a = ""; foreach (DataRow row in Menumaster.Get_MenuMaster().Tables[0].Rows) { dt.Rows.Add(row[1]); } grdMenuRoleMapping.DataSource = dt; grdMenuRoleMapping.DataBind(); DynamicControls(((System.Data.InternalDataCollectionBase)(dt.Columns)).Count); }