public void ProcessRequest(HttpContext context) { string cmd = (context.Request.Params["cmd"]); if (cmd != "EmitAuthFieldListForGivenAuthObj") { if (context.Session["AFWACSESSION"] == null) { throw new Exception("Must be in a legal R-AF session"); } session = context.Session["AFWACSESSION"] as AFWACsession; } context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-100); context.Response.AddHeader("pragma", "no-cache"); context.Response.AddHeader("cache-control", "private"); context.Response.CacheControl = "no-cache"; context.Response.ContentType = "text/plain"; CONNdedicated = HELPERS.NewOdbcConn_FORCE(); string arg1 = (context.Request.Params["arg1"]); string arg2 = ""; try { arg2 = (context.Request.Params["arg2"]); } catch (Exception ex2) { ; } string arg3 = ""; try { arg3 = (context.Request.Params["arg3"]); } catch (Exception ex3) { ; } string arg4 = ""; try { arg4 = (context.Request.Params["arg4"]); } catch (Exception ex4) { ; } try { switch (cmd) { case "SAP_AddObjsTo1251": SAP_AddObjsTo1251(context.Request.Params, context.Response); break; case "Edit1251row": SAP_EditObj1251(context.Request.Params, context.Response); break; case "Delete1251row": this.SAP_ToggleDeleteStatusOf1251row(context.Request.Params, context.Response); break; case "UnDelete1251row": this.SAP_ToggleDeleteStatusOf1251row(context.Request.Params, context.Response); break; case "EDIT_SingleRowSingleColumn": EDIT_SingleRowSingleColumn(arg1, arg2, arg3, arg4); break; case "EDIT_MultiRowsSingleColumn": EDIT_MultiRowsSingleColumn(arg1, arg2, arg3, arg4); break; case "JQDLGeditOrgAxis": JQDLGeditOrgAxis(int.Parse(arg1), arg2, arg3, arg4); break; case "JQDLGdeleteOrgAxis": JQDLGdeleteOrgAxis(int.Parse(arg1)); break; case "JQDLGnamePlusDescr": JQDLGnamePlusDescr(context.Request.Params, context.Response); break; case "DeleteSAPRole": SAP_deleteSapRole(context.Request.Params, context.Response); break; case "Edit1252row": Edit1252row(context.Request.Params, context.Response); break; case "Delete1252row": Manip1252row(context.Request.Params, context.Response, "DEL"); break; case "Undelete1252row": Manip1252row(context.Request.Params, context.Response, "UNDEL"); break; case "ComputeManifestString": ComputeManifestString(context.Response, arg1, arg2, arg3, arg4); break; case "ComputeSampleManifestStringsForApp": // arg1 is the application's numeric c_ID // arg2 is the formula to be used ComputeSampleManifestStringsForApp(context.Response, int.Parse(arg1), arg2); break; case "CreateWorkspaceOnEntAssSet": CreateWorkspaceOnEntAssSet(int.Parse(arg1) /*subprocessID*/, int.Parse(arg2) /*userID*/, arg3 /*comment*/); break; case "CloneBusRole": CloneBusRole(int.Parse(arg1), arg2, int.Parse(arg3), context.Response); break; case "FindUserByEID": FindUserByEID(arg1, arg2, context.Response); break; case "PublishEntAssSet": PublishEntAssSet(int.Parse(arg1), arg2); break; case "PublishSAPEntAssSet": PublishSAPEntAssSet(int.Parse(arg1), arg2); break; case "SetCommentForBroleApplPair": SetCommentForBroleApplPair(context.Request.Params, context.Response); break; case "JQDLGbusroleProperties": JQDLGbusroleProperties(context.Request.Params, context.Response); break; case "JQDLGsaproleProperties": JQDLGsaproleProperties(context.Request.Params, context.Response); break; case "JQDLGeditChgMgmt": JQDLGeditChgMgmt(context.Request.Params, context.Response); break; case "JQDLGeditChgMgmt_SAP": JQDLGeditChgMgmt_SAP(context.Request.Params, context.Response); break; case "JQDLGeditRoleOwner": JQDLGeditRoleOwner(context.Request.Params, context.Response); break; case "JQDLGassignReconcDiff": JQDLGassignReconcDiff(context.Request.Params, context.Response); break; case "JQDLGeditSAPRoleOwner": JQDLGeditSAPRoleOwner(context.Request.Params, context.Response); break; case "JQDLGeditAdditionalRoleRow": JQDLGeditAdditionalRoleRow(context.Request.Params, context.Response); break; case "RequenceSubprActivityRecord": RequenceSubprActivityRecord(context.Request.Params, context.Response); break; case "UpdateSubprActivityRecord": UpdateSubprActivityRecord(context.Request.Params, context.Response); break; case "EditSAPentitlement": EditSAPentitlement(context.Request.Params, context.Response); break; case "RegisterNewTcode": RegisterNewTcode(context.Request.Params, context.Response, arg1, arg2); break; case "FindTcode": // Returns the description for the tcode, or an HTML-encoded not-found message // suitable for display. ITcodeDictionary x = new ITcodeDictionary(HELPERS.NewOdbcConn_FORCE()); returnListTcodeDictionary[] entry = x.ListTcodeDictionary(null, " \"TcodeID\" = ? ", new string[] { arg1 }, ""); if (entry.Length == 0) { context.Response.Write("<span style='color:red'>NOT FOUND</span>"); return; } else { context.Response.Write(entry[0].Description); } break; case "EmitAuthFieldListForGivenAuthObj": EmitFieldList(int.Parse(arg1), context.Response); break; default: throw new Exception("Unknown action cmd"); break; } } catch (Exception e) { context.Response.Write(e.Message); context.Response.StatusCode = 500; } CONNdedicated.Close(); }
public static void ImportDataTableAsNewTcodeAssignmentSet( DataTable dt, int IDuser, int IDsubpr, System.Data.Odbc.OdbcConnection conn) { IUser Iuser = new IUser(conn); ISubProcess Isubpr = new ISubProcess(conn); ITcodeAssignmentSet Ieaset = new ITcodeAssignmentSet(conn); ITcodeAssignment Iea = new ITcodeAssignment(conn); ITcodeEntitlement Ientit = new ITcodeEntitlement(conn); ITcodeDictionary Idict = new ITcodeDictionary(conn); ISAProle Isr = new ISAProle(conn); int IDneweas = Ieaset.NewTcodeAssignmentSet (false, DateTime.Now, "Import from CSV", IDsubpr, IDuser); // These Get function are only useful for a read-only view of fields; // not for generating subordinate entities. returnGetTcodeAssignmentSet neweas = Ieaset.GetTcodeAssignmentSet(IDneweas); IEnumerator <System.Data.DataRow> x = (IEnumerator <System.Data.DataRow>)dt.Rows.GetEnumerator(); while (x.MoveNext()) { int IDsaprole; int IDtcode; if (x.Current[0].Equals(System.DBNull.Value)) { // Ignore any line with no value in the first field. // Often the end of the csv file has just lots of blank rows. continue; } // Make sure SAP role object exists; create if not. string saprole = (string)(x.Current["SAProle"]); RBSR_AUFW.DB.ISAProle.returnListSAProle[] xx = Isr.ListSAProle(null, "\"Name\" like ?", new string[] { saprole }, ""); if (xx.Length < 1) { // MUST ADD NEW ONE IDsaprole = Isr.NewSAProle(saprole, IDsubpr); } else { IDsaprole = xx[0].ID; } // Make sure Tcode exists in the Tcode dictionary string tcodeshortname = (string)(x.Current["TCODE Value"]); returnListTcodeDictionary[] xxx = Idict.ListTcodeDictionary (null, "\"TcodeID\" like ?", new string[] { tcodeshortname }, ""); if (xxx.Length < 1) { // MUST ADD NEW ONE IDtcode = Idict.NewTcodeDictionary(tcodeshortname, x.Current["TCODE Description"] as string); } else { IDtcode = xxx[0].ID; } int IDnewent = Ientit.NewTcodeEntitlement( x.Current["Standard Activity"] as string, x.Current["Type"] as string, x.Current["System"] as string, x.Current["Platform"] as string, IDtcode); Ientit.SetTcodeEntitlement(IDnewent, x.Current["Standard Activity"] as string, x.Current["Type"] as string, x.Current["System"] as string, x.Current["Platform"] as string, x.Current["AuthObj Name"] as string, x.Current["AuthObj Description"] as string, x.Current["Field-Level Security Value Description"] as string, x.Current["Field-Level Security Value"] as string, x.Current["Additional Comments"] as string, IDtcode); int IDnewentass = Iea.NewTcodeAssignment(IDneweas, IDsaprole, IDnewent); } }