Наследование: PromisedContributionPOCO
        public bool Delete(PromisedContribution promisedContribution)
        {
            try
            {
                _unitOfWork.PromisedContributionRepository.Delete(promisedContribution);
                _unitOfWork.Save();
                return true;
            }
            catch (Exception e)
            {

            }
            return false;
        }
        public bool Create(PromisedContribution promisedContribution)
        {
            _unitOfWork.PromisedContributionRepository.Add(promisedContribution);
            _unitOfWork.Save();
            try
            {
               // _unitOfWork.PromisedContributionRepository.Add(promisedContribution);
               // _unitOfWork.Save();
                return true;
            }
            catch (Exception e)
            {

            }
            return false;
        }
 public PromisedContributionViewModel convertToViewModel(PromisedContribution item)
 {
     string userPreference = userAccountService.GetUserInfo(HttpContext.User.Identity.Name).DatePreference;
     return new PromisedContributionViewModel
     {
         PromisedContributionId = item.PromisedContributionId,
         PromisedQuantity=item.PromisedQuantity,
         ExpectedTimeOfArrival=item.ExpectedTimeOfArrival,
         strETA = item.ExpectedTimeOfArrival.ToCTSPreferedDateFormat(userPreference),
         DeliveredQuantity=item.DeliveredQuantity,
         DonorId=item.DonorId,
         HubId=item.HubId,
         CommodityId=item.CommodityId,
         CommodityName=item.Commodity.Name,
         HubName=item.Hub.Name,
         DonorName=item.Donor.Name
     };
 }
 public ActionResult Edit(int id = 0)
 {
     PromisedContribution contribution = new PromisedContribution();
     contribution.ExpectedTimeOfArrival = System.DateTime.Now;
     if (id != 0)
     {
         contribution = promisedContributionService.FindById(id);
     }
     loadListItems();
     return View(contribution);
 }
 public ActionResult Edit(PromisedContribution contribution)
 {
     if (contribution != null && ModelState.IsValid)
     {
         try
         {
             if (contribution.PromisedContributionId > 0)
             {
                 promisedContributionService.Update(contribution);
                 ViewBag.Message = "Updated";
             }
             else
             {
                 promisedContributionService.Create(contribution);
                 ViewBag.Message = "Added";
             }
                 return RedirectToAction("Index");
         }
         catch (Exception e)
         {
         }
     }
     loadListItems();
     return View(contribution);
 }