private void SAP_EditObj1251(System.Collections.Specialized.NameValueCollection P, HttpResponse httpResponse)
        {
            System.Data.Odbc.OdbcConnection conn = HELPERS.NewOdbcConn_FORCE();
            IAuthRow1251 engine1251 = new IAuthRow1251(conn);

            int IDobjtoedit = int.Parse(P["IDentit"]);

            returnGetAuthRow1251 curobj =
                engine1251.GetAuthRow1251(IDobjtoedit);

            if (
                (curobj.RangeLow == P["c_u_RangeLow"])
                &&
                (curobj.RangeHigh == P["c_u_RangeHigh"])
                )
            {
                httpResponse.Write("No change was noted, so no action was performed.");
                return;
            }


            engine1251.SetAuthRow1251
                (IDobjtoedit, P["c_u_RangeLow"], P["c_u_RangeHigh"], curobj.SAPauthObjID, curobj.SAPauthFieldID, curobj.TcodeAssignmentSetID, curobj.SAProleID,
                curobj.EditStatus | 8 /*modified*/);
        }
        private void SetCommentForBroleApplPair
            (System.Collections.Specialized.NameValueCollection P, HttpResponse httpResponse)
        {
            IFuncApplNotes engine = new IFuncApplNotes(HELPERS.NewOdbcConn());

            string strIDcuredit = P["idcuredit"];

            int i = 0;

            /*
             * P["FANtext"]
             * null
             * P["text"]
             * "BASIS"
             * P["idbrole"]
             * "218"
             * P["idappl"]
             * "77"
             * */

            int idBRole = int.Parse(P["idbrole"]);
            int idAppl  = int.Parse(P["idappl"]);

            int idcuredit;

            if (strIDcuredit == "")
            {
                idcuredit = engine.NewFuncApplNotes(idBRole, idAppl, P["text"]);
            }
            else
            {
                idcuredit = int.Parse(strIDcuredit);
                engine.SetFuncApplNotes(idcuredit, idAppl, P["text"], idBRole);
            }
        }
Exemple #3
0
        /// <summary>
        ///
        /// update a row in table t_RBSR_AUFW_u_EntAssignmentSet.
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Status"></param>
        /// <param name="DATETIMElock"></param>
        /// <param name="Commentary"></param>
        /// <param name="SubProcessID"></param>
        /// <param name="UserID"></param>
        /// <param name="DATETIMEbirth"></param>
        /// <returns>Number of affected rows.</returns>
        public int SetEntAssignmentSet(int ID, string Status, DateTime?DATETIMElock, string Commentary, int SubProcessID, int UserID, DateTime?DATETIMEbirth)
        {
            int rv = 0;

            DBConnect();
            OdbcCommand cmd = _dbConnection.CreateCommand();

            cmd.CommandText = "update \"t_RBSR_AUFW_u_EntAssignmentSet\" set \"c_u_Status\"=?,\"c_u_DATETIMElock\"=?,\"c_u_Commentary\"=?,\"c_r_SubProcess\"=?,\"c_r_User\"=?,\"c_u_DATETIMEbirth\"=? where \"c_id\" = ?";
            cmd.Parameters.Add("c_u_Status", OdbcType.NVarChar, 10);
            cmd.Parameters["c_u_Status"].Value = (Status != null ? (object)Status : DBNull.Value);
            cmd.Parameters.Add("c_u_DATETIMElock", OdbcType.DateTime);
            cmd.Parameters["c_u_DATETIMElock"].Value = (DATETIMElock.HasValue ? HELPERS.SetSafeDBDate(DATETIMElock.Value) : DBNull.Value);
            cmd.Parameters.Add("c_u_Commentary", OdbcType.NVarChar, 1024);
            cmd.Parameters["c_u_Commentary"].Value = (Commentary != null ? (object)Commentary : DBNull.Value);
            cmd.Parameters.Add("c_r_SubProcess", OdbcType.Int);
            cmd.Parameters["c_r_SubProcess"].Value = (object)SubProcessID;
            cmd.Parameters.Add("c_r_User", OdbcType.Int);
            cmd.Parameters["c_r_User"].Value = (object)UserID;
            cmd.Parameters.Add("c_u_DATETIMEbirth", OdbcType.DateTime);
            cmd.Parameters["c_u_DATETIMEbirth"].Value = (DATETIMEbirth.HasValue ? HELPERS.SetSafeDBDate(DATETIMEbirth.Value) : DBNull.Value);
            cmd.Parameters.Add("c_id", OdbcType.Int);
            cmd.Parameters["c_id"].Value = (object)ID;
            cmd.Connection = _dbConnection;
            rv             = cmd.ExecuteNonQuery();
            if (rv != 1)
            {
                cmd.Dispose(); DBClose(); throw new Exception("Update resulted in " + rv.ToString() + " objects being updated!");
            }
            cmd.Dispose();
            DBClose();
            return(rv);
        }
        public int SetChangeManagementEvent(int ID, string Who, DateTime?TimeStamp, string Commentary)
        {
            int rv = 0;

            DBConnect();
            OdbcCommand cmd = _dbConnection.CreateCommand();

            cmd.CommandText = "update \"t_RBSR_AUFW_u_ChangeManagementEvent\" set \"c_u_Who\"=?,\"c_u_TimeStamp\"=?,\"c_u_Commentary\"=? where \"c_id\" = ?";
            cmd.Parameters.Add("c_u_Who", OdbcType.NVarChar, 50);
            cmd.Parameters["c_u_Who"].Value = (Who != null ? (object)Who : DBNull.Value);
            cmd.Parameters.Add("c_u_TimeStamp", OdbcType.DateTime);
            cmd.Parameters["c_u_TimeStamp"].Value = (TimeStamp.HasValue ? HELPERS.SetSafeDBDate(TimeStamp.Value) : DBNull.Value);
            cmd.Parameters.Add("c_u_Commentary", OdbcType.NText);
            cmd.Parameters["c_u_Commentary"].Value = (Commentary != null ? (object)Commentary : DBNull.Value);
            cmd.Parameters.Add("c_id", OdbcType.Int);
            cmd.Parameters["c_id"].Value = (object)ID;
            cmd.Connection = _dbConnection;
            rv             = cmd.ExecuteNonQuery();
            if (rv != 1)
            {
                cmd.Dispose(); DBClose(); throw new Exception("Update resulted in " + rv.ToString() + " objects being updated!");
            }
            cmd.Dispose();
            DBClose();
            return(rv);
        }
