/// <summary>
        /// Update company setting
        /// </summary>
        /// <param name="data">companySetting</param>
        /// <returns>bool : true/false</returns>
        public bool EditCompanySetting(CompanySettingPlus companySetting)
        {
            IDictionary <string, object> columns = new Dictionary <string, object>()
            {
                { "default_holiday_type", string.IsNullOrEmpty(companySetting.default_holiday_type) ? null : companySetting.default_holiday_type }
                , { "check_point_week", companySetting.check_point_week }
                , { "default_work_time_days", companySetting.default_work_time_days }
                , { "password_input_limit", companySetting.password_input_limit }
                , { "password_effective_month", companySetting.password_effective_month }
                , { "decimal_calculation_type", companySetting.decimal_calculation_type }
                , { "working_time_unit_minute", companySetting.working_time_unit_minute }
                , { "account_closing_month", companySetting.account_closing_month }
                , { "work_closing_date", companySetting.work_closing_date }
                , { "upd_date", companySetting.upd_date }
                , { "upd_id", companySetting.upd_id }
            };

            IDictionary <string, object> condition;

            condition = new Dictionary <string, object>()
            {
                { "company_code", companySetting.company_code }
            };

            return(Update <CompanySetting>(columns, condition) > 0);
        }
        /// <summary>
        /// Edit company detail
        /// </summary>
        /// <param name="companySetting">companySetting</param>
        /// <param name="holidays">holidays</param>
        /// <returns>bool : true/false</returns>
        public bool EditCompanyDetail(CompanySettingPlus companySetting, IList <Holiday> holidays)
        {
            bool res, res2;

            using (var transaction = new TransactionScope())
            {
                res  = this._repository.EditCompanySetting(companySetting);
                res2 = this._repository.EditSpecialHoliday(holidays, companySetting.company_code);

                if (res && res2)
                {
                    transaction.Complete();
                }
            }

            return(res && res2);
        }
 public PMS10003CompanyDetailViewModel()
 {
     COMPANY_SETTING        = new CompanySettingPlus();
     HOLIDAY_TYPE_LIST      = new List <Weekday>();
     CHECK_POINT_WEEK_LIST  = new List <WeekPointDay>();
     DEFAULT_WORK_TIME_LIST = new List <SelectListItem>()
     {
         new SelectListItem {
             Text = "1", Value = "1"
         },
         new SelectListItem {
             Text = "2", Value = "2"
         },
         new SelectListItem {
             Text = "3", Value = "3"
         },
         new SelectListItem {
             Text = "4", Value = "4"
         },
         new SelectListItem {
             Text = "5", Value = "5"
         },
         new SelectListItem {
             Text = "6", Value = "6"
         },
         new SelectListItem {
             Text = "7", Value = "7"
         },
         new SelectListItem {
             Text = "8", Value = "8"
         },
         new SelectListItem {
             Text = "9", Value = "9"
         },
         new SelectListItem {
             Text = "10", Value = "10"
         },
         new SelectListItem {
             Text = "11", Value = "11"
         },
         new SelectListItem {
             Text = "12", Value = "12"
         },
         new SelectListItem {
             Text = "13", Value = "13"
         },
         new SelectListItem {
             Text = "14", Value = "14"
         },
         new SelectListItem {
             Text = "15", Value = "15"
         },
         new SelectListItem {
             Text = "16", Value = "16"
         },
         new SelectListItem {
             Text = "17", Value = "17"
         },
         new SelectListItem {
             Text = "18", Value = "18"
         },
         new SelectListItem {
             Text = "19", Value = "19"
         },
         new SelectListItem {
             Text = "20", Value = "20"
         },
         new SelectListItem {
             Text = "21", Value = "21"
         },
         new SelectListItem {
             Text = "22", Value = "22"
         },
         new SelectListItem {
             Text = "23", Value = "23"
         },
         new SelectListItem {
             Text = "24", Value = "24"
         }
     };
     PASSWORD_INPUT_LIMIT_LIST = new List <SelectListItem>()
     {
         new SelectListItem {
             Text = "1", Value = "1"
         },
         new SelectListItem {
             Text = "2", Value = "2"
         },
         new SelectListItem {
             Text = "3", Value = "3"
         },
         new SelectListItem {
             Text = "4", Value = "4"
         },
         new SelectListItem {
             Text = "5", Value = "5"
         },
         new SelectListItem {
             Text = "6", Value = "6"
         },
         new SelectListItem {
             Text = "7", Value = "7"
         },
         new SelectListItem {
             Text = "8", Value = "8"
         },
         new SelectListItem {
             Text = "9", Value = "9"
         },
         new SelectListItem {
             Text = "10", Value = "10"
         }
     };
     PASSWORD_EFFECTIVE_TIME_LIST = new List <SelectListItem>()
     {
         new SelectListItem {
             Text = "0", Value = "0"
         },
         new SelectListItem {
             Text = "1", Value = "1"
         },
         new SelectListItem {
             Text = "2", Value = "2"
         },
         new SelectListItem {
             Text = "3", Value = "3"
         },
         new SelectListItem {
             Text = "4", Value = "4"
         },
         new SelectListItem {
             Text = "5", Value = "5"
         },
         new SelectListItem {
             Text = "6", Value = "6"
         },
         new SelectListItem {
             Text = "7", Value = "7"
         },
         new SelectListItem {
             Text = "8", Value = "8"
         },
         new SelectListItem {
             Text = "9", Value = "9"
         },
         new SelectListItem {
             Text = "10", Value = "10"
         },
         new SelectListItem {
             Text = "11", Value = "11"
         },
         new SelectListItem {
             Text = "12", Value = "12"
         }
     };
     CACULATE_TYPE_LIST = new List <SelectListItem>()
     {
         new SelectListItem {
             Value = "01", Text = "小数点以下切り捨て"
         },
         new SelectListItem {
             Value = "02", Text = "小数点第一位切り上げ"
         },
         new SelectListItem {
             Value = "03", Text = "小数点第一位四捨五入"
         }
     };
     WORK_TIME_UNIT_LIST = new List <SelectListItem>()
     {
         new SelectListItem {
             Text = "5", Value = "5"
         },
         new SelectListItem {
             Text = "10", Value = "10"
         },
         new SelectListItem {
             Text = "15", Value = "15"
         },
         new SelectListItem {
             Text = "20", Value = "20"
         },
         new SelectListItem {
             Text = "30", Value = "30"
         },
         new SelectListItem {
             Text = "60", Value = "60"
         }
     };
     SPECIAL_HOLIDAY_LIST = new List <Holiday>();
 }