protected void ddGroupName_SelectedIndexChanged(object sender, EventArgs e) { GroupId = Convert.ToInt32(ddGroupName.SelectedValue); IUserRole UserGroupManager; UserGroupManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration"); DataSet theOtherDS = UserGroupManager.GetUserGroupFeatureListByID(GroupId); GetFacilityServiceUserGroupData(theOtherDS); }
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 { } }
protected void Page_Load(object sender, EventArgs e) { //(Master.FindControl("lblheader") as Label).Text = "User Group Administration"; (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"]; } //grdUserGroupAdminForm.Attributes.Add( .ClientID + " ',); IUserRole UserGroupManager; try { if (Page.IsPostBack != true) { if (Request.QueryString["name"] != null) { AunthenticationFunction(); } Init(); UserGroupManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration"); iAllFormCount = grdUserGroupsForm.Rows.Count; iReportsCount = grdUserGroupsOther.Rows.Count; iAdminCount = grdUserGroupAdminForm.Rows.Count; if (iAllFormCount != 0) { grdUserGroupsForm.RowDataBound += new GridViewRowEventHandler(grdUserGroupsForm_RowDataBound); grdUserGroupsForm.HeaderRow.Controls[0].Load += new EventHandler(frmAdmin_UserGroup_Load); } if (iReportsCount != 0) { grdUserGroupsOther.RowDataBound += new GridViewRowEventHandler(grdUserGroupsOther_RowDataBound); grdUserGroupsOther.HeaderRow.Controls[0].Load += new EventHandler(frmAdmin_UserGroupOther_Load); } if (iAdminCount != 0) { grdUserGroupAdminForm.HeaderRow.Controls[0].Load += new EventHandler(frmAdmin_AdminForm_Load); } 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"]); DataSet theOtherDS = UserGroupManager.GetUserGroupFeatureListByID(GroupId); txtusergroupname.Text = Request.QueryString["Grpnm"].ToString(); #region "Fill Functions" int i = 0; if (theOtherDS.Tables[0].Rows.Count > 0) { for (i = 0; i < theOtherDS.Tables[0].Rows.Count; i++) { int j = 0; for (j = 0; j < grdUserGroupsForm.Rows.Count; j++) { if (grdUserGroupsForm.Rows[j].Cells[1].Text == theOtherDS.Tables[0].Rows[i]["featureId"].ToString()) { CheckBox theChkbox = ((CheckBox)grdUserGroupsForm.Rows[j].FindControl("chkFeature")); theChkbox.Checked = true; switch (theOtherDS.Tables[0].Rows[i]["functionid"].ToString()) { case "1": theChkbox = ((CheckBox)grdUserGroupsForm.Rows[j].FindControl("chkView")); theChkbox.Checked = true; break; case "2": theChkbox = ((CheckBox)grdUserGroupsForm.Rows[j].FindControl("chkUpdate")); theChkbox.Checked = true; break; case "3": theChkbox = ((CheckBox)grdUserGroupsForm.Rows[j].FindControl("chkDelete")); theChkbox.Checked = true; break; case "4": theChkbox = ((CheckBox)grdUserGroupsForm.Rows[j].FindControl("chkSave")); theChkbox.Checked = true; break; case "5": theChkbox = ((CheckBox)grdUserGroupsForm.Rows[j].FindControl("chkPrint")); theChkbox.Checked = true; break; } } } } } if (theOtherDS.Tables[1].Rows.Count > 0) { for (i = 0; i < theOtherDS.Tables[1].Rows.Count; i++) { for (int j = 0; j < grdUserGroupsOther.Rows.Count; j++) { if (grdUserGroupsOther.Rows[j].Cells[1].Text == theOtherDS.Tables[1].Rows[i]["featureId"].ToString()) { CheckBox theChkbox = (CheckBox)grdUserGroupsOther.Rows[j].FindControl("chkFeatureOther"); theChkbox.Checked = true; switch (theOtherDS.Tables[1].Rows[i]["functionid"].ToString()) { case "1": theChkbox = ((CheckBox)grdUserGroupsOther.Rows[j].FindControl("chkYes")); theChkbox.Checked = true; break; } } } } } if (theOtherDS.Tables[2].Rows.Count > 0) { for (i = 0; i < theOtherDS.Tables[2].Rows.Count; i++) { for (int j = 0; j < grdUserGroupAdminForm.Rows.Count; j++) { if (grdUserGroupAdminForm.Rows[j].Cells[1].Text == theOtherDS.Tables[2].Rows[i]["featureId"].ToString()) { CheckBox theChkbox = (CheckBox)grdUserGroupAdminForm.Rows[j].FindControl("chkForm"); theChkbox.Checked = true; switch (theOtherDS.Tables[2].Rows[i]["functionid"].ToString()) { case "1": theChkbox = ((CheckBox)grdUserGroupAdminForm.Rows[j].FindControl("chk1Yes")); theChkbox.Checked = true; break; } } } } } if (theOtherDS.Tables[3].Rows[0]["EnrollmentFlag"].ToString() == "1") { chkspenroll.Checked = true; } if (theOtherDS.Tables[3].Rows[0]["CareEndFlag"].ToString() == "1") { chkCareEndPrivilege.Checked = true; } if (theOtherDS.Tables[3].Rows[0]["IdentifierFlag"].ToString() == "1") { chkpatientIdentifiers.Checked = true; } /////////Not Required - Taken care by the User Authentication/////////// ////////////if (Session["AppUserName"].ToString() == "System Admin") ////////////{ //////////// btnsave.Enabled = true; ////////////} ////////////else ////////////{ //////////// btnsave.Enabled = false ; ////////////} //////////////////////////////////////////////////////////////////////// #endregion } } } catch (Exception err) { MsgBuilder theMsgBuilder = new MsgBuilder(); theMsgBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theMsgBuilder, this); return; } finally { UserGroupManager = null; } }