Exemplo n.º 1
0
        protected void cmdUploadError_ServerClick(object sender, System.EventArgs e)
        {
            SystemSettingFacade facade = new SystemSettingFacade(base.DataProvider);

            SystemError systemError = facade.CreateNewSystemError();

            systemError.SystemErrorCode   = Guid.NewGuid().ToString();
            systemError.ErrorMessage      = FormatHelper.CleanString(this.GetRequestParam("msg"), 100);
            systemError.InnerErrorMessage = FormatHelper.CleanString(this.GetRequestParam("innermsg"), 100);
            systemError.TriggerModuleCode = SessionHelper.Current(this.Session).ModuleCode;
            systemError.SendUser          = this.GetUserCode();
            if (systemError.SendUser == null || systemError.SendUser == string.Empty)
            {
                systemError.SendUser = "******";
            }
            systemError.SendDate     = FormatHelper.TODateInt(DateTime.Now);
            systemError.SendTime     = FormatHelper.TOTimeInt(DateTime.Now);
            systemError.IsResolved   = FormatHelper.BooleanToString(false);
            systemError.MaintainUser = this.GetUserCode();
            if (systemError.MaintainUser == null || systemError.MaintainUser == string.Empty)
            {
                systemError.MaintainUser = "******";
            }

            facade.AddSystemError(systemError);

            string scriptString = "<script language=JavaScript>window.name+='[back]';window.parent.history.back(-1);</script>";

            if (!this.IsClientScriptBlockRegistered("clientScript"))
            {
                this.RegisterClientScriptBlock("clientScript", scriptString);
            }
        }
Exemplo n.º 2
0
        public static void UploadError(string msg, string innserMsg)
        {
            SQLDomainDataProvider provider = BenQGuru.eMES.Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider() as SQLDomainDataProvider;
            SystemSettingFacade   facade   = new SystemSettingFacade(provider);

            SystemError systemError = facade.CreateNewSystemError();

            systemError.SystemErrorCode   = Guid.NewGuid().ToString();
            systemError.ErrorMessage      = FormatHelper.CleanString(msg, 100);
            systemError.InnerErrorMessage = FormatHelper.CleanString(innserMsg, 100);
            systemError.TriggerModuleCode = SessionHelper.Current(HttpContext.Current.Session).ModuleCode;
            systemError.SendUser          = SessionHelper.Current(HttpContext.Current.Session).UserCode;
            if (systemError.SendUser == null || systemError.SendUser == string.Empty)
            {
                systemError.SendUser = "******";
            }
            systemError.SendDate     = FormatHelper.TODateInt(DateTime.Now);
            systemError.SendTime     = FormatHelper.TOTimeInt(DateTime.Now);
            systemError.IsResolved   = FormatHelper.BooleanToString(false);
            systemError.MaintainUser = SessionHelper.Current(HttpContext.Current.Session).UserCode;
            if (systemError.MaintainUser == null || systemError.MaintainUser == string.Empty)
            {
                systemError.MaintainUser = "******";
            }

            facade.AddSystemError(systemError);
            provider.PersistBroker.CloseConnection();
        }