public bool DeleteCommodityType(CommodityType commodityType) { if (commodityType == null) return false; _unitOfWork.CommodityTypeRepository.Delete(commodityType); _unitOfWork.Save(); return true; }
public static CommodityType BindCommodityType(CommodityTypeViewModel commodityTypeViewModel, CommodityType commodityType = null) { var target = commodityType ?? new CommodityType(); target.CommodityTypeID = commodityTypeViewModel.CommodityTypeId; target.Name = commodityTypeViewModel.Name; return target; }
public static CommodityTypeViewModel BindCommodityTypeViewModel(CommodityType commodityType) { return new CommodityTypeViewModel() { Name = commodityType.Name, CommodityTypeId = commodityType.CommodityTypeID }; }
public bool EditCommodityType(CommodityType commodityType) { _unitOfWork.CommodityTypeRepository.Edit(commodityType); _unitOfWork.Save(); return true; }