Пример #1
0
 public ActionResult EditDayDialog(int Id,int statusId,string hours)
 {
     try
     {
         double modelHours;
         Double.TryParse(hours, out modelHours);
         EditDayModel model = new EditDayModel{Id = Id,StatusId = statusId,Hours = (float)modelHours};
         EmployeeBl.GetEditDayModel(model);
         return PartialView(model);
     }
     catch (Exception ex)
     {
         Log.Error("Exception", ex);
         string error = "Ошибка при загрузке данных: " + ex.GetBaseException().Message;
         return PartialView("DialogError", new DialogErrorModel { Error = error });
     }
 }
Пример #2
0
 public void GetEditDayModel(EditDayModel model)
 {
     TimesheetDay day = TimesheetDayDao.Load(model.Id);
     //model.StatusId = day.Status.Id;
     //model.Hours = day.Hours;
     model.Statuses = GetTimesheetStatusesList();
     DateTime month = day.Timesheet.Month;
     DateTime editDay = new DateTime(month.Year, month.Month, day.Number);
     model.Day = editDay.ToString("dd MMMM yyyy") + ", " + editDay.ToString("dddd");
 }