Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (TargetCase != null)
            {
                HavePermission = CRMSecurity.IsAdmin || TargetCase.CreateBy == SecurityContext.CurrentAccount.ID;
            }
            else
            {
                HavePermission = true;
            }

            if (TargetCase != null)
            {
                saveCaseButton.Text = CRMCasesResource.SaveChanges;
                cancelButton.Attributes.Add("href", String.Format("cases.aspx?id={0}", TargetCase.ID));
                RegisterClientScriptHelper.DataListContactTab(Page, TargetCase.ID, EntityType.Case);
            }
            else
            {
                saveCaseButton.Text          = CRMCasesResource.CreateThisCaseButton;
                saveAndCreateCaseButton.Text = CRMCasesResource.AddThisAndCreateCaseButton;
                cancelButton.Attributes.Add("href",
                                            Request.UrlReferrer != null && String.CompareOrdinal(Request.UrlReferrer.PathAndQuery, Request.Url.PathAndQuery) != 0
                                                ? Request.UrlReferrer.OriginalString
                                                : "cases.aspx");
            }

            RegisterClientScriptHelper.DataCasesActionView(Page, TargetCase);

            if (HavePermission)
            {
                InitPrivatePanel();
            }
            RegisterScript();
        }