private bool update(ScheduleRecordViewModel _UserSchedule, string user_key, string user_name, physician_holiday_rate obj, long uss_key)
 {
     obj.phr_phy_key          = _UserSchedule.UserId;
     obj.phr_rate             = _UserSchedule.Rate;
     obj.phr_modified_by      = user_key;
     obj.phr_shift_key        = _UserSchedule.ShiftId;
     obj.phr_modified_by_name = user_name;
     obj.phr_date             = _UserSchedule.ScheduleDate.Date;
     obj.phr_modified_date    = DateTime.Now.ToEST();
     _physicianHolidayRateService.Edit(obj);
     return(true);
 }
        private bool insert(ScheduleRecordViewModel _UserSchedule, string user_key, string user_name, long uss_key)
        {
            physician_holiday_rate _holidayRate = new physician_holiday_rate();

            _holidayRate.phr_phy_key         = _UserSchedule.UserId;
            _holidayRate.phr_rate            = _UserSchedule.Rate;
            _holidayRate.phr_created_by      = user_key;
            _holidayRate.phr_created_by_name = user_name;
            _holidayRate.phr_date            = _UserSchedule.ScheduleDate.Date;
            _holidayRate.phr_created_date    = DateTime.Now.ToEST();
            _holidayRate.phr_uss_key         = uss_key;
            _holidayRate.phr_shift_key       = _UserSchedule.ShiftId;
            _physicianHolidayRateService.Create(_holidayRate);
            return(true);
        }
        public bool PhysicianHoliday(ScheduleRecordViewModel _UserSchedule, string user_name, string user_key, long uss_key)
        {
            bool status = false;
            var  obj    = _physicianHolidayRateService.GetCustomRate(uss_key);

            if (ModelState.IsValid)
            {
                if (obj == null)
                {
                    status = insert(_UserSchedule, user_key, user_name, uss_key);
                }
                else
                {
                    status = update(_UserSchedule, user_key, user_name, obj, uss_key);
                }
            }
            return(status);
        }