Beispiel #1
0
        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*/);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        private void SAP_AddObjsTo1251(System.Collections.Specialized.NameValueCollection P, HttpResponse httpResponse)
        {
            System.Data.Odbc.OdbcConnection conn = HELPERS.NewOdbcConn_FORCE();

            int IDauthobj = int.Parse(P["IDauthobj"]);
            int IDsaprole = int.Parse(P["IDsaprole"]);

            System.Data.Odbc.OdbcConnection conn2 = HELPERS.NewOdbcConn_FORCE();
            IAuthRow1251 engine1251 = new IAuthRow1251(conn2);

            OdbcDataReader dr = InquireFieldListForAuthObj(IDauthobj, conn);

            while (dr.Read())
            {
                int idSAPauthField = dr.GetInt32(2);

                // Does this obj+field combination already exist?
                returnListAuthRow1251ByTcodeAssignmentSet[] listAuthRows =
                    engine1251.ListAuthRow1251ByTcodeAssignmentSet
                        (null, " \"SAPauthObj\" = ?  AND \"SAPauthField\" = ?", new string[] { IDauthobj.ToString(), idSAPauthField.ToString() }, "",
                        /*TcodeAssignmentSet is the WorkspaceID: */ session.idWorkspace_SAP);

                if (listAuthRows.GetLength(0) < 1)
                {
                    // OK, we're ready to add a row
                    engine1251.NewAuthRow1251
                        (IDauthobj, idSAPauthField, session.idWorkspace_SAP, IDsaprole, 2);
                }
                else
                {
                    // A row for this combo already exists, but we will make sure it is not
                    // with its deletion bit set to delete.
                    engine1251.SetAuthRow1251
                        (listAuthRows[0].ID, listAuthRows[0].RangeLow, listAuthRows[0].RangeHigh,
                        listAuthRows[0].SAPauthObjID, listAuthRows[0].SAPauthFieldID, listAuthRows[0].TcodeAssignmentSetID,
                        listAuthRows[0].SAProleID,
                        listAuthRows[0].EditStatus & (8 + 2 + 1) /* to turn OFF the deletion bit if it happens to be on */);
                }
            }
        }