public static void DeleteProduct(String ID) { MsProducts product = SearchProductByID(ID); TokobeEntities.MsProducts.Remove(product); TokobeEntities.SaveChanges(); }
public static void UpdateProduct(String ID, String Name, int Price, int Stock) { MsProducts product = SearchProductByID(ID); product.ProductName = Name; product.ProductPrice = Price; product.ProductStock = Stock; TokobeEntities.SaveChanges(); }
public static MsProducts InitProduct(Int64 ID, String TypeID, String Nama, int Price, int Stock) { MsProducts products = new MsProducts(); products.ProductID = "PT" + ID; products.ProductTypeID = TypeID; products.ProductName = Nama; products.ProductPrice = Price; products.ProductStock = Stock; return(products); }