//Delete Role #region [Delete Role] public void DeleteRole(string Uid) { try { objEWA = new EWA_Role(); objEWA.Action = "DeleteRole"; objEWA.UserId = Uid; objEWA.OrganizationId = Convert.ToInt32(Session["OrgId"].ToString()); objBL.DeleteRole_BL(objEWA); DDL_Role.ClearSelection(); GrdAssinedRole.DataSource = EmptyGridView(); GrdAssinedRole.DataBind(); GrdEmployee.DataSource = EmptyGridView(); GrdEmployee.DataBind(); msgBox.ShowMessage("Role removed Successfully !!!", "Successfull", UserControls.MessageBox.MessageStyle.Successfull); //GeneralErr("Role removed Successfully !!!"); } catch (Exception exp) { GeneralErr(exp.Message); } }
//Get All Role Data #region [Get All Role Data] public void GetAllRoleData() { try { if (DDL_Role.SelectedItem.Text == "Select") { GrdAssinedRole.DataSource = EmptyGridView(); GrdAssinedRole.DataBind(); GrdEmployee.DataSource = EmptyGridView(); GrdEmployee.DataBind(); } else { objEWA = new EWA_Role(); objEWA.UserType = DDL_Role.SelectedItem.Text; objEWA.OrganizationId = Convert.ToInt32(Session["OrgId"].ToString()); objEWA.IsActive = true; DataSet ds = new DataSet(); ds = objBL.GetRole_BL(objEWA); BindGrids(ds); } } catch (Exception exp) { GeneralErr(exp.Message); } }
//Bind Grids #region [Bind Grids] public void BindGrids(DataSet ds) { GrdAssinedRole.DataSource = ds.Tables[0]; GrdAssinedRole.DataBind(); GrdEmployee.DataSource = ds.Tables[1]; GrdEmployee.DataBind(); }
//Page Load #region [Page Load] protected void Page_Load(object sender, EventArgs e) { orgId = Convert.ToInt32(Session["OrgID"]); if (orgId == 0) { Response.Redirect("~/CMSHome.aspx"); } if (!IsPostBack) { //GetRoleData(); GrdAssinedRole.DataSource = EmptyGridView(); GrdAssinedRole.DataBind(); GrdEmployee.DataSource = EmptyGridView(); GrdEmployee.DataBind(); //ShowEmptyGridView(ds); } }