Exemple #5
0
        private void SAPWSdel(HttpContext context, int idEASet)
        {
            ITcodeAssignmentSet         engine = new ITcodeAssignmentSet(HELPERS.NewOdbcConn());
            returnGetTcodeAssignmentSet props  = engine.GetTcodeAssignmentSet(idEASet);

            if (props.Status != "WORKSPACE")
            {
                throw new Exception("Only open workspaces may be deleted.  Archived or active entitlement sets may not be deleted.");
            }
            if (props.UserID != this.session.idUser)
            {
                throw new Exception("Only the owner has permission to delete a workspace.");
            }

            engine.SetTcodeAssignmentSet
                (idEASet, DateTime.Now,
                props.Commentary + " (DELETED)", props.SubProcessID, props.UserID, "deleted");

            if (idEASet == this.session.idWorkspace)
            {
                // Make sure this user is not still "logged in" to the now-dead workspace
                this.session.idWorkspace_SAP          = -1;
                this.session.idUserWorkspaceOwner_SAP = -1;
            }
            context.Response.Write("OK\n");
        }
Exemple #6
0
        /// <summary>
        ///
        /// update a row in table t_RBSR_AUFW_u_AdditionalBusRole.
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="idAdditionalBusRole"></param>
        /// <param name="BusRoleID"></param>
        /// <param name="Comment"></param>
        /// <param name="RecertificationInterval"></param>
        /// <param name="RecertificationStartDate"></param>
        /// <param name="ExpirationDate"></param>
        /// <returns>Number of affected rows.</returns>
        public int SetAdditionalBusRole(int ID, int idAdditionalBusRole, int BusRoleID, string Comment, string RecertificationInterval, DateTime?RecertificationStartDate, DateTime?ExpirationDate)
        {
            int rv = 0;

            DBConnect();
            OdbcCommand cmd = _dbConnection.CreateCommand();

            cmd.CommandText = "update \"t_RBSR_AUFW_u_AdditionalBusRole\" set \"c_u_idAdditionalBusRole\"=?,\"c_r_BusRole\"=?,\"c_u_Comment\"=?,\"c_u_RecertificationInterval\"=?,\"c_u_RecertificationStartDate\"=?,\"c_u_ExpirationDate\"=? where \"c_id\" = ?";
            cmd.Parameters.Add("c_u_idAdditionalBusRole", OdbcType.Int);
            cmd.Parameters["c_u_idAdditionalBusRole"].Value = (object)idAdditionalBusRole;
            cmd.Parameters.Add("c_r_BusRole", OdbcType.Int);
            cmd.Parameters["c_r_BusRole"].Value = (object)BusRoleID;
            cmd.Parameters.Add("c_u_Comment", OdbcType.NVarChar, 1024);
            cmd.Parameters["c_u_Comment"].Value = (Comment != null ? (object)Comment : DBNull.Value);
            cmd.Parameters.Add("c_u_RecertificationInterval", OdbcType.NVarChar, 15);
            cmd.Parameters["c_u_RecertificationInterval"].Value = (RecertificationInterval != null ? (object)RecertificationInterval : DBNull.Value);
            cmd.Parameters.Add("c_u_RecertificationStartDate", OdbcType.DateTime);
            cmd.Parameters["c_u_RecertificationStartDate"].Value = ((RecertificationStartDate.HasValue) ? HELPERS.SetSafeDBDate(RecertificationStartDate.Value) : DBNull.Value);
            cmd.Parameters.Add("c_u_ExpirationDate", OdbcType.DateTime);
            cmd.Parameters["c_u_ExpirationDate"].Value = (ExpirationDate.HasValue ? HELPERS.SetSafeDBDate(ExpirationDate.Value) : DBNull.Value);
            cmd.Parameters.Add("c_id", OdbcType.Int);
            cmd.Parameters["c_id"].Value = (object)ID;
            cmd.Connection = _dbConnection;
            rv             = cmd.ExecuteNonQuery();
            if (rv != 1)
            {
                cmd.Dispose(); DBClose(); throw new Exception("Update resulted in " + rv.ToString() + " objects being updated!");
            }
            cmd.Dispose();
            DBClose();
            return(rv);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/csv";
            context.Response.AddHeader("Content-Disposition",
                                       "filename=raf_busrolepersonnel_mappings_complete.csv;attachment");


            OdbcCommand cmd = new OdbcCommand();

            cmd.Connection = HELPERS.NewOdbcConn();

            // IF YOU MAKE ANY CHANGE TO THE NUMBER OF FIELDS BEING DISPLAYED,
            // BE SURE TO CHANGE THE BELOW FOR LOOP SO IT KNOWS HOW MANY COLUMNS TO DISPLAY.
            cmd.CommandText =
                @"
select  
BROLE.c_u_Name,
BROTYPE.ForDisplay,
BROWN.c_u_EID, 
BROWN.c_u_Geography,
UUSER.c_u_NameSurname,
UUSER.c_u_NameFirst,
UUSER.c_u_Name

FROM

t_RBSR_AUFW_u_BusRoleOwner BROWN

left outer join t_RBSR_AUFW_u_User UUSER
   on  BROWN.c_u_EID = UUSER.c_u_EID

left outer join t_RBSR_AUFW_u_BusRole BROLE
   on  BROWN.c_r_BusRole = BROLE.c_id

left outer join DICT_RoleOwnerType BROTYPE
   on  BROWN.c_u_Rank = BROTYPE.Abbrev

WHERE BROLE.c_u_Name NOT LIKE '%//DEL%'

order by BROLE.c_u_Name, BROTYPE.Abbrev, BROWN.c_u_EID
";


            context.Response.Write("RoleName,Rank,EID,Geography,Surname,FirstName,RAFusername\n");


            OdbcDataReader dr = cmd.ExecuteReader();



            while (dr.Read())
            {
                for (int i = 0; i < 7; i++)
                {
                    context.Response.Write(CSVquoteize(dr.GetValue(i).ToString()) + ",");
                }
                context.Response.Write("\n");
            }
            dr.Close();
        }
        private void ComputeSampleManifestStringsForApp
            (HttpResponse resp, int IDapplication, string formula)
        {
            // Get a list of active entitlements for the given application
            string sql =
                @"
SELECT TOP 20 c_id FROM t_RBSR_AUFW_u_Entitlement
WHERE c_u_Application = (SELECT c_u_Name FROM t_RBSR_AUFW_u_Application WHERE c_id=" + IDapplication +
                ") AND c_u_Status = 'A';";
            OdbcDataReader reader = HELPERS.RunSqlSelect(sql);

            IEntitlement engine = new IEntitlement(HELPERS.NewOdbcConn_FORCE());

            while (reader.Read())
            {
                int IDentitlement         = reader.GetInt32(0);
                returnGetEntitlement seed = new returnGetEntitlement();
                bool hasBeenSeeded        = false;

                try
                {
                    seed          = engine.GetEntitlement(IDentitlement);
                    hasBeenSeeded = true;
                }
                catch (Exception eeeeignore) { }

                resp.Write(HELPERS.CalcManifestString(seed, formula) + "<BR/>\n");
            }
        }
Exemple #9
0
        public string rowsOwnersApprovers()
        {
            StringBuilder BUFFER = new StringBuilder();
            IBusRoleOwner engine = new IBusRoleOwner(HELPERS.NewOdbcConn());
            IUser         DBuser = new IUser(HELPERS.NewOdbcConn());

            returnListBusRoleOwnerByBusRole[] listowners
                = engine.ListBusRoleOwnerByBusRole(null, idBR);

            foreach (returnListBusRoleOwnerByBusRole cur in listowners)
            {
                returnListUser[] theUser =
                    DBuser.ListUser(null, "\"EID\" LIKE ?", new string[] { cur.EID }, "");
                BUFFER.Append("<tr><td>" + cur.RankFriendly + "</td>");
                BUFFER.Append("    <td>");
                if (theUser.Length == 1)
                {
                    BUFFER.Append(theUser[0].NameFirst + " " + theUser[0].NameSurname);
                }
                BUFFER.Append("</td>\n");
                BUFFER.Append("<td>" + cur.EID + "</td>");
                BUFFER.Append("</tr>\n");
            }
            return(BUFFER.ToString());
        }
        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);
        }
        private void FindUserByEID(string eid, string callerdata, HttpResponse OUT)
        {
            IUser engine = new IUser(HELPERS.NewOdbcConn_FORCE());

            returnListUser[] ret = engine.ListUser(null, "\"EID\" LIKE ?", new string[] { eid }, "");
            if (ret.Length != 1)
            {
                OUT.Write(callerdata + "|" + "NOTFOUND");
            }
            else if (ret.Length == 1)
            {
                if (ret[0].NameSurname == null)
                {
                    OUT.Write(callerdata + "|" + "USERID: " + ret[0].Name + "|" + "?");
                }
                else
                {
                    OUT.Write(callerdata + "|" + ret[0].NameSurname + "|" + ret[0].NameFirst);
                }
            }
            else
            {
                OUT.Write(callerdata + "|" + "NOTFOUND");
            }
        }
        private void SAP_ToggleDeleteStatusOf1251row(System.Collections.Specialized.NameValueCollection P, HttpResponse httpResponse)
        {
            System.Data.Odbc.OdbcConnection conn = HELPERS.NewOdbcConn_FORCE();
            IAuthRow1251 engine1251 = new IAuthRow1251(conn);

            int IDobjtoedit = int.Parse(P["IDentit"]);

            returnGetAuthRow1251 curobj =
                engine1251.GetAuthRow1251(IDobjtoedit);

            int newEditStatus;

            if (0 != (curobj.EditStatus & 4))
            {
                newEditStatus = curobj.EditStatus & (8 + 2 + 1);
            }
            else
            {
                newEditStatus = curobj.EditStatus + 4;
            }

            engine1251.SetAuthRow1251
                (IDobjtoedit, curobj.RangeLow, curobj.RangeHigh, curobj.SAPauthObjID, curobj.SAPauthFieldID, curobj.TcodeAssignmentSetID, curobj.SAProleID,
                newEditStatus);
        }
