예제 #1
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        c = new OperationCommonOfBackend(this.Context, this.ViewState);
        c.InitialLoggerOfUI(this.GetType());

        empAuth = new EmployeeAuthorityLogic(c);
        empAuth.InitialAuthorizationResultOfSubPages();
    }
예제 #2
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        c = new LoginCommonOfBackend(this.Context, this.ViewState);
        c.InitialLoggerOfUI(this.GetType());
        empAuth = new EmployeeAuthorityLogic();

        ACCOUNT_FAILED_ERRMSG = Resources.Lang.ErrMsg_NoMatchedAccount;
    }
예제 #3
0
    protected void Page_Init(object sender, EventArgs e)
    {
        c = new BackendPageCommon(this.Context, this.ViewState);
        c.InitialLoggerOfUI(this.GetType());
        artPub  = new ArticlePublisherLogic(c);
        empAuth = new EmployeeAuthorityLogic(c);

        Page.Title = Resources.Lang.BackStageName;
        Page.MaintainScrollPositionOnPostBack = true;
    }
예제 #4
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        c = new ArticleVideoCommonOfBackend(this.Context, this.ViewState);
        c.InitialLoggerOfUI(this.GetType());

        artPub = new ArticlePublisherLogic(c);

        empAuth = new EmployeeAuthorityLogic(c);
        empAuth.SetCustomEmployeeAuthorizationResult(artPub);
        empAuth.InitialAuthorizationResultOfSubPages();
    }
예제 #5
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        c = new DepartmentCommonOfBackend(this.Context, this.ViewState);
        c.InitialLoggerOfUI(this.GetType());
        c.SelectMenuItemToThisPage();

        empAuth = new EmployeeAuthorityLogic(c);
        empAuth.InitialAuthorizationResultOfTopPage();

        hud           = Master.GetHeadUpDisplay();
        isBackendPage = true;
    }
예제 #6
0
    protected void Page_Init(object sender, EventArgs e)
    {
        c = new BackendPageCommon(this.Context, this.ViewState);
        c.InitialLoggerOfUI(this.GetType());
        empAuth = new EmployeeAuthorityLogic(c);

        if (c.seCultureNameOfBackend == "en")
        {
            useEnglishSubject = true;
        }

        if (!IsPostBack)
        {
            LoadUIData();
        }
    }
예제 #7
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        c = new OperationCommonOfBackend(this.Context, this.ViewState);
        c.InitialLoggerOfUI(this.GetType());
        c.SelectMenuItem(c.qsId.ToString(), "");

        empAuth = new EmployeeAuthorityLogic(c);
        empAuth.InitialAuthorizationResultOfTopPage();

        hud           = Master.GetHeadUpDisplay();
        isBackendPage = true;

        if (c.seCultureNameOfBackend == "en")
        {
            useEnglishSubject = true;
        }
    }
예제 #8
0
        public override ClientResult ProcessRequest()
        {
            ClientResult cr = null;

            roleName = GetParamValue("roleName");
            string strOpId      = GetParamValue("opId");
            int    opId         = 0;
            string strItemVal   = GetParamValue("itemVal");
            int    itemVal      = 0;
            string strSelfVal   = GetParamValue("selfVal");
            int    selfVal      = 0;
            string strCrewVal   = GetParamValue("crewVal");
            int    crewVal      = 0;
            string strOthersVal = GetParamValue("othersVal");
            int    othersVal    = 0;
            string strAddVal    = GetParamValue("addVal");
            bool   addVal       = false;
            string strRoleId    = GetParamValue("roleId");

            roleId = 0;

            if (!int.TryParse(strOpId, out opId))
            {
                throw new Exception("opId is invalid");
            }
            if (!int.TryParse(strItemVal, out itemVal))
            {
                throw new Exception("itemVal is invalid");
            }
            if (!int.TryParse(strSelfVal, out selfVal))
            {
                throw new Exception("selfVal is invalid");
            }
            if (!int.TryParse(strCrewVal, out crewVal))
            {
                throw new Exception("crewVal is invalid");
            }
            if (!int.TryParse(strOthersVal, out othersVal))
            {
                throw new Exception("othersVal is invalid");
            }
            if (!bool.TryParse(strAddVal, out addVal))
            {
                throw new Exception("addVal is invalid");
            }
            if (!int.TryParse(strRoleId, out roleId))
            {
                throw new Exception("roleId is invalid");
            }

            // authenticate
            empAuth = new EmployeeAuthorityLogic(c);
            empAuth.SetCustomEmployeeAuthorizationResult(this);
            empAuth.InitialAuthorizationResultOfSubPages();

            if (!empAuth.CanEditThisPage())
            {
                cr = new ClientResult()
                {
                    b   = false,
                    err = "invalid authentication"
                };

                return(cr);
            }

            // check limitation
            if (itemVal == 0 && selfVal > 0)
            {
                selfVal = 0;
            }

            if (selfVal < 2 && addVal == true)
            {
                addVal = false;
            }

            if (crewVal > selfVal)
            {
                crewVal = selfVal;
            }

            if (othersVal > crewVal)
            {
                othersVal = crewVal;
            }

            RoleOpPvg newPvg = GetRoleOpPvg(roleName, opId, itemVal,
                                            selfVal, crewVal, othersVal,
                                            addVal);

            // save into list in the session
            RoleOpPvg oldPvg = c.seRoleOpPvgs.Find(pvg => string.Compare(pvg.RoleName, roleName, true) == 0 && pvg.OpId == opId);

            if (oldPvg != null)
            {
                oldPvg.PvgOfItem          = newPvg.PvgOfItem;
                oldPvg.PvgOfSubitemSelf   = newPvg.PvgOfSubitemSelf;
                oldPvg.PvgOfSubitemCrew   = newPvg.PvgOfSubitemCrew;
                oldPvg.PvgOfSubitemOthers = newPvg.PvgOfSubitemOthers;
            }
            else
            {
                c.seRoleOpPvgs.Add(newPvg);
            }

            cr = new ClientResult()
            {
                b = true,
                o = newPvg
            };

            return(cr);
        }