示例#1
0
        //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);
            }
        }
示例#2
0
        //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);
            }
        }
示例#3
0
        //Bind Grids
        #region [Bind Grids]

        public void BindGrids(DataSet ds)
        {
            GrdAssinedRole.DataSource = ds.Tables[0];
            GrdAssinedRole.DataBind();

            GrdEmployee.DataSource = ds.Tables[1];
            GrdEmployee.DataBind();
        }
示例#4
0
        //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);
            }
        }