Exemple #13
0
        /// <summary>
        ///
        /// update a row in table t_RBSR_AUFW_u_TcodeAssignmentSet.
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="tstamp"></param>
        /// <param name="Commentary"></param>
        /// <param name="SubProcessID"></param>
        /// <param name="UserID"></param>
        /// <param name="Status"></param>
        /// <returns>Number of affected rows.</returns>
        public int SetTcodeAssignmentSet(int ID, DateTime tstamp, string Commentary, int SubProcessID, int UserID, string Status)
        {
            int rv = 0;

            DBConnect();
            OdbcCommand cmd = _dbConnection.CreateCommand();

            cmd.CommandText = "update \"t_RBSR_AUFW_u_TcodeAssignmentSet\" set \"c_u_tstamp\"=?,\"c_u_Commentary\"=?,\"c_r_SubProcess\"=?,\"c_r_User\"=?,\"c_u_Status\"=? where \"c_id\" = ?";

            cmd.Parameters.Add("c_u_tstamp", OdbcType.DateTime);
            cmd.Parameters["c_u_tstamp"].Value = HELPERS.SetSafeDBDate(tstamp);
            cmd.Parameters.Add("c_u_Commentary", OdbcType.NVarChar, 1024);
            cmd.Parameters["c_u_Commentary"].Value = (Commentary != null ? (object)Commentary : DBNull.Value);
            cmd.Parameters.Add("c_r_SubProcess", OdbcType.Int);
            cmd.Parameters["c_r_SubProcess"].Value = (object)SubProcessID;
            cmd.Parameters.Add("c_r_User", OdbcType.Int);
            cmd.Parameters["c_r_User"].Value = (object)UserID;
            if (Status == null)
            {
                cmd.Dispose(); DBClose(); throw new Exception("Status must not be null!");
            }
            cmd.Parameters.Add("c_u_Status", OdbcType.NVarChar, 50);
            cmd.Parameters["c_u_Status"].Value = (Status != null ? (object)Status : DBNull.Value);
            cmd.Parameters.Add("c_id", OdbcType.Int);
            cmd.Parameters["c_id"].Value = (object)ID;
            cmd.Connection = _dbConnection;
            rv             = cmd.ExecuteNonQuery();
            if (rv != 1)
            {
                cmd.Dispose(); DBClose(); throw new Exception("Update resulted in " + rv.ToString() + " objects being updated!");
            }
            cmd.Dispose();
            DBClose();
            return(rv);
        }
