Exemplo n.º 1
0
        // Send either the numeric UUID or the employee's EID string
        private string UserIdentificationString(int userID, OdbcConnection conn)
        {
            IUser         engine = new IUser(conn);
            returnGetUser user   = engine.GetUser(userID);

            return(user.EID + " " + user.NameSurname + ", " + user.NameFirst);
        }
Exemplo n.º 2
0
        private bool AuthCheck()
        {
            if (AlreadyLoggedIn())
            {
                return(true);
            }


            int    IDuser      = int.Parse(this.CHOOSEusername.SelectedValue);
            string STRpassword = this.TXTpassword.Text.Trim();

            IUser         userfactory = new IUser(HELPERS.NewOdbcConn());
            returnGetUser userinfo    = userfactory.GetUser(IDuser);

            if
            (userinfo.EID.ToLower() ==
             STRpassword.ToLower())
            {
                //
                // LOGIN GOOD !
                //
                sessnew          = new AFWACsession(this.Request);
                sessnew.username = userinfo.Name;
                sessnew.idUser   = IDuser;

                // this extra session var UUIDSUBPROCESS is needed so data sources can use
                // it as parameters for scoping results.
                Session["AFWACSESSION"] = sessnew;
                Session["AFWACUSERID"]  = IDuser;

                Response.Redirect("SessionLOGIN.aspx");

                return(true);
            }
            else
            {
                this.PanelLoginFailMsg.Visible = true;
                return(false);
            }
        }
Exemplo n.º 3
0
        /*
         * Assumes the subprocess info is already in place
         */
        public void ObtainWorkspaceContext()
        {
            System.Data.Odbc.OdbcConnection conn = HELPERS.NewOdbcConn();
            IEntAssignmentSet engineWS           = new IEntAssignmentSet(conn);


            returnListEntAssignmentSetBySubProcess[] listWS;

            if (this.nameSubprocess == null)
            {
                ISubProcess         Ispr = new ISubProcess(conn);
                returnGetSubProcess ret  = Ispr.GetSubProcess(idSubprocess);
                this.nameSubprocess = ret.Name;
                IProcess         Ipr  = new IProcess(conn);
                returnGetProcess ret2 = Ipr.GetProcess(ret.ProcessID);
                this.nameProcess = ret2.Name;
            }

            // Is there an active "live" easet for this subpr?
            listWS =
                engineWS.ListEntAssignmentSetBySubProcess
                    (null, "\"Status\" = ?", new string[] { "ACTIVE" }, "", idSubprocess);

            if (listWS.Length > 1)
            {
                throw new Exception("Internal error: more than one ACTIVE Ent Assignment Set for subprocess "
                                    + idSubprocess);
            }

            if (listWS.Length == 1)
            {
                idActiveEAset = listWS[0].ID;
            }



            // Is there a currently active ed workspace for this subprocess?

            listWS =
                engineWS.ListEntAssignmentSetBySubProcess
                    (null, "\"Status\" = ?", new string[] { "WORKSPACE" }, "", idSubprocess);

            if (listWS.Length > 1)
            {
                throw new Exception("Internal error: more than one workspace for subprocess "
                                    + idSubprocess);
            }

            if (listWS.Length == 1)
            {
                idWorkspace          = listWS[0].ID;
                commentWorkspace     = listWS[0].Commentary;
                idUserWorkspaceOwner = listWS[0].UserID;
                isWorkspaceOwner     = (idUser == listWS[0].UserID);
                if (isWorkspaceOwner)
                {
                    nameUserWorkspaceOwner = username;
                }
                else
                {
                    IUser         engineUser = new IUser(conn);
                    returnGetUser wsowner    = engineUser.GetUser(idUserWorkspaceOwner);
                    nameUserWorkspaceOwner =
                        wsowner.Name;
                }
            }
            else
            {
                idWorkspace            = -1;
                idUserWorkspaceOwner   = -1;
                isWorkspaceOwner       = false;
                nameUserWorkspaceOwner = "";
                commentWorkspace       = "";
            }
        }
Exemplo n.º 4
0
        /*
         * Assumes the subprocess info is already in place
         */
        public void ObtainWorkspaceContext_SAP()
        {
            System.Data.Odbc.OdbcConnection conn     = HELPERS.NewOdbcConn();
            ITcodeAssignmentSet             engineWS = new ITcodeAssignmentSet(conn);


            // Is there a currently active ed workspace for this subprocess?
            returnListTcodeAssignmentSetBySubProcess[] listWS =
                engineWS.ListTcodeAssignmentSetBySubProcess
                    (null, "\"Status\" = ?", new string[] { "WORKSPACE" }, "", idSubprocess);

            if (listWS.Length > 1)
            {
                throw new Exception("Internal error: more than one workspace for subprocess "
                                    + idSubprocess);
            }

            if (listWS.Length == 1)
            {
                idWorkspace_SAP          = listWS[0].ID;
                idUserWorkspaceOwner_SAP = listWS[0].UserID;
                isWorkspaceOwner_SAP     = (idUser == listWS[0].UserID);
                if (isWorkspaceOwner_SAP)
                {
                    nameUserWorkspaceOwner_SAP = username;
                }
                else
                {
                    IUser         engineUser = new IUser(conn);
                    returnGetUser wsowner    = engineUser.GetUser(idUserWorkspaceOwner_SAP);
                    nameUserWorkspaceOwner_SAP = wsowner.Name;
                }
            }
            else
            {
                idWorkspace_SAP            = -1;
                idUserWorkspaceOwner_SAP   = -1;
                isWorkspaceOwner_SAP       = false;
                nameUserWorkspaceOwner_SAP = "";
            }



            // Is there a currently active TASS (live) for this subprocess?
            returnListTcodeAssignmentSetBySubProcess[] listSAPWS =
                engineWS.ListTcodeAssignmentSetBySubProcess
                    (null, "\"Status\" = ?", new string[] { "ACTIVE" }, "", idSubprocess);

            if (listSAPWS.Length > 1)
            {
                throw new Exception("Internal error: more than one ACTIVE TcodeAssignmentSet for subprocess "
                                    + idSubprocess);
            }

            if (listSAPWS.Length == 1)
            {
                idActiveTASS_SAP = listSAPWS[0].ID;
            }
            else
            {
                idActiveTASS_SAP = -1;
            }
        }