示例#1
0
 public bool DeleteWoredaHub(WoredaHub woredaHub)
 {
     if (woredaHub == null)
     {
         return(false);
     }
     _unitOfWork.WoredaHubRepository.Delete(woredaHub);
     _unitOfWork.Save();
     return(true);
 }
示例#2
0
 public static WoredaHubViewModel WoredaHubViewModelBinder(WoredaHub woredaHub)
 {
     return(new WoredaHubViewModel
     {
         WoredaHubID = woredaHub.WoredaHubID,
         WoredaHubName = woredaHub.StartDate + " - " + woredaHub.Status,
         HRDID = woredaHub.HRDID,
         HRD = _hrdService.FindById(woredaHub.HRDID).Season.Name + " - " + _hrdService.FindById(woredaHub.HRDID).Year,
         PlanID = woredaHub.PlanID,
         Plan = _planService.FindById(woredaHub.PlanID).PlanName,
         StartDate = woredaHub.StartDate,
         EndDate = woredaHub.EndDate,
         Status = woredaHub.Status
     });
 }
示例#3
0
        public static WoredaHub WoredaHubListBinder(WoredaHubViewModel model)
        {
            if (model == null)
            {
                return(null);
            }
            var woredaHub = new WoredaHub()
            {
                WoredaHubID = model.WoredaHubID,
                HRDID       = model.HRDID,
                PlanID      = model.PlanID,
                StartDate   = model.StartDate,
                EndDate     = model.EndDate,
                Status      = model.Status
            };

            return(woredaHub);
        }
示例#4
0
 public bool EditWoredaHub(WoredaHub woredaHub)
 {
     _unitOfWork.WoredaHubRepository.Edit(woredaHub);
     _unitOfWork.Save();
     return(true);
 }
示例#5
0
 public bool AddWoredaHub(WoredaHub woredaHub)
 {
     _unitOfWork.WoredaHubRepository.Add(woredaHub);
     _unitOfWork.Save();
     return(true);
 }