Exemple #14
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/csv";
            context.Response.AddHeader("Content-Disposition",
                                       "filename=export.csv;attachment");

            int idWS = Int32.Parse(context.Request.Params["id"]);

            OdbcCommand cmd = new OdbcCommand();

            cmd.Connection  = HELPERS.NewOdbcConn();
            cmd.CommandText =
                "SELECT ROLE.c_u_Name as RoleName, " +
                "VEC.c_u_StandardActivity as StandardActivity, " +
                "VEC.c_u_RoleType as RoleType, " +
                "VEC.c_u_Application as Application, " +
                "VEC.c_u_System as System, " +
                "VEC.c_u_Platform as Platform, " +
                "VEC.c_u_EntitlementName as EntitlementName, " +
                "VEC.c_u_EntitlementValue as EntitlementValue, " +
                "VEC.c_u_AuthObjValue as AuthObjValue, " +
                "VEC.c_u_FieldSecName as FieldSecName, " +
                "VEC.c_u_FieldSecValue as FieldSecValue, " +
                "VEC.c_u_Commentary as Commentary " +
                //		  "VEC.c_u_EditStatus as EditStatus " +
                "FROM t_r_BusRoleWorkspaceEntitlement LINK " +
                "LEFT OUTER JOIN t_RBSR_AUFW_u_BusRole ROLE ON LINK.c_r_BusRole = ROLE.c_id " +
                "LEFT OUTER JOIN t_RBSR_AUFW_u_WorkspaceEntitlement VEC ON LINK.c_r_WorkspaceEntitlement = VEC.c_id " +
                "WHERE LINK.c_r_EditingWorkspace = ?;";
            cmd.Parameters.Add("c_r_EditingWorkspace", OdbcType.Int);
            cmd.Parameters["c_r_EditingWorkspace"].Value = (object)idWS;

            OdbcDataReader dr = cmd.ExecuteReader();

            int indexChecksum = -32;

            for (int i = 0; i < dr.VisibleFieldCount; i++)
            {
                context.Response.Write(CSVquoteize(dr.GetName(i)) + ",");
                if (dr.GetName(i) == "c_u_CHECKSUM")
                {
                    indexChecksum = i;
                }
            }
            context.Response.Write("\n");
            while (dr.Read())
            {
                for (int i = 0; i < dr.VisibleFieldCount; i++)
                {
                    if (i != indexChecksum)
                    {
                        context.Response.Write(CSVquoteize(dr.GetValue(i) as string) + ",");
                    }
                }
                context.Response.Write("\n");
            }
            dr.Close();
        }
        public void EDIT_SingleRowSingleColumn
            (string tblname, string rowid, string colname, string newval)
        {
            string thesql =
                "UPDATE t_RBSR_AUFW_u_" + tblname +
                " SET " + colname + " = '" + newval.Replace("\'", "\'\'") + "' WHERE c_id=" + rowid + ";";

            HELPERS.RunSql(thesql);
        }
