コード例 #1
0
        protected override void Initialize()
        {
            base.Initialize();
            try
            {
                gAssessmentID = Convert.ToInt32(this.DecryptQueryString(Request.QueryString["value"], "AssessmentID"));
            }
            catch (Exception)
            {
                gAssessmentID = -1;
                Set_Message_On_Another_Page("You can not access that page directly", "AssessmentList.aspx", true);
                return;
            }

            gAssessment = new BusinessRules.OP_Assessment(BSWSession.SessionID, BSWSession.UserID);
            gLookUp     = new BusinessRules.OP_LookUp(BSWSession.SessionID, BSWSession.UserID);
            if (string.IsNullOrEmpty(this.SortBy))
            {
                this.SortBy = nameof(ClsListAssessmentItem.Order);
            }

            grd.AddDataColumn("", nameof(ClsListAssessmentItem.ItemID), PrepareMenu);
            grd.AddHiddenDataColumn("ItemID", nameof(ClsListAssessmentItem.ItemID));
            grd.AddHyperLinkColumn("Order", nameof(ClsListAssessmentItem.Order));
            grd.AddHyperLinkColumn("Type", nameof(ClsListAssessmentItem.TypeID), FormatTypeColumn);
            grd.AddDataColumn("Version", nameof(ClsListAssessmentItem.Version));
            grd.AddHyperLinkColumn("Text", nameof(ClsListAssessmentItem.Text));
            if (!IsUserAllowed(OP_Operation.OP_ASSESSMENT_ITEM_CREATE))
            {
                btnAddNewAssessmentItem.Visible = false;
            }
        }
コード例 #2
0
        protected override void Initialize()
        {
            base.Initialize();
            try
            {
                gAssessmentID = Convert.ToInt32(this.DecryptQueryString(Request.QueryString["value"], "AssessmentID"));
            }
            catch (Exception)
            {
                gAssessmentID = -1;
                return;
            }

            try
            {
                gAssessmentRespID = Convert.ToInt32(this.DecryptQueryString(Request.QueryString["value"], "AssessmentRespID"));
            }
            catch (Exception)
            {
                gAssessmentRespID = -1;
            }


            gAssessment_br = new BusinessRules.OP_Assessment(BSWSession.SessionID, BSWSession.UserID);
            gLookUp        = new BusinessRules.OP_LookUp(BSWSession.SessionID, BSWSession.UserID);


            listResponses = new List <AssessmentItemResponse>();
            if (gAssessmentRespID > 0)
            {
                //load old responses
                AssessmentResponse objResp = gAssessment_br.GetAssessmentResponse(BSWSession.UserID, gAssessmentRespID, null);

                listResponses       = OP_Assessment.GetItemResponsesByAssessmentRespID(gAssessmentRespID);
                gIsAssessmentClosed = !objResp.IsCurent;

                if (gIsAssessmentClosed)
                {
                    btnDeleteAssessmentResponse.Visible = true;
                }
            }
            else
            {
                gIsAssessmentClosed = false;
            }
        }
コード例 #3
0
        protected override void Initialize()
        {
            base.Initialize();
            gAssessment_br = new BusinessRules.OP_Assessment(BSWSession.SessionID, BSWSession.UserID);
            gLookup_br     = new BusinessRules.OP_LookUp(BSWSession.SessionID, BSWSession.UserID);
            try
            {
                gAssessmentID = Convert.ToInt32(this.DecryptQueryString(Request.QueryString["value"], "ID"));
            }
            catch (Exception)
            {
                gAssessmentID = -1;
            }

            try
            {
                gPageMode = (Constants.enPageMode)Convert.ToInt32(this.DecryptQueryString(Request.QueryString["value"], "PageMode"));
            }
            catch (Exception)
            {
                if (gAssessmentID > 0)
                {
                    gPageMode = Constants.enPageMode.VIEW_DATA;
                }
                else
                {
                    gPageMode = Constants.enPageMode.NEW_DATA;
                }
            }
            if (gPageMode == Constants.enPageMode.NEW_DATA && !IsUserAllowed(OP_Operation.OP_ASSESSMENT_CREATE))
            {
                ThrowNotAuthorized();
            }

            if (gPageMode == Constants.enPageMode.UPDATE_DATA && !IsUserAllowed(OP_Operation.OP_ASSESSMENT_UPDATE))
            {
                DisableAllPage("divControls");
                btnSaveAssessment.Visible = false;
            }
        }
コード例 #4
0
        protected override void Initialize()
        {
            base.Initialize();
            gAssessment = new BusinessRules.OP_Assessment(BSWSession.SessionID, BSWSession.UserID);
            gLookUp     = new BusinessRules.OP_LookUp(BSWSession.SessionID, BSWSession.UserID);

            Set_QS_Values();
            if (gAssessmentID < 1)
            {
                Set_Message_On_Another_Page("You can not access that page directly", "AssessmentList.aspx", true);
                return;
            }

            if (AssessmentItemID > 0)
            {
                gPageMode         = Constants.enPageMode.UPDATE_DATA;
                pnlChoice.Visible = true;
            }
            else
            {
                gPageMode         = Constants.enPageMode.NEW_DATA;
                pnlChoice.Visible = false;
                if (!IsUserAllowed(OP_Operation.OP_ASSESSMENT_ITEM_CREATE))
                {
                    ThrowNotAuthorized();
                }
            }

            if (gPageMode == Constants.enPageMode.UPDATE_DATA && !IsUserAllowed(OP_Operation.OP_ASSESSMENT_ITEM_UPDATE))
            {
                btnSaveAll.Visible            = false;
                btnSaveAssessmentItem.Visible = false;
                btnSaveChoice.Visible         = false;

                DisableAllPage(pnlAI.ClientID);
            }

            btnBack.HRef = "AssessmentItemList.aspx" + EncryptQueryString("AssessmentID=" + gAssessmentID);
        }
コード例 #5
0
        protected override void Initialize()
        {
            base.Initialize();
            gAssessment = new BusinessRules.OP_Assessment(BSWSession.SessionID, BSWSession.UserID);
            gLookUp     = new BusinessRules.OP_LookUp(BSWSession.SessionID, BSWSession.UserID);

            arrangeDisplayOptionText();
            gIsAdministrator = !isUser();

            if (string.IsNullOrEmpty(this.SortBy))
            {
                this.SortBy = nameof(DataAccess.Assessment.AssessmentID);
            }

            if (gIsPopup)
            {
                grd.AddHyperLinkColumn("", "", FormatSelectRow);
            }
            else
            {
                grd.AddDataColumn("", nameof(DataAccess.Assessment.AssessmentID), PrepareMenu);
            }

            grd.AddHiddenDataColumn("AssessmentID", nameof(DataAccess.Assessment.AssessmentID));
            grd.AddHyperLinkColumn("Name", nameof(DataAccess.Assessment.Name));
            grd.AddHyperLinkColumn("Type", nameof(DataAccess.Assessment.TypeID), FormatTypeColumn);
            grd.AddDataColumn("Version", nameof(DataAccess.Assessment.Version));
            grd.AddHyperLinkColumn("Author", nameof(DataAccess.Assessment.Author));

            if (IsUserAllowed(OP_Operation.OP_ASSESSMENT_CREATE))
            {
                btnAddNewAssessmentItem.Visible = true;
            }
            else
            {
                btnAddNewAssessmentItem.Visible = false;
            }
        }