protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString()); if (Session["username"] == null) { Response.Redirect("~/Logout.aspx"); } else { BaseDepartmentBind1(); bind_district1(); bl.User_id = Session["username"].ToString(); rd = dl.select_admin_info(bl); if (rd.table.Rows.Count > 0) { bl1.Role = rd.table.Rows[0]["RollID"].ToString(); } bl1.State_id = rd.table.Rows[0]["state_id"].ToString(); bl1.District_id = rd.table.Rows[0]["district_id"].ToString(); bl1.Base_department_id = rd.table.Rows[0]["base_department_id"].ToString(); // bl1.NewOfficeCode = rd.table.Rows[0]["NewOfficeCode"].ToString(); h_roll_id.Value = bl1.Role; if (bl1.Role == "1") { h_roll_id.Value = bl1.Role; } else if (bl1.Role == "4") { ddl_district1.Enabled = false; h_district_id.Value = bl1.District_id; ddl_district1.SelectedValue = bl1.District_id; } else if (bl1.Role == "5") { ddl_department1.Enabled = false; ddl_district1.Enabled = false; h_district_id.Value = bl1.District_id; ddl_district1.SelectedValue = bl1.District_id; h_department_code.Value = bl1.Base_department_id; ddl_department1.SelectedValue = bl1.Base_department_id; h_offfice_code.Value = bl1.NewOfficeCode; } else { Utilities.MessageBox_UpdatePanel_Redirect(udp, "You Are Not Authorised For Take Action On Permission", "../logout.aspx"); } //bind_employee(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == null) { Response.Redirect("../LogOut.aspx"); } if (!Page.IsPostBack) { string userID = Session["username"].ToString(); bl.User_id = userID; string rollid = null; dt = dl.select_admin_info(bl); if (dt.table.Rows.Count > 0) { rollid = dt.table.Rows[0]["RollID"].ToString(); h_roll_id.Value = rollid; if (rollid == "1") // DIO ROll ID { bind_district(); BaseDepartmentBind(); OfficeBind(); Bind_Employee(); } else if (rollid == "4" || rollid == "5") { string dist_id = dt.table.Rows[0]["district_id"].ToString(); bind_district(); DDL_District.SelectedValue = dist_id; DDL_District.Enabled = false; BaseDepartmentBind(); OfficeBind(); Bind_Employee(); } else // Nodel admin { } } grid_bind(); txt_user_name.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == null) { Response.Redirect("../LogOut.aspx"); } if (!Page.IsPostBack) { Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString()); string userID = Session["username"].ToString(); bl.User_id = userID; bl.Emp_code1 = Session["EmpMapID"].ToString(); string rollid = null; bl.Role_id = Session["role"].ToString(); rollid = bl.Role_id; dt = dl.select_admin_info(bl); if (dt.table.Rows.Count > 0) { h_roll_id.Value = Session["role"].ToString(); if (rollid == "1") // DIO ROll ID { bind_district(); BaseDepartmentBind(); OfficeBind(); Bind_Employee(); } else if (rollid == "4") { bl.State = dt.table.Rows[0]["state_id"].ToString(); string dist_id = dt.table.Rows[0]["district_id"].ToString(); bind_district(); DDL_District.SelectedValue = dist_id; DDL_District.Enabled = false; BaseDepartmentBind(); OfficeBind(); Bind_Employee(); } else if (rollid == "5") // Nodel admin { string dic, ofc, bd = ""; bl.State = dt.table.Rows[0]["state_id"].ToString(); bl.Base_department_id = dt.table.Rows[0]["base_department_id"].ToString(); dic = dt.table.Rows[0]["district_id"].ToString(); bd = dt.table.Rows[0]["base_department_id"].ToString(); ofc = dt.table.Rows[0]["office_id"].ToString(); bl1.Office_id = dt.table.Rows[0]["office_id"].ToString(); bind_district(); DDL_District.SelectedValue = dic; DDL_District.Enabled = false; BaseDepartmentBind(); DDL_Department.SelectedValue = bd; DDL_Department.Enabled = false; OfficeBind(); DDL_Office.SelectedValue = ofc; DDL_Office.Enabled = false; Bind_Employee(); } } grid_bind(); txt_user_name.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Session["CheckRefresh"] = Server.UrlDecode(DateTime.Now.ToString()); if (Session["username"] == null) { Response.Redirect("~/logout.aspx"); } else { string userID = Session["username"].ToString(); bl.User_id = userID; bl.Role_id = Session["role"].ToString(); bl.Emp_code1 = Session["EmpMapID"].ToString(); string rollid = null; rd = dl.select_admin_info(bl); if (rd.table.Rows.Count > 0) { rollid = Session["role"].ToString(); h_roll_id.Value = rollid; if (rollid == "4" || rollid == "5") // DIO ROll ID { ddl_dist_view.Visible = false; rfv_district1.Enabled = false; txt_dist_view.Visible = true; txt_district1.Visible = true; ddl_district1.SelectedValue = rd.table.Rows[0]["district_id"].ToString(); txt_district1.Text = rd.table.Rows[0]["District_Name_En"].ToString(); bind_district(); ddl_district.SelectedValue = rd.table.Rows[0]["district_id"].ToString(); ddl_district.Enabled = false; rfv_district.Enabled = false; if (rollid == "5") { BaseDepartmentBind1(); ddl_department1.SelectedValue = rd.table.Rows[0]["base_department_id"].ToString(); ddl_department1.Enabled = false; rfv_department1.Enabled = false; BaseDepartmentBind(); ddl_department.SelectedValue = rd.table.Rows[0]["base_department_id"].ToString(); ddl_department.Enabled = false; RFV_department.Enabled = false; } } else { ddl_dist_view.Visible = true; rfv_district1.Enabled = true; txt_dist_view.Visible = false; txt_district1.Visible = false; } bind_district(); bind_district1(); BaseDepartmentBind(); BaseDepartmentBind1(); BindDesignation(); ChargeTypeBind(); OfficeCategoryBind(); BindOfficer1(); OfficeLevelBind(); OfficeBind(); bindpermission(); bindrole(); bind_GridView(); } } } } // End of Page Load
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == null) { Response.Redirect("~/Login.aspx"); } else { string userID = Session["username"].ToString(); bl_empMap bl = new bl_empMap(); dl_empMap dl = new dl_empMap(); bl.User_id = userID; string rollid = null; rd = dl.select_admin_info(bl); if (rd.table.Rows.Count > 0) { rollid = rd.table.Rows[0]["RollID"].ToString(); h_roll_id.Value = rollid; if (rollid == "4" || rollid == "5") // DIO ROll ID { ddl_dist_view.Visible = false; rfv_district1.Enabled = false; txt_dist_view.Visible = true; txt_district1.Visible = true; ddl_district1.SelectedValue = rd.table.Rows[0]["district_id"].ToString(); txt_district1.Text = rd.table.Rows[0]["District_Name_En"].ToString(); bind_district(); ddl_district.SelectedValue = rd.table.Rows[0]["district_id"].ToString(); ddl_district.Enabled = false; rfv_district.Enabled = false; if (rollid == "5") { BaseDepartmentBind1(); ddl_department1.SelectedValue = rd.table.Rows[0]["base_department_id"].ToString(); ddl_department1.Enabled = false; rfv_department1.Enabled = false; BaseDepartmentBind(); ddl_department.SelectedValue = rd.table.Rows[0]["base_department_id"].ToString(); ddl_department.Enabled = false; RFV_department.Enabled = false; } } else { ddl_dist_view.Visible = true; rfv_district1.Enabled = true; txt_dist_view.Visible = false; txt_district1.Visible = false; } } // captchaStatus = false; if (!Page.IsPostBack) { bind_GridView(); bind_district(); BaseDepartmentBind(); OfficeCategoryBind(); OfficeLevelBind(); OfficeBind(); BindDesignation(); ChargeTypeBind(); // Below is for selecting employee in first part bind_district1(); BaseDepartmentBind1(); OfficeCategoryBind1(); OfficeLevelBind1(); OfficeBind1(); BindOfficer1(); BindDesignation1(); // first part end ddl_Active.SelectedValue = "Y"; bindpermission(); bindrole(); } } } // End of Page Load