Exemple #16
0
        private void EmitRoleMetadata_SubProcessActivities
            (Worksheet sheet, string localbroles, int idEASet, int idSubProcess)
        {
            string sql =
                @"
SELECT
ACTIVS.c_u_NodeType,
ACTIVS.c_u_BOOLisKeyPoint,
ACTIVS.c_u_Text,
ACTIVS.c_u_ListIdsBusRoles,
ACTIVS.c_u_ListIdsApps

FROM t_RBSR_AUFW_u_METADATA_SubprToActivityList ACTIVS

WHERE ";

            sql += " ( ACTIVS.c_r_SubProcess = " + idSubProcess + " ) ";

            sql += " ORDER BY ACTIVS.c_u_Sequence;";



            WorksheetRow row;

            row = sheet.Table.Rows.Add();
            row = sheet.Table.Rows.Add();
            row = sheet.Table.Rows.Add();
            row = sheet.Table.Rows.Add();
            row = sheet.Table.Rows.Add();
            row.Cells.Add("BUSINESS PROCESS ACTIVITIES");
            row = sheet.Table.Rows.Add();
            row = sheet.Table.Rows.Add();
            row.Cells.Add("Activities");
            row.Cells.Add("Performed by");
            row.Cells.Add("System Mapping");

            OdbcDataReader DR = HELPERS.RunSqlSelect(sql);

            while (DR.Read())
            {
                string nodetype       = DR.GetValue(0) as string;
                bool   isKeyPoint     = (bool)(DR.GetValue(1));
                string comment        = DR.GetValue(2) as string;
                string listIdBusRoles = HELPERS.HumanReadableRoleList(DR.GetValue(3) as string, "", "; ");
                string listIdApps     = HELPERS.HumanReadableAppList(DR.GetValue(4) as string, "", "; ");

                row = sheet.Table.Rows.Add();
                row.Cells.Add(
                    ((isKeyPoint) ? "***KEY*** " : "") + comment);
                if (nodetype == "ACT")
                {
                    row.Cells.Add(listIdBusRoles);
                    row.Cells.Add(listIdApps);
                }
            }
        }
        public override void OnAuthorization(HttpActionContext actionContext)
        {
            UserCache     userCache   = HELPERS.GetCurrentUserCache();
            List <string> actionsList = Actions.Split(',').Select(a => a.Trim(' ')).ToList();

            if (!userCache.UserActionsDictionary[userCache.CurrentTenantID.ToString()].Intersect(actionsList).Any())
            {
                HandleUnauthorizedRequest(actionContext);
            }
        }
