コード例 #1
0
        public void deleteProduct(Guid id)
        {
            objKAProduct = new CRM_KA_ProductRepository();

            CRM_KA_Product Product = objKAProduct.GetSingle(x => x.id.Equals(id));

            objKAProduct.Delete(Product);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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;
        }