public int SaveProduct(ProductModel model) { Product _product = new Product(model); if (model.ID != 0 && model.ID != null) { _Product.Upate(_product); } else { _product = _Product.Insert(_product); } return(_product.ID); }
public int SaveCategory(CategoryModel model) { Category _category = new Category(model); if (model.CategoryId != 0 && model.CategoryId != null) { _Category.Upate(_category); } else { _category = _Category.Insert(_category); } return(_category.ID); }
public int SaveCustomer(CustomerModel model) { Customer _customer = new Customer(model); if (model.ID != 0 && model.ID != null) { _Customer.Upate(_customer); } else { _customer = _Customer.Insert(_customer); } return(_customer.ID); }