Exemple #18
0
        public string ActiveBusinessEntitlements()
        {
            IMETADATA_SubprToActivityList engineactlist =
                new IMETADATA_SubprToActivityList(HELPERS.NewOdbcConn());

            returnListMETADATA_SubprToActivityListBySubProcess[] actlist =
                engineactlist.ListMETADATA_SubprToActivityListBySubProcess
                    (null, theSubProcess.ID);

            StringBuilder BUFFER = new StringBuilder();

            foreach (returnListMETADATA_SubprToActivityListBySubProcess curact in actlist)
            {
                StringBuilder PREBUFFER  = new StringBuilder();
                bool          hasContent = false;
                PREBUFFER.Append("<tr class='textalignleft'>");
                if (curact.Text.Trim().Length > 0)
                {
                    hasContent = true;
                }
                if (curact.NodeType == "HEAD")
                {
                    PREBUFFER.Append("<td colspan=3 class='ActivityListHeader'>" + curact.Text + "</td>");
                }
                else
                {
                    string flag = "<IMG src='../images/IsHead_false__IsKeyPoint_false.gif' width='12'/> ";
                    if ((bool)(curact.BOOLisKeyPoint))
                    {
                        flag = "<IMG src='../images/IsHead_false__IsKeyPoint_true.gif' width='12'/> ";
                    }
                    PREBUFFER.Append("<td>" + flag + curact.Text + "&nbsp;</td>");
                    PREBUFFER.Append("<td><ol>");
                    PREBUFFER.Append(HELPERS.HumanReadableRoleList(curact.ListIdsBusRoles, "<li>", "</li>"));
                    PREBUFFER.Append("</ol>&nbsp;</td>");
                    PREBUFFER.Append("<td><ol>");
                    PREBUFFER.Append(HELPERS.HumanReadableAppList(curact.ListIdsApps, "<li>", "</li>"));
                    PREBUFFER.Append("</ol>&nbsp;</td>");
                    if (curact.ListIdsBusRoles.Length > 1)
                    {
                        hasContent = true;
                    }
                    if (curact.ListIdsApps.Length > 1)
                    {
                        hasContent = true;
                    }
                }
                PREBUFFER.Append("</tr>");
                if (hasContent)
                {
                    BUFFER.Append(PREBUFFER.ToString());
                }
            }
            return(BUFFER.ToString());
        }
        private void JQDLGdeleteOrgAxis(int id)
        {
            ISAPsecurityOrgAxis engine = new ISAPsecurityOrgAxis(HELPERS.NewOdbcConn_FORCE());

            if (id >= 0)
            {
                returnGetSAPsecurityOrgAxis ret = engine.GetSAPsecurityOrgAxis(id);
                string newdelname = "DeL_" + ret.SAP_Name + "_" + id.ToString();
                engine.SetSAPsecurityOrgAxis(id, ret.English_Name, newdelname, ret.LegalValues);
            }
        }
Exemple #20
0
        private void BEnts_Recompute_Privstring()
        {
            IEntitlement ENGINE = new IEntitlement(HELPERS.NewOdbcConn());

            returnListEntitlement[] RET = ENGINE.ListEntitlement(null, "", new string[] { }, "");
            foreach (returnListEntitlement x in RET)
            {
                returnGetEntitlement cur = ENGINE.GetEntitlement(x.ID);
                string privstring        = HELPERS.CalcManifestString(cur);
                ENGINE.SetEntitlementPrivstring(x.ID, privstring);
            }
        }
