public bool updateCompanyName(string companyID, string companyName) { int row; if ((companyID == "" || companyID == "CompanyID") && (companyName == "" || companyName == "CompanyName")) { row = 0; } else { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Update Provider Set CompanyName='" + companyName + "',MerchandiserID='" + UserManager.getMerchandID() + "' where CompanyID='" + companyID + "'"); } return(row == 1 ? true : false); }
public bool removeCompany(string companyID) { int row; if ((companyID == "" || companyID == "CompanyID")) { row = 0; } else { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Delete From Provider where CompanyID='" + companyID + "'"); } return(row == 1 ? true : false); }
public bool addCompany(string companyID, string companyName) { int row; if ((companyID == "" || companyID == "companyID") && (companyName == "" || companyName == "CompanyName")) { row = 0; } else { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Insert into Provider values('" + companyID + "','" + companyName + "','" + UserManager.getMerchandID() + "')"); } return(row == 1 ? true : false); }
public bool updateBuyer(string buyerID, string colName, string data) { int row; if ((buyerID == "" || buyerID == "BuyerID") && ((colName == "BuyerName") || (colName == "Retailer") || ((colName == "WholeSaller"))) && (data == "")) { row = 0; } else { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Update Buyer Set " + colName + "='" + data + "',MerchandiserID='" + UserManager.getMerchandID() + "' where BuyerID='" + buyerID + "'"); } return(row == 1 ? true : false); }
public bool deleteBuyer(string buyerID) { int row; if ((buyerID == "" || buyerID == "BuyerID")) { row = 0; } else { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Delete From Buyer where BuyerID='" + buyerID + "'"); } return(row == 1 ? true : false); }
public bool addBuyer(string buyerID, string buyerName, string buyerType) { int row; if ((buyerID == "" || buyerID == "BuyerID") && (buyerName == "" || buyerName == "BuyerName") && (buyerType == "" || buyerType == "BuyerType")) { row = 0; } else { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Insert into Buyer values('" + buyerID + "','" + buyerName + "','" + buyerType + "','" + UserManager.getMerchandID() + "')"); } return(row == 1 ? true : false); }
public bool setItemPriceManagement(string itemID, string retailerProfitPrice, string wholeSallerProfitPrice) { int row; if ((itemID == "" || itemID == "ItemID") && (retailerProfitPrice == "" || retailerProfitPrice == "RetailerProfitPrice") && (wholeSallerProfitPrice == "" || wholeSallerProfitPrice == "WholeSallerProfitPrice")) { row = 0; } else { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Insert into ItemPriceManagementTable values('" + itemID + "','" + retailerProfitPrice + "','" + wholeSallerProfitPrice + "')"); } return(row == 1 ? true : false); }
public bool addItemIntoStock(string itemID, string quantity) { int row; if ((itemID == "" || itemID == "ItemID") && (quantity == "" || quantity == "Quantity")) { row = 0; } else { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Insert into Stock values('" + itemID + "','" + quantity + "')"); } return(row == 1 ? true : false); }
public bool addItem(string itemID, string itemName, string cost, string companyID, string itemRegistrationTime) { int row; if ((itemID == "" || itemID == "ItemID") && (itemName == "" || itemName == "ItemName") && (cost == "" || cost == "Cost") && (companyID == "" || companyID == "CompanyID")) { row = 0; } else { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Insert into Item values('" + itemID + "','" + itemName + "','" + cost + "','" + companyID + "','" + itemRegistrationTime + "','" + UserManager.getMerchandID() + "')"); } return(row == 1 ? true : false); }
public bool updateItem(TextBox txtBox1, TextBox txtBox2, TextBox txtBox3, string itemID) { int row = 0; if (txtBox1.Text != "" && txtBox1.Text != txtBox1.Name) { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Update Item Set " + txtBox1.Name + "='" + txtBox1.Text + "',ItemRegistrationTime='" + DateTime.Now + "',MerchandiserID='" + UserManager.getMerchandID() + "' where ItemID='" + itemID + "'"); } if (txtBox2.Text != "" && txtBox2.Text != txtBox2.Name) { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Update Item Set " + txtBox2.Name + "='" + txtBox2.Text + "',ItemRegistrationTime='" + DateTime.Now + "',MerchandiserID='" + UserManager.getMerchandID() + "' where ItemID='" + itemID + "'"); } if (txtBox3.Text != "" && txtBox3.Text != txtBox3.Name) { row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Update Item Set " + txtBox3.Name + "='" + txtBox3.Text + "',ItemRegistrationTime='" + DateTime.Now + "',MerchandiserID='" + UserManager.getMerchandID() + "' where ItemID='" + itemID + "'"); } return(row == 1 ? true : false); }
public List <Dictionary <String, String> > getCompanyID() { List <Dictionary <String, String> > result = DataBaseManager.runSelectQuery("Select CompanyID from Provider"); return(result); }
public List <Dictionary <String, String> > getBuyerID() { List <Dictionary <String, String> > result = DataBaseManager.runSelectQuery("Select BuyerID from Buyer"); return(result); }
public bool deleteItemFromStock(string itemID) { int row = DataBaseManager.runInsertAndUpdateAndDeleteQuery("Delete from Stock where ItemID='" + itemID + "'"); return(row == 1 ? true : false); }
public List <Dictionary <String, String> > availableStock() { List <Dictionary <String, String> > result = DataBaseManager.runSelectQuery("Select Item.ItemID,Item.ItemName,Item.Cost,Item.CompanyID,Stock.Quantity from Item Inner Join Stock ON Item.ItemID=Stock.ItemID"); return(result); }
public List <Dictionary <String, String> > getItemIDs() { List <Dictionary <String, String> > result = DataBaseManager.runSelectQuery("Select ItemID from Item"); return(result); }