public void AddMaintenancePhoto(int maintenanceId, string photoPath)
 {
     var maintenancephoto = new MaintenancePhoto { MaintenanceID = maintenanceId, PhotoPath = photoPath };
     if (!ModelState.IsValid) return;
     UnitofWork.MaintenancePhotoRepository.Add(maintenancephoto);
     UnitofWork.Save();
 }
 public void AddPicture(int maintenanceId, string photoPath)
 {
     var maintenancephoto = new MaintenancePhoto { MaintenanceID = maintenanceId, PhotoPath = photoPath };
     if (!ModelState.IsValid) return;
     _db.MaintenancePhotoes.Add(maintenancephoto);
     _db.SaveChanges();
 }
 public ActionResult Edit(MaintenancePhoto maintenancephoto)
 {
     if (ModelState.IsValid)
     {
         UnitofWork.MaintenancePhotoRepository.Edit(maintenancephoto);
         UnitofWork.Save();
         return RedirectToAction("Index");
     }
     ViewBag.MaintenanceID = new SelectList(UnitofWork.MaintenanceOrderRepository.All, "MaintenanceID", "Description",
                                            maintenancephoto.MaintenanceID);
     return View(maintenancephoto);
 }
        public MaintenancePhoto ThirdMaintenancePhoto()
        {
            var thirdMaintenancePhoto = new MaintenancePhoto {

                 MaintenanceID = new Int32()
            ,
                 PhotoID = new Int32()
            ,
                 PhotoPath = null,
                 MaintenanceOrder = new MaintenanceOrder()

             };

            return thirdMaintenancePhoto;
        }
        public MaintenancePhoto SecondMaintenancePhoto()
        {
            var secondMaintenancePhoto = new MaintenancePhoto {

                 MaintenanceID = new Int32()
            ,
                 PhotoID = new Int32()
            ,
                 PhotoPath = null,
                 MaintenanceOrder = new MaintenanceOrder()

             };

            return secondMaintenancePhoto;
        }
        public MaintenancePhoto FirstMaintenancePhoto()
        {
            var firstMaintenancePhoto = new MaintenancePhoto {

                 MaintenanceID = new Int32()
            ,
                 PhotoID = new Int32()
            ,
                 PhotoPath = null,
                 MaintenanceOrder = new MaintenanceOrder()

             };

            return firstMaintenancePhoto;
        }