Exemple #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Request.Params["mode"] == "owner")
                {
                    Response.Redirect("LISTbusroles_byOwner.aspx?mode=owner&srch=.");
                    return;
                }
                if (Request.Params["mode"] == "search")
                {
                    Response.Redirect("LISTbusroles_byOwner.aspx?mode=search&srch=" +
                                      HttpUtility.UrlEncode(Request.Params["srch"]));
                    return;
                }
            }
            catch (Exception ignoreme) { }

            try
            {
                idPR = int.Parse(Request.Params["idPR"]);
            }
            catch (Exception ee)
            {
                idPR = -1;
            }


            string         thesql = "SELECT c_id, c_u_Name, c_u_Description FROM [t_RBSR_AUFW_u_Process] WHERE c_u_Name NOT LIKE '%internal use%' AND c_u_Name NOT LIKE 'test' ORDER BY [c_u_Name]";
            OdbcDataReader DR     = HELPERS.RunSqlSelect(thesql);

            while (DR.Read())
            {
                ComboBoxItem newitem = new ComboBoxItem();
                newitem.Text = DR.GetString(1);
                try
                {
                    newitem.Text = DR.GetString(2);
                }
                catch (Exception) { }
                newitem.Value = DR.GetInt32(0).ToString();
                this.COMBOXchooseProcess.Items.Add(newitem);
            }

            if (!IsPostBack)
            {
                if (idPR >= 0)
                {
                    this.COMBOXchooseProcess.SelectedValue = idPR.ToString();
                }
            }
        }
        // If arg1 is a string representation of an integer, then that int is an entitlement ID
        // and the fields should come straight from the sql database.
        // Otherwise, arg1 is a JSON dictionary where the field values should be taken from.
        //
        // If arg2 is a non-empty string, it is the formula to be used, instead of the formula
        // being extracted from the database.
        //
        //
        // W A R N I N G ! ! !
        // GENERATES HTML.
        // THIS MUST **NEVER** BE USED FOR DATA PROCESSING, for generating manifests, for reconciliation, for export-to-spreadsheet, etc!!!!
        //
        private void ComputeManifestString(HttpResponse resp, string arg1, string arg2, string arg3, string arg4)
        {
            returnGetEntitlement seed = new returnGetEntitlement();
            bool hasBeenSeeded        = false;

            try
            {
                int          IDentitlement = int.Parse(arg1);
                IEntitlement engine        = new IEntitlement(HELPERS.NewOdbcConn());
                seed          = engine.GetEntitlement(IDentitlement);
                hasBeenSeeded = true;
            }
            catch (Exception eeeeignore) { }


            if (!hasBeenSeeded)
            {
                System.Web.Script.Serialization.JavaScriptSerializer UTIL =
                    new System.Web.Script.Serialization.JavaScriptSerializer();
                Object whatami = UTIL.DeserializeObject(arg1);
                System.Collections.Generic.Dictionary <string, Object> www =
                    whatami as System.Collections.Generic.Dictionary <string, Object>;
                seed                  = new returnGetEntitlement();
                seed.Application      = HELPERS.SafeGenericDictionaryLookup(www, "Application");
                seed.AuthObjName      = HELPERS.SafeGenericDictionaryLookup(www, "AuthObjName");
                seed.AuthObjValue     = HELPERS.SafeGenericDictionaryLookup(www, "AuthObjValue");
                seed.EntitlementName  = HELPERS.SafeGenericDictionaryLookup(www, "EntitlementName");
                seed.EntitlementValue = HELPERS.SafeGenericDictionaryLookup(www, "EntitlementValue");
                seed.FieldSecName     = HELPERS.SafeGenericDictionaryLookup(www, "FieldSecName");
                seed.FieldSecValue    = HELPERS.SafeGenericDictionaryLookup(www, "FieldSecValue");
                seed.Level4SecName    = HELPERS.SafeGenericDictionaryLookup(www, "Level4SecName");
                seed.Level4SecValue   = HELPERS.SafeGenericDictionaryLookup(www, "Level4SecValue");
                seed.Platform         = HELPERS.SafeGenericDictionaryLookup(www, "Platform");
                seed.RoleType         = HELPERS.SafeGenericDictionaryLookup(www, "RoleType");
                seed.StandardActivity = HELPERS.SafeGenericDictionaryLookup(www, "StandardActivity");
                seed.System           = HELPERS.SafeGenericDictionaryLookup(www, "System");
            }

            string THEMANIFEST;

            if (arg2 != null)
            {
                THEMANIFEST = HELPERS.CalcManifestString(seed, arg2);
            }
            else
            {
                THEMANIFEST = HELPERS.CalcManifestString(seed);
            }


            resp.Write(THEMANIFEST.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;"));
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/csv";
            context.Response.AddHeader("Content-Disposition",
                                       "filename=entitlementusage.csv;attachment");

            int idEAss = Int32.Parse(context.Request.Params["entid"]);

            OdbcCommand cmd = new OdbcCommand();

            cmd.Connection = HELPERS.NewOdbcConn();

            cmd.CommandText =
                @"
SELECT EA.c_id, PR.c_u_Name, SUBPR.c_u_Name, EASET.c_u_Status, EASET.c_u_DATETIMElock, BROL.c_u_Name
FROM t_RBSR_AUFW_u_EntAssignment EA
LEFT OUTER JOIN t_RBSR_AUFW_u_EntAssignmentSet EASET
   ON EA.c_r_EntAssignmentSet = EASET.c_id
LEFT OUTER JOIN t_RBSR_AUFW_u_BusRole BROL
   ON EA.c_r_BusRole = BROL.c_id
LEFT OUTER JOIN t_RBSR_AUFW_u_SubProcess SUBPR
   ON EASET.c_r_SubProcess = SUBPR.c_id
LEFT OUTER JOIN t_RBSR_AUFW_u_Process PR
   ON SUBPR.c_r_Process = PR.c_id
WHERE
   EASET.c_u_Status IN ('ACTIVE','WORKSPACE')
AND
   EA.c_u_Status NOT IN ('X') 
AND
   EA.c_r_Entitlement = ? 
ORDER BY
   PR.c_u_Name, SUBPR.c_u_Name, EASET.c_id;";

            cmd.Parameters.Add("ea", OdbcType.Int);
            cmd.Parameters["ea"].Value = (object)idEAss;

            OdbcDataReader dr = cmd.ExecuteReader();

            context.Response.Write("Process,Subprocess,SpaceType,FreezeDate,BusinessRole\n");

            while (dr.Read())
            {
                context.Response.Write(CSVquoteize(dr.GetValue(1) as string) + ",");
                context.Response.Write(CSVquoteize(dr.GetValue(2) as string) + ",");
                context.Response.Write(CSVquoteize(dr.GetValue(3) as string) + ",");
                context.Response.Write(CSVquoteize(dr.GetValue(4).ToString()) + ",");
                context.Response.Write(CSVquoteize(dr.GetValue(5) as string));
                context.Response.Write("\n");
            }
            dr.Close();
        }
        // Can create new as well as edit existing.
        // If id < zero, means create
        private void JQDLGeditOrgAxis(int id, string name, string descr, string legalvals)
        {
            ISAPsecurityOrgAxis engine = new ISAPsecurityOrgAxis(HELPERS.NewOdbcConn_FORCE());

            if (id >= 0)
            {
                engine.SetSAPsecurityOrgAxis(id, descr, name, legalvals);
            }
            else
            {
                id = engine.NewSAPsecurityOrgAxis(descr, name);
                engine.SetSAPsecurityOrgAxis(id, descr, name, legalvals);
            }
        }
Exemple #25
0
        public void ProcessRequest(HttpContext context)
        {
            int id = Int32.Parse(context.Request.Params["id"]);

            context.Response.ContentType = "binary";
            context.Response.AddHeader("Content-Disposition",
                                       "filename=export.bin;attachment");


            IEASfileAttachment engine =
                new IEASfileAttachment(HELPERS.NewOdbcConn_FORCE());


            //context.Response.
        }
        // 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;
            }
        }
