Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
        }

        if (c.seLoginEmpData.EmpAccount != null &&
            Request.AppRelativeCurrentExecutionFilePath != "~/Back-End-Log.aspx")
        {
            //新增後端操作記錄
            string description = string.Format(".{0} .頁碼/Page[{1}] .路徑/Route[{2}] .IsPostBack[{3}]",
                                               ltrHead.Text, c.qsPageCode, Common.Utility.StringUtility.RemoveHtmlTag(ltrBreadcrumb.Text.Replace("</", "/</")), IsPostBack);

            empAuth.InsertBackEndLogData(new BackEndLogData()
            {
                EmpAccount  = c.GetEmpAccount(),
                Description = description,
                IP          = c.GetClientIP()
            });
        }
    }
Esempio n. 2
0
        public override ClientResult ProcessRequest()
        {
            ClientResult cr = null;

            string mdfAccount = c.GetEmpAccount();

            if (string.IsNullOrEmpty(mdfAccount))
            {
                cr = new ClientResult()
                {
                    b   = false,
                    err = "invalid login status"
                };

                return(cr);
            }

            string token = GetParamValue("token");
            ArticleAjaxAuthData authData = null;

            if (!HandleAuthToken(token, c.GetEmpAccount(), out authData))
            {
                cr = new ClientResult()
                {
                    b   = false,
                    err = "invalid token"
                };

                return(cr);
            }

            string artId = GetParamValue("artId");
            Guid   articleId;

            if (!Guid.TryParse(artId, out articleId))
            {
                cr = new ClientResult()
                {
                    b   = false,
                    err = "invalid artId"
                };

                return(cr);
            }

            string areaName = GetParamValue("areaName");
            bool   isShow   = Convert.ToBoolean(GetParamValue("isShow"));
            ArticlePublisherLogic artPub = new ArticlePublisherLogic();

            ArticleUpdateIsAreaShowInFrontStageParams param = new ArticleUpdateIsAreaShowInFrontStageParams()
            {
                ArticleId          = articleId,
                AreaName           = areaName,
                IsShowInFrontStage = isShow,
                MdfAccount         = mdfAccount,
                AuthUpdateParams   = new AuthenticationUpdateParams()
                {
                    CanEditSubItemOfOthers = authData.CanEditSubItemOfOthers,
                    CanEditSubItemOfCrew   = authData.CanEditSubItemOfCrew,
                    CanEditSubItemOfSelf   = authData.CanEditSubItemOfSelf,
                    MyAccount = c.GetEmpAccount(),
                    MyDeptId  = c.GetDeptId()
                }
            };

            bool result = artPub.UpdateArticleIsAreaShowInFrontStage(param);

            if (result)
            {
                cr = new ClientResult()
                {
                    b = true
                };
            }
            else
            {
                cr = new ClientResult()
                {
                    b = false, err = "update failed"
                };
            }

            return(cr);
        }