//update Setting Active public int UpdateSettingActive() { string sql = "UPDATE [tb_Currency] SET [Active] = 0 WHERE [Active] = 1"; return(ConnectionDB.ExecuteNonQuery(sql)); }
//get Order public DataTable GetOrder(string con) { return(ConnectionDB.GetData(" SELECT * FROM [tb_Order] " + con)); }
//GetOrderPrint public DataTable GetOrderPrint(string sql) { return(ConnectionDB.GetData(sql)); }
//DeleteInputHistory public int DeleteInputHistory(EC_tb_InputHistory ec_tb_inputhistory) { string sql = "DELETE FROM [tb_InputHistory] WHERE [InputID] = " + ec_tb_inputhistory.InputID; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete OrderDetail public int DeleteOrderDetail(EC_tb_OrderDetail ec_tb_od) { string sql = "DELETE FROM [tb_OrderDetail] WHERE [OrderID]=" + ec_tb_od.OrderID + " AND [ProductID] = " + ec_tb_od.ProductID; return(ConnectionDB.ExecuteNonQuery(sql)); }
//get Setting public DataTable GetSetting(string con) { string sql = "SELECT * FROM [tb_Currency] " + con; return(ConnectionDB.GetData(sql)); }
//delete all Payment public int DeleteAllPayment() { string sql = "DELETE FROM [tb_Payment]"; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete product public int DeleteProduct(EC_tb_Product ec_tb_pro) { string sql = "DELETE FROM [tb_Product] WHERE ProductID=" + ec_tb_pro.ProductID; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete product from CategoryID public int DeleteProductFromCategoryID(EC_tb_Product ec_tb_pro) { string sql = "DELETE FROM [tb_Product] WHERE [CategoryID]=" + ec_tb_pro.CategoryID; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete all Category public int DeleteAllCategory() { return(ConnectionDB.ExecuteNonQuery("delete from tb_Category")); }
//update InventoryCount public int UpdateInventoryCount(EC_tb_Product ec_tb_product) { string sql = "Update [tb_Product] set [InventoryCount] = [InventoryCount] - " + ec_tb_product.InventoryCount + " where [ProductID] = " + ec_tb_product.ProductID; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete Category public int DeleteCategory(EC_tb_Category ec_tb_cat) { return(ConnectionDB.ExecuteNonQuery("delete from tb_Category where [CategoryID]=" + ec_tb_cat.CategoryID)); }
//GetQuatityOrderDetail public DataTable GetQuatityOrderDetail(string condition) { string sql = "select [tb_OrderDetail].[ProductID], sum([tb_OrderDetail].[Qty]) as Qty from [tb_OrderDetail] JOIN [tb_Product] ON [tb_Product].[ProductID] = [tb_OrderDetail].[ProductID] WHERE [tb_Product].[Active] = 1 " + condition + " group by [tb_Product].[ProductID]"; return(ConnectionDB.GetData(sql)); }
//delete all OrderDetail public int DeleteAllOrderDetail(string condition) { string sql = "DELETE FROM [tb_OrderDetail] " + condition; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete Setting public int DeleteSetting(EC_tb_Setting ec_tb_set) { string sql = "DELETE FROM [tb_Currency] WHERE [SettingID] =" + ec_tb_set.SettingID; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete Customer public int DeleteCustomer(EC_tb_Customer ec_tb_cus) { string sql = "delete from tb_Customer where CustomerID=" + ec_tb_cus.CustomerID; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete all Setting public int DeleteAllSetting() { string sql = "DELETE FROM [tb_Currency]"; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete all Customer public int DeleteAllCustomer() { string sql = "delete from tb_Customer"; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete Payment public int DeletePayment(EC_tb_Payment ec_tb_pay) { string sql = "DELETE FROM [tb_Payment] WHERE [PaymentID]=" + ec_tb_pay.PaymentID; return(ConnectionDB.ExecuteNonQuery(sql)); }
//delete Order public int DeleteOrder(EC_tb_Order ec_tb_ord) { string sql = "DELETE FROM [tb_Order] WHERE [OrderID]=" + ec_tb_ord.OrderID; return(ConnectionDB.ExecuteNonQuery(sql)); }
//get Payment public DataTable GetPayment(string con) { string sql = "select * from tb_Payment " + con; return(ConnectionDB.GetData(sql)); }
//delete all Order public int DeleteAllOrder() { string sql = "DELETE FROM [tb_Order]"; return(ConnectionDB.ExecuteNonQuery(sql)); }
//DeleteAllInputHistory public int DeleteAllInputHistory() { string sql = "DELETE FROM [tb_InputHistory]"; return(ConnectionDB.ExecuteNonQuery(sql)); }
//CheckExist public string CheckExist(string condition) { string sql = "select [ProductID] from [tb_OrderDetail] " + condition; return(ConnectionDB.GetOnlyRow(sql)); }