Exemple #27
0
        /// <summary>
        ///
        /// insert a row in table t_RBSR_AUFW_u_EASfileAttachment.
        /// </summary>
        /// <param name="Filename"></param>
        /// <param name="Comment"></param>
        /// <param name="UploadDate"></param>
        /// <param name="EntAssignmentSetID"></param>
        /// <returns>The integer ID of the new object.</returns>
        public int NewEASfileAttachment(string Filename, string Comment, DateTime UploadDate, int EntAssignmentSetID)
        {
            int rv = 0;

            DBConnect();
            OdbcCommand cmd = _dbConnection.CreateCommand();

            cmd.CommandText = "INSERT INTO \"t_RBSR_AUFW_u_EASfileAttachment\"(\"c_u_Filename\",\"c_u_Comment\",\"c_u_UploadDate\",\"c_r_EntAssignmentSet\") VALUES(?,?,?,?)";
            if (_dbConnection.Driver.ToLower().StartsWith("sql"))
            {
                cmd.CommandText += " SELECT convert(int,SCOPE_IDENTITY())";
            }
            if (Filename == null)
            {
                throw new Exception("Filename must not be null!");
            }
            cmd.Parameters.Add("c_u_Filename", OdbcType.NVarChar, 256);
            cmd.Parameters["c_u_Filename"].Value = (Filename != null ? (object)Filename : DBNull.Value);
            if (Comment == null)
            {
                throw new Exception("Comment must not be null!");
            }
            cmd.Parameters.Add("c_u_Comment", OdbcType.NVarChar, 1024);
            cmd.Parameters["c_u_Comment"].Value = (Comment != null ? (object)Comment : DBNull.Value);
            cmd.Parameters.Add("c_u_UploadDate", OdbcType.DateTime);
            cmd.Parameters["c_u_UploadDate"].Value = HELPERS.SetSafeDBDate(UploadDate);
            cmd.Parameters.Add("c_r_EntAssignmentSet", OdbcType.Int);
            cmd.Parameters["c_r_EntAssignmentSet"].Value = (object)EntAssignmentSetID;
            OdbcDataReader dri = cmd.ExecuteReader();

            if (_dbConnection.Driver.ToLower().StartsWith("myodbc"))
            {
                cmd             = _dbConnection.CreateCommand();
                cmd.CommandText = "SELECT LAST_INSERT_ID()";
                dri             = cmd.ExecuteReader();
            }
            dri.Read();
            rv = (dri.IsDBNull(0) ? 0 : (typeof(long).Equals(dri.GetFieldType(0)) ? (int)dri.GetInt64(0) : dri.GetInt32(0)));
            dri.Close();
            if (rv == 0)
            {
                throw new Exception("Insert operation failed!");
            }
            dri.Dispose();
            cmd.Dispose();
            DBClose();
            return(rv);
        }
        private void EmitFieldList(int IDsapobjfield, HttpResponse OUT)
        {
            System.Data.Odbc.OdbcConnection conn = HELPERS.NewOdbcConn_FORCE();
            OdbcDataReader dr = InquireFieldListForAuthObj(IDsapobjfield, conn);

            while (dr.Read())
            {
                OUT.Write(dr.GetString(0) +
                          (
                              (dr.GetString(1).Length > 0) ?
                              " <span class='graydescr'>(" + dr.GetString(1) + ")</span>" : ""
                          )
                          +
                          "<br/>\n");
            }
        }
        public void markdone(int idSnapshot, HttpContext context)
        {
            Queue <int> rowIDsToBeMarkedAsDone =
                context.Session["ReconcfromSnapshot_RowIDs"] as Queue <int>;

            Dictionary <int, string> mapper =
                context.Session["ReconcfromSnapshot_MapIdToStatus"] as
                Dictionary <int, string>;

            IReconcDiffItem engine = new IReconcDiffItem(HELPERS.NewOdbcConn());

            foreach (int i in rowIDsToBeMarkedAsDone)
            {
                engine.SetReconcDiffItem(i, mapper[i]);
            }
        }
        private void RegisterNewTcode
            (System.Collections.Specialized.NameValueCollection P,
            HttpResponse httpResponse, string newname, string newdescr)
        {
            ITcodeDictionary engine = new ITcodeDictionary(HELPERS.NewOdbcConn());

            try
            {
                int IDbaby = engine.NewTcodeDictionary(newname);
                engine.SetTcodeDescription(IDbaby, newdescr);
            }
            catch (Exception eee)
            {
                throw new Exception("That TCode name is already registered.");
            }
        }