Exemplo n.º 1
0
    private void Init()
    {
        IUserRole UserGroupManager;

        UserGroupManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration");
        DataSet theDS = UserGroupManager.GetUserGroupFeatureList(Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(Session["AppLocationId"]));

        this.grdUserGroupsForm.DataSource     = theDS.Tables[1];
        this.grdUserGroupsOther.DataSource    = theDS.Tables[0];
        this.grdUserGroupAdminForm.DataSource = theDS.Tables[2];
        this.grdUserGroupAdminForm.DataBind();
        this.grdUserGroupsForm.DataBind();
        this.grdUserGroupsOther.DataBind();

        grdUserGroupAdminForm.Columns[1].Visible = false;
        grdUserGroupsForm.Columns[1].Visible     = false;
        grdUserGroupsOther.Columns[1].Visible    = false;
        if (Session["SystemId"].ToString() == "2")
        {
            TDChkEnrolID.Visible = true;
        }
        else
        {
            TDCheckCareEnd.Visible = true;
        }
    }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
            {
                IQCareMsgBox.Show("SessionExpired", this);
                Response.Redirect("~/frmlogin.aspx", true);
            }
            //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
            //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "User Group Administration";

            if (Request.QueryString["name"] != null)
            {
                lblh3.Text = Request.QueryString["name"];
            }
            try
            {
                if (Page.IsPostBack != true)
                {
                    if (Request.QueryString["name"] != null)
                    {
                        AunthenticationFunction();
                    }
                    if (lblh3.Text == "Add")
                    {
                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Name"] = "User Group Roles";
                        IQCareMsgBox.ShowConfirm("UserGroupDetailSaveRecord", theBuilder, btnsave);
                        lblh3.Text = "Add User Group";
                    }
                    else
                    {
                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Name"] = "User Group Roles";
                        IQCareMsgBox.ShowConfirm("UserGroupDetailUpdateRecord", theBuilder, btnsave);
                        lblh3.Text = "Edit User Group";
                    }

                    if (Request.QueryString["name"] != null && Request.QueryString["name"] == "Edit")
                    {
                        GroupId = Convert.ToInt32(Request.QueryString["GroupID"]);
                        IUserRole UserGroupManager;
                        UserGroupManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration");
                        DataSet       theDS       = UserGroupManager.GetUserGroupFeatureList(1, 0);
                        BindFunctions BindManager = new BindFunctions();
                        DataView      DVDD        = new DataView(theDS.Tables[4]);
                        DVDD.RowFilter = "GroupID <> " + GroupId + "";
                        BindManager.BindCombo(ddGroupName, DVDD.ToTable(), "GroupName", "GroupID");
                        ViewState["DataPopulate"] = theDS;
                        //GetGeneralDataforTreeView(theDS.Tables[1]);
                        //GetModuleCustomListTreeView(theDS.Tables[3]);
                        //GetCommonItemsinTreeView(theDS.Tables[0]);
                        //GetSPlPriviledgesinTreeView(theDS.Tables[5]);
                        DataSet theOtherDS = UserGroupManager.GetUserGroupFeatureListByID(GroupId);
                        GetFacilityServiceUserGroupData(theOtherDS);
                        txtusergroupname.Text = Request.QueryString["Grpnm"].ToString();
                    }
                    else if (Request.QueryString["name"] != null && Request.QueryString["name"] == "Add")
                    {
                        IUserRole UserGroupManager;
                        UserGroupManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration");
                        DataSet       theDS       = UserGroupManager.GetUserGroupFeatureList(1, 0);
                        BindFunctions BindManager = new BindFunctions();
                        DataView      DVDD        = new DataView(theDS.Tables[4]);
                        DVDD.RowFilter = "GroupID <> " + GroupId + "";
                        BindManager.BindCombo(ddGroupName, DVDD.ToTable(), "GroupName", "GroupID");
                        ViewState["DataPopulate"] = theDS;
                        //GetGeneralDataforTreeView(theDS.Tables[1]);
                        //GetModuleCustomListTreeView(theDS.Tables[3]);
                        //GetCommonItemsinTreeView(theDS.Tables[0]);
                        //GetSPlPriviledgesinTreeView(theDS.Tables[5]);
                    }
                }
            }
            catch (Exception err)
            {
                MsgBuilder theMsgBuilder = new MsgBuilder();
                theMsgBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theMsgBuilder, this);
                return;
            }
            finally
            {
            }
        }