示例#1
0
        protected new void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            PANELcond_AbortUpload.Visible = false;
            PANELcond_AllowUpload.Visible = false;

            System.Data.Odbc.OdbcConnection conn = HELPERS.NewOdbcConn();
            // Is there a currently active ed workspace for this subprocess?\
            IEditingWorkspace engineWS = new IEditingWorkspace(conn);

            returnListEditingWorkspaceBySubProcess[] listWS =
                engineWS.ListEditingWorkspaceBySubProcess(null, session.idSubprocess);
            if (listWS.Length > 1)
            {
                throw new Exception("Internal error: more than one workspace for subprocess "
                                    + session.idSubprocess);
            }
            if (listWS.Length == 1)
            {
                // A workspace already exists for this subprocess.
                // If the WS owner matches this user, invite them to visit the WS.
                PANELcond_AbortUpload.Visible = true;
            }
            else
            {
                PANELcond_AllowUpload.Visible = true;
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            PANELcond_InviteCreateWS.Visible     = false;
            PANELcond_Locked.Visible             = false;
            PANELcond_NewSubpr.Visible           = false;
            PANELcond_IsOwnerOfCurrentWS.Visible = false;

            System.Data.Odbc.OdbcConnection conn = HELPERS.NewOdbcConn();
            // Is there a currently active ed workspace for this subprocess?\
            IEditingWorkspace engineWS = new IEditingWorkspace(conn);

            returnListEditingWorkspaceBySubProcess[] listWS =
                engineWS.ListEditingWorkspaceBySubProcess(null, session.idSubprocess);
            if (listWS.Length > 1)
            {
                throw new Exception("Internal error: more than one workspace for subprocess "
                                    + session.idSubprocess);
            }
            if (listWS.Length == 1)
            {
                // A workspace already exists for this subprocess.
                // If the WS owner matches this user, invite them to visit the WS.
                if (session.idUser == listWS[0].UserID)
                {
                    this.idActiveWS = listWS[0].ID;
                    PANELcond_IsOwnerOfCurrentWS.Visible = true;
                }
            }
            if (listWS.Length == 0)
            {
                IEntAssignmentSet engineEAS = new IEntAssignmentSet(conn);
                returnListEntAssignmentSetBySubProcess[] listEAS =
                    engineEAS.ListEntAssignmentSetBySubProcess
                        (null, "", new string[] {}, "c_u_DATETIMElock DESC", session.idSubprocess);
                if (listEAS.Length == 0)
                {
                    PANELcond_NewSubpr.Visible = true;
                }
                else
                {
                    PANELcond_InviteCreateWS.Visible = true;
                }
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /*  EXample of how to avoid multiple init:
             *       if (!Page.IsPostBack && (!Grid1.CausedCallback)) {
             *       Grid1.DataBind();
             *       }
             */
            base.Page_Load(sender, e);

            this.Page.Title = "Business Entitlements - " + session.nameProcess + "/" + session.nameSubprocess;

            if (Request.QueryString.Get("ID") != null)
            {
                IDworkspace = int.Parse(Request.QueryString.Get("ID"));
            }
            else
            {
                IDworkspace = 10;
            }

            IEditingWorkspace         engine = new IEditingWorkspace(HELPERS.NewOdbcConn());
            returnGetEditingWorkspace ret    = engine.GetEditingWorkspace(IDworkspace);

            if (ret.ID != IDworkspace)
            {
                // There is no workspace with this ID!
                Context.Response.Redirect("ListEWorkspaces.aspx");
                return;
            }

            this.HIDDENidWS.Value = IDworkspace.ToString();

            if (GridCfg_Height.Text == "")
            {
                GridCfg_RowCnt.Text = "15";
                GridCfg_Height.Text = "400";
                //Grid1.GroupBy = "c_u_System";
            }

            SetGridViewMode_Scrolling();

            Site1 THEMASTER  = this.Master as Site1;
            Page  whatisthis = THEMASTER.Page;
        }
示例#4
0
        /* Warning: this is still singleton-based */

        /* This just takes whatever is the active EAS for the given subprocess,
         * but probably should receive the EAS ID as input.
         */
        public static void WorkspaceCreate(OdbcConnection conn, int IDsubprocess, string commentary)
        {
            IEditingWorkspace Iws = new IEditingWorkspace(conn);

            // BUG: hardwired user ID!
            int IDnewWS = Iws.NewEditingWorkspace(commentary, DateTime.Now, IDsubprocess, 1);


            // Still singleton!!
            EmptyTable(conn, "t_r_BusRoleWorkspaceEntitlement");
            EmptyTable(conn, "WorkspaceEntitlement");


            IWorkspaceEntitlement Iwserows = new IWorkspaceEntitlement(conn);
            IEntAssignmentSet     Ieas     = new IEntAssignmentSet(conn);
            IEntitlement          Ient     = new IEntitlement(conn);

            /* See above comment: this hardwared active=true logic is not good */
            returnListEntAssignmentSetBySubProcess[] _IDeas =
                Ieas.ListEntAssignmentSetBySubProcess(null, "\"BOOLisActive\" = 1", new string[] { }, "", IDsubprocess);
            int IDeas = _IDeas[0].ID;


            /* Find the list of EAssignments to bring over to the Workspace */
            IEntAssignment Iea = new IEntAssignment(conn);

            returnListEntAssignmentByEntAssignmentSet[] _IDea =
                Iea.ListEntAssignmentByEntAssignmentSet(null, "", new string[] {}, "", IDeas);
            int numToConvert = _IDea.Length;

            Hashtable dictEntVectorClones = new Hashtable();

            foreach (returnListEntAssignmentByEntAssignmentSet i in _IDea)
            {
                int IDentitlementVector = i.EntitlementID;
                int IDbusrole           = i.BusRoleID;
                int IDcloneEntVector    = -88;

                if (dictEntVectorClones.ContainsKey(IDentitlementVector))
                {
                    // The entitlement vector was already cloned in the workspace.
                    IDcloneEntVector =
                        (int)dictEntVectorClones[IDentitlementVector];
                }
                else
                {
                    // MUST CLONE THE VECTOR
                    returnGetEntitlement theE = Ient.GetEntitlement(IDentitlementVector);

                    IDcloneEntVector =
                        Iwserows.NewWorkspaceEntitlement
                            (theE.StandardActivity,
                            theE.RoleType,
                            theE.System,
                            theE.Platform,
                            theE.EntitlementName,
                            theE.EntitlementValue,
                            IDnewWS);

                    dictEntVectorClones.Add(IDentitlementVector, IDcloneEntVector);
                }

                // We have the bus.role ID and we now have the ID of the
                // WorkspaceEntitlement object.
                // We now create the tie that binds them.
                RecordLinkFromBusRoleToWSEntitVector
                    (conn, IDbusrole, IDcloneEntVector, IDnewWS);
            }
        }