public string Delete(StoreProduct oStoreProduct, int nUserID) { string sReturnMessage = ""; Connection.Open(); Command.CommandText = StoreProductDA.IUD(oStoreProduct, EnumDBOperation.Delete, nUserID); try { Command.ExecuteNonQuery(); } catch (Exception e) { sReturnMessage = e.Message.Split('~')[0]; } Connection.Close(); return(sReturnMessage); }
public StoreProduct SellProduct(StoreProduct oStoreProduct, int nUserID) { Connection.Open(); if (oStoreProduct.StoreProductID > 0) { Command.CommandText = StoreProductDA.IUD(oStoreProduct, EnumDBOperation.Custom_1, nUserID); } SqlDataReader reader = Command.ExecuteReader(); StoreProduct _oStoreProduct = new StoreProduct(); if (reader.HasRows) { _oStoreProduct = MakeObject(reader); } reader.Close(); Connection.Close(); return(_oStoreProduct); }