Beispiel #1
0
 public ScheduleListModel(dbModel.Schedule schedule)
 {
     Id             = schedule.Id;
     Business       = schedule.Service.Business.Name;
     Service        = schedule.Service.Name;
     Price          = schedule.Service.Price.ToString();
     DateTime       = schedule.DateTime;
     AssignedPerson = schedule.Personnel == null ? "Not yet assigned" : schedule.Personnel.Name;
     Status         = schedule.Status == null ? "" : schedule.Status;
 }
Beispiel #2
0
 public dbModel.Schedule ToDBModel()
 {
     dbModel.Schedule model = new dbModel.Schedule()
     {
         ServiceId = ServiceId,
         Note      = Note,
         DateTime  = DateTime,
         Status    = "New",
     };
     return(model);
 }
Beispiel #3
0
 public ScheduleModel(dbModel.Schedule model)
 {
     Id        = model.Id;
     User      = new UserListModel(model.User);
     Personnel = model.Personnel == null  ? null : new PersonnelListModel(model.Personnel);
     ServiceId = model.ServiceId;
     Service   = new ServiceModel(model.Service);
     DateTime  = model.DateTime;
     Note      = model.Note;
     Status    = model.Status;
     Comment   = model.Comment;
 }
Beispiel #4
0
 public dbModel.Schedule ToUpdateDBModel(dbModel.Schedule schedule)
 {
     dbModel.Schedule model = new dbModel.Schedule()
     {
         Id          = schedule.Id,
         UserId      = schedule.UserId,
         PersonnelId = PersonnelId == null ? schedule.PersonnelId : PersonnelId,
         ServiceId   = schedule.ServiceId,
         Note        = Note == null ? schedule.Note : Note,
         DateTime    = DateTime,
         Status      = Status == "Done" || schedule.Status == "Done" ? schedule.Status : "New",
         Comment     = Comment == null ? schedule.Comment : Comment,
     };
     return(model);
 }