public IList <ReportPageSetting> Get()
        {
            try
            {
                Logger.LogInfo("Get: Bank process start");
                IList <ReportPageSetting> reportPageSettings = new List <ReportPageSetting>();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ALL));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    ReportPageSetting reportPage = convertToReportSettingObject(dr);
                    reportPageSettings.Add(reportPage);
                }
                Logger.LogInfo("Get: Bank process completed.");
                return(reportPageSettings);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }
        private ReportPageSetting convertToReportSettingObject(DataRow dr)
        {
            ReportPageSetting reportPage = new ReportPageSetting();

            reportPage.ReportPageName = dr.Field <string>("ReportPageName");
            reportPage.IsSelected     = bool.Parse(dr["IsSelected"].ToString());
            return(reportPage);
        }
Esempio n. 3
0
        public Result Update(ReportPageSetting reportPageSetting)
        {
            var result = new Result();

            try
            {
                ReportPageSettingService bankService = new ReportPageSettingService();
                bankService.Update(reportPageSetting);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }
        public void Update(ReportPageSetting reportPageSetting)
        {
            try
            {
                string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(GET_CLIENT_NAME_QUERY, 0));

                DataBase.DBService.ExecuteCommand(string.Format(UPDATE_QUERY,
                                                                (reportPageSetting.IsSelected) ?  1 : 0,
                                                                reportPageSetting.ReportPageName));
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                throw ex;
            }
        }