Ejemplo n.º 1
0
 public bool DeleteCommodity(Commodity commodity)
 {
     if (commodity == null) return false;
     _unitOfWork.CommodityRepository.Delete(commodity);
     _unitOfWork.Save();
     return true;
 }
Ejemplo n.º 2
0
        public static CommodityViewModel BindCommodityViewModel(Commodity commodity)
        {
            return new CommodityViewModel()
                       {
                           CommodityID = commodity.CommodityID,
                           Name = commodity.Name,
                           CommodityCode = commodity.CommodityCode,
                           NameAM = commodity.NameAM,
                           LongName = commodity.LongName,
                           CommodityTypeID = commodity.CommodityTypeID,
                           ParentID = commodity.CommodityTypeID

                       };
        }
Ejemplo n.º 3
0
        public static Commodity BindCommodity(CommodityViewModel commodityViewModel, Commodity commodity = null)
        {
            return commodity ?? new Commodity()
            {
                CommodityID = commodityViewModel.CommodityID,
                Name = commodityViewModel.Name,
                CommodityCode = commodityViewModel.CommodityCode,
                NameAM = commodityViewModel.NameAM,
                LongName = commodityViewModel.LongName,
                CommodityTypeID = commodityViewModel.CommodityTypeID,
                ParentID = commodityViewModel.CommodityTypeID

            };
        }
Ejemplo n.º 4
0
 public bool EditCommodity(Commodity commodity)
 {
     _unitOfWork.CommodityRepository.Edit(commodity);
     _unitOfWork.Save();
     return true;
 }
Ejemplo n.º 5
0
 public bool AddCommodity(Commodity commodity)
 {
     _unitOfWork.CommodityRepository.Add(commodity);
     _unitOfWork.Save();
     return true;
 }