Пример #1
0
 public bool EditService(
     int id,
     int type,
     int serviceStatusId,
     string picture,
     string title,
     string description,
     double price,
     DateTime?startDate,
     DateTime?endDate,
     bool timeNeeded,
     int subCategoryId)
 {
     using (ServiceDBModel db = new ServiceDBModel())
     {
         try
         {
             ServiceData foundService = db.ServiceData.Find(id);
             foundService.Type            = type;
             foundService.ServiceStatusID = serviceStatusId;
             foundService.Picture         = picture;
             foundService.Title           = title;
             foundService.Description     = description;
             foundService.Price           = price;
             foundService.StartDate       = startDate;
             foundService.EndDate         = endDate;
             foundService.TimeNeeded      = timeNeeded;
             foundService.Category        = subCategoryId;
             db.SaveChanges();
             return(true);
         }
         catch (Exception)
         {
             Log.Error("Error");
             return(false);
         }
     }
 }
Пример #2
0
        private Service ServiceDataObjectToService(ServiceData serviceData)
        {
            Service output = new Service(serviceData);

            return(output);
        }