示例#1
0
 public bool DeleteCommoditySource(CommoditySource commoditySource)
 {
     if (commoditySource == null) return false;
     _unitOfWork.CommoditySourceRepository.Delete(commoditySource);
     _unitOfWork.Save();
     return true;
 }
        public static CommoditySourceViewModel BindCommoditySourceViewModel(CommoditySource commoditySource)
        {
            return new CommoditySourceViewModel()
            {
                CommoditySourceID=commoditySource.CommoditySourceID,
                Name=commoditySource.Name

            };
        }
        public static CommoditySource BindCommoditySource(CommoditySourceViewModel commoditySourceViewModel, CommoditySource commoditySource = null)
        {
            var target = commoditySource ?? new CommoditySource();

                target.CommoditySourceID = commoditySourceViewModel.CommoditySourceID;
                target.Name = commoditySourceViewModel.Name;

            return target;
        }
示例#4
0
 public bool EditCommoditySource(CommoditySource commoditySource)
 {
     _unitOfWork.CommoditySourceRepository.Edit(commoditySource);
     _unitOfWork.Save();
     return true;
 }