public string[] RegisterPersonnelRuleDebugSettings_SystemReportsPage(string PersonnelCode, string IsRuleDebugActive) { this.InitializeCulture(); string[] retMessage = new string[4]; try { AttackDefender.CSRFDefender(this.Page); PersonnelCode = this.StringBuilder.CreateString(PersonnelCode); bool isRuleDebugActive = bool.Parse(this.StringBuilder.CreateString(IsRuleDebugActive)); Person person = this.PersonBusiness.GetByBarcode(PersonnelCode); if (person == null) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, new Exception(GetLocalResourceObject("PersonnelNotExistsWithThisBarcode").ToString()), retMessage); return(retMessage); } ApplicationSettings applicationSettings = BApplicationSettings.CurrentApplicationSettings; applicationSettings.RuleDebug = isRuleDebugActive; applicationSettings.PersonCodeForDebug = person.BarCode; ApplicationSettingsBusiness.SaveChanges(applicationSettings, UIActionType.EDIT); this.SystemReportsBusiness.DeleteAllEngineDebugReport(); RuleDebugPersonnelFeatures RDBF = new RuleDebugPersonnelFeatures() { ID = person.ID, Name = person.Name, Barcode = person.BarCode, IsRuleDebugActive = isRuleDebugActive }; retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString(); retMessage[1] = GetLocalResourceObject("OperationComplete").ToString(); retMessage[2] = "success"; retMessage[3] = this.JsSerializer.Serialize(RDBF); return(retMessage); } catch (UIValidationExceptions ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage); return(retMessage); } catch (UIBaseException ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage); return(retMessage); } catch (Exception ex) { retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage); return(retMessage); } }
private void GetPersonnelRuleDebugSettings_SystemReportsPage() { try { ApplicationSettings applicationSettings = BApplicationSettings.CurrentApplicationSettings; if (applicationSettings.PersonCodeForDebug != null && applicationSettings.PersonCodeForDebug != string.Empty) { Person person = this.PersonBusiness.GetByBarcode(applicationSettings.PersonCodeForDebug); RuleDebugPersonnelFeatures RDBF = new RuleDebugPersonnelFeatures() { ID = person.ID, Name = person.Name, Barcode = person.BarCode, IsRuleDebugActive = applicationSettings.RuleDebug }; this.hfCurrentRuleDebugPersonnelFeatures_SystemReports.Value = this.JsSerializer.Serialize(RDBF); } } catch (Exception) { } }