public void deleteProduct(Guid id) { objKAProduct = new CRM_KA_ProductRepository(); CRM_KA_Product Product = objKAProduct.GetSingle(x => x.id.Equals(id)); objKAProduct.Delete(Product); }
public CRM_KA_ProductModel getProductById(Guid id) { objKAProduct = new CRM_KA_ProductRepository(); Mapper.CreateMap<CRM_KA_Product, CRM_KA_ProductModel>(); var entity = objKAProduct.GetSingle(x => x.id.Equals(id)); CRM_KA_ProductModel result = new CRM_KA_ProductModel(); result = Mapper.Map(entity, result); return result; }
public void saveProduct(CRM_KA_ProductModel entity) { objKAProduct = new CRM_KA_ProductRepository(); CRM_KA_Product Product = new CRM_KA_Product(); Product.id = entity.id; Product.CustomerID = entity.CustomerID; Product.Product = entity.Product; objKAProduct.Add(Product); }
public IList<CRM_KA_ProductModel> getAllProductByCustomer(string CustomerID) { objKAProduct = new CRM_KA_ProductRepository(); Mapper.CreateMap<CRM_KA_Product, CRM_KA_ProductModel>(); IList<CRM_KA_Product> objEntity = objKAProduct.GetAll(x => x.CustomerID.Equals(CustomerID)).ToList(); IList<CRM_KA_ProductModel> objResult = new List<CRM_KA_ProductModel>(); objResult = Mapper.Map(objEntity, objResult); return objResult; }