private void Manip1252row (System.Collections.Specialized.NameValueCollection P, HttpResponse httpResponse, string cmd) { int idExistingRow = int.Parse(P["IDentit"]); int IDrole = int.Parse(P["IDrole"]); int IDuser = int.Parse(P["IDuser"]); int IDws = int.Parse(P["IDws"]); IOrgValue1252 engineTCEnt = new IOrgValue1252(HELPERS.NewOdbcConn()); returnGetOrgValue1252 existingrow = engineTCEnt.GetOrgValue1252(idExistingRow); switch (cmd) { case "DEL": existingrow.EditStatus |= 4; break; case "UNDEL": existingrow.EditStatus &= 11; break; } engineTCEnt.SetOrgValue1252 (idExistingRow, existingrow.FieldName, existingrow.RangeLow, existingrow.RangeHigh, existingrow.TcodeAssignmentSetID, existingrow.SAProleID, existingrow.EditStatus); }
// This will be patterned after EditSapEntitlement private void Edit1252row(System.Collections.Specialized.NameValueCollection P, HttpResponse httpResponse) { string strIDtass = P["IDtass"]; // if (strIDtass == "ADD") then this is indeed an add, not an edit int IDrole = int.Parse(P["IDrole"]); int IDuser = int.Parse(P["IDuser"]); int IDws = int.Parse(P["IDws"]); IOrgValue1252 engineTCEnt = new IOrgValue1252(HELPERS.NewOdbcConn()); // First, we want to see if there is already, attached to this role, // a row with these same characteristics. // there is no comment field on this kind of row so this doesn't need the // "only comment changed" logic. int returnIDof1252row; char returnstat = SAP_HELPERS.CreateOrgValueAssignmentIfNotExists (IDws, engineTCEnt, IDrole, P["c_u_Field"], P["c_u_RangeLow"], P["c_u_RangeHigh"], 2, out returnIDof1252row); switch (returnstat) { case 'A': // This 1252 row did not yet exist for this SAP role so it was added. // If this was an attempt to edit an existing 1252 row, then the // existing one should be deleted. if (strIDtass != "ADD") { // Existing row must be marked as deleted. int idExisting1252row = int.Parse(strIDtass); returnGetOrgValue1252 rowExisting = engineTCEnt.GetOrgValue1252(idExisting1252row); engineTCEnt.SetOrgValue1252 (idExisting1252row, rowExisting.FieldName, rowExisting.RangeLow, rowExisting.RangeHigh, rowExisting.TcodeAssignmentSetID, rowExisting.SAProleID, (rowExisting.EditStatus | 4 /*deletionbit*/)); } break; } }