protected void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); try { IDrole = int.Parse(this.Request.Params["RoleID"]); this.session.idRole = IDrole; } catch (Exception ex) { IDrole = this.session.idRole; } IBusRole IFACEbrole = new IBusRole(HELPERS.NewOdbcConn()); brole = IFACEbrole.GetBusRole(IDrole); // We are now doing some sticky stuff so you can dive // into an old non-workspace EASet, and bounce up/down // without worrying about getting reset back to looking // at the workspace. //Session["INTcurWS"] = session.idWorkspace; Session["INTcurBUSROLE"] = session.idRole; }
private void CloneBusRole(int idBusRole, string newBusRoleName, int idWorkspace, HttpResponse response) { IBusRole engineBR = new IBusRole(HELPERS.NewOdbcConn_FORCE()); IEntAssignment engineEAS = new IEntAssignment(HELPERS.NewOdbcConn_FORCE()); returnGetBusRole detailsBusRole = engineBR.GetBusRole(idBusRole); int idNewBRole; try { idNewBRole = engineBR.NewBusRole(newBusRoleName, detailsBusRole.Description, detailsBusRole.SubProcessID); // Also copy over the notes and the owner info as well. engineBR.SetBusRole (idNewBRole, newBusRoleName, detailsBusRole.Description, detailsBusRole.OwnerPrimaryEID, detailsBusRole.OwnerSecondaryEID, detailsBusRole.DesignDetails); engineBR.SetBusRole(idNewBRole, detailsBusRole.RoleType_Abbrev); } catch (Exception exxx) { response.Write("ERROR: The given name was found to already be in use."); return; } returnListEntAssignmentByEntAssignmentSet[] ret = engineEAS.ListEntAssignmentByEntAssignmentSet(null, " \"BusRole\" = ? AND \"Status\" NOT IN ('X') ", new string[] { idBusRole.ToString() }, "", idWorkspace); for (int i = 0; i < ret.Length; i++) { engineEAS.NewEntAssignment ( idWorkspace, idNewBRole, ret[i].EntitlementID, "N"); } response.Write("The role was successfully cloned. Number of entitlement assignments: " + ret.Length); }
public string ROWSadditionalBusinessRoles() { IAdditionalBusRole engine = new IAdditionalBusRole(HELPERS.NewOdbcConn()); IBusRole engineBR = new IBusRole(HELPERS.NewOdbcConn()); returnListAdditionalBusRoleByBusRole[] list = engine.ListAdditionalBusRoleByBusRole(null, idBR); StringBuilder BUFFER = new StringBuilder(); foreach (returnListAdditionalBusRoleByBusRole cur in list) { returnGetBusRole detail = engineBR.GetBusRole(cur.idAdditionalBusRole); if (!detail.Name.Contains("//DEL_")) { BUFFER.Append("<tr>"); BUFFER.Append("<td>" + detail.RoleType_Displayable + "</td>"); BUFFER.Append("<td><a href='DETAILbusrole.aspx?idBR=" + detail.ID + "'>" + detail.Name + "</a></td>"); BUFFER.Append("<td>" + detail.Description + "</td>"); BUFFER.Append("</tr>"); } } return(BUFFER.ToString()); }
string sapviewmode = "I"; //interactive protected void Page_Load(object sender, EventArgs e) { try { idBR = int.Parse(Request.Params["idBR"]); } catch (Exception) { idBR = -432; } // Special viewing mode param added in May of 2010: // sapview=interactive or html // The default is the former sapviewmode = "I"; try { string mode = Request.Params["sapview"]; sapviewmode = mode.ToUpper().Substring(0, 1); } catch (Exception) { } if (PANEL_tcodelistingmode_HtmlTable != null) { switch (sapviewmode) { case "I": PANEL_tcodelistingmode_HtmlTable.Visible = false; break; case "H": PANEL_tcodelistingmode_interactive.Visible = false; break; } } IProcess engineProcess = new IProcess(HELPERS.NewOdbcConn()); ISubProcess engineSubProcess = new ISubProcess(HELPERS.NewOdbcConn()); IBusRole engineBR = new IBusRole(HELPERS.NewOdbcConn()); theBR = engineBR.GetBusRole(idBR); theSubProcess = engineSubProcess.GetSubProcess(theBR.SubProcessID); theProcess = engineProcess.GetProcess(theSubProcess.ProcessID); // Initialize dynamically-generated portions of the page if (PANELsapdesignnote != null) { IFuncApplNotes engine = new IFuncApplNotes(HELPERS.NewOdbcConn()); returnListFuncApplNotes[] returned = engine.ListFuncApplNotes (null, "\"REFapplication\" = ? AND \"BusRole\" = ?" /* SAP application is ID 57 */, new string[] { "57", idBR.ToString() }, ""); if (returned.Length == 0) { PANELsapdesignnote.Visible = false; } else { STATICTXTsapfuncappdesignnote.Text = returned[0].Comment; } } }
protected void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); MAPentIdToBabyEAssId = new Dictionary <int, int>(); try { IDrole = int.Parse(this.Request.Params["RoleID"]); } catch (Exception ex) { // Whilst debugging IDrole = 1; } IBusRole IFACEbrole = new IBusRole(HELPERS.NewOdbcConn()); brole = IFACEbrole.GetBusRole(IDrole); Session["STRcurBusRoleScope"] = IDrole; // NO LONGER USED: // Session["STRcurWS"] = this.session.idWorkspace; int IDeaset = -1; try { IDeaset = int.Parse(Session["INTcurWS"].ToString()); }catch (Exception) {} bool isreadonly = true; if (IDeaset == this.session.idWorkspace) { isreadonly = (!this.session.isWorkspaceOwner); } if (isreadonly) { // READ-ONLY - not in a workspace this.Grid1.AllowEditing = false; this.PANELcond_readonly.Visible = true; } else { this.PANELcond_readonly.Visible = false; } try { IDappl = int.Parse(this.Request.Params["AppID"]); session.idAppl = IDappl; } catch (Exception ex) { // Whilst debugging IDappl = session.idAppl; } IApplication IFACEappl = new IApplication(HELPERS.NewOdbcConn()); applDetails = IFACEappl.GetApplication(IDappl); this.Session["STRcurAppScope"] = applDetails.Name; }
public void OnItemCheckChanged(object sender, GridItemCheckChangedEventArgs oArgs) { int IDbusrole = int.Parse(oArgs.Item["c_id"].ToString()); returnGetBusRole detailsBusRole = engineBusRole.GetBusRole(IDbusrole); MAPbroleIdToName.Add(IDbusrole, detailsBusRole.Name); MAPbroleToSubproc.Add(IDbusrole, detailsBusRole.SubProcessID); if (oArgs.Checked) { QUEUEidsBusrolesToADD.Enqueue(IDbusrole); } else { QUEUEidsBusrolesToREMOVE.Enqueue(IDbusrole); } if (MAPsubprToEASet.ContainsKey(detailsBusRole.SubProcessID)) { return; } // This role is in a subprocess we have not yet analyzed. // Must determine if in workspace or ACTIVE status. // If that subpr is in a workspace owned by someone else, // the entire operation is aborted with no change being made. returnListEntAssignmentSetBySubProcess[] ret = engineEASet.ListEntAssignmentSetBySubProcess (null, "\"Status\" = ?", new string[] { "WORKSPACE" }, "", detailsBusRole.SubProcessID); if (ret.Length > 1) { throw new Exception("More than one WORKSPACE open simultaneously for subprocess " + oArgs.Item["NamePr"].ToString()); } if (ret.Length == 1) { // A workspace is open for this subprocess. // OK if userID matches this session's user if (ret[0].UserID == session.idUser) { // It's a match, we can use this workspace. HELPERS.infoEASet EAS = new HELPERS.infoEASet(); EAS.idEntAssSet = ret[0].ID; EAS.idEntAssSetCreator = ret[0].UserID; EAS.nameEntAssSetCreator = ret[0].UserLoginName; EAS.nameSubprocess = oArgs.Item["NamePr"].ToString(); EAS.strEntAssSetStatus = "WORKSPACE"; MAPsubprToEASet.Add(detailsBusRole.SubProcessID, EAS); } else { boolMustAbort = true; messages += "ERROR: Cannot make modifications regarding role " + oArgs.Item["c_u_Name"] + ". The workspace for " + oArgs.Item["NamePr"] + " is owned by a 3rd party (" + ret[0].UserLoginName + ").\n"; } } else { // Make sure there is an ACTIVE EASet to build a workspace from. ret = engineEASet.ListEntAssignmentSetBySubProcess (null, "\"Status\" = ?", new string[] { "ACTIVE" }, "", detailsBusRole.SubProcessID); if (ret.Length > 1) { throw new Exception("More than one ACTIVE entitlement-assignment set for " + oArgs.Item["NamePr"].ToString()); } if (ret.Length < 1) { throw new Exception("Subprocess has NO active entitlement-assignment set yet: " + oArgs.Item["NamePr"].ToString()); } if (ret.Length == 1) { HELPERS.infoEASet EAS = new HELPERS.infoEASet(); EAS.idEntAssSet = ret[0].ID; EAS.idEntAssSetCreator = ret[0].UserID; EAS.nameEntAssSetCreator = ret[0].UserLoginName; EAS.nameSubprocess = oArgs.Item["NamePr"].ToString(); EAS.strEntAssSetStatus = "ACTIVE"; MAPsubprToEASet.Add(detailsBusRole.SubProcessID, EAS); } } }