public double getPrice(int height, int width, int depth, CrossBarType crossType, string typeObj) { conn = new MySqlConnection(MyConString); conn.Open(); typeObj = typeObj + " " + EnumParse.parseTypeEnumToStr(crossType); string price = DbUtils.BigMoney(conn, "CustPrice", typeObj, height.ToString(), depth.ToString(), width.ToString(), "")[0]; conn.Close(); return(double.Parse(price)); }
public double newPrice(int height, string doorsColor, string panelColor, CatalogueComponents compo) { string typeObj = compo.GetType().ToString().Split('.')[1]; string rqHeight = "0"; string rqColor = ""; if (typeObj == "Panels") { typeObj = "Panel" + " " + EnumParse.parseTypeEnumToStr(((Panels)compo).type); rqColor = panelColor; if (EnumParse.parseTypeEnumToStr(((Panels)compo).type) == "HL") { rqHeight = "0"; } else { rqHeight = height.ToString(); } } else if (typeObj == "Door") { if (doorsColor == "none") { return(0); } rqColor = doorsColor; rqHeight = height.ToString(); } else if (typeObj == "CrossBar") { typeObj += " " + EnumParse.parseTypeEnumToStr(((CrossBar)compo).type); } else if (typeObj == "Cleat") { rqHeight = height.ToString(); } conn = new MySqlConnection(MyConString); conn.Open(); string price = DbUtils.BigMoney(conn, "CustPrice", typeObj, rqHeight, compo.size.depth.ToString(), compo.size.width.ToString(), rqColor)[0]; conn.Close(); return(double.Parse(price)); }
public CatalogueComponents createComponents(int height, int width, int depth, CrossBarType crossType, string typeObj) { conn = new MySqlConnection(MyConString); conn.Open(); // 0 = code, 1 = in stock, 2 = price typeObj = typeObj + " " + EnumParse.parseTypeEnumToStr(crossType); string price = DbUtils.BigMoney(conn, "CustPrice", typeObj, height.ToString(), depth.ToString(), width.ToString(), "")[0]; conn.Close(); conn.Open(); string code = DbUtils.BigMoney(conn, "Code", typeObj, height.ToString(), depth.ToString(), width.ToString(), "")[0]; conn.Close(); conn.Open(); bool inStock = int.Parse(DbUtils.BigMoney(conn, "Instock", typeObj, height.ToString(), depth.ToString(), width.ToString(), "")[0]) > 0; ComponentSize size = new ComponentSize(height, width, depth); conn.Close(); return(new CrossBar(double.Parse(price), typeof(CrossBar).ToString().Split('.')[1], code, size, inStock, crossType)); }
public CatalogueComponents createComponents(int height, int width, int depth, ComponentColor color, bool ifCup, string typeObj) { conn = new MySqlConnection(MyConString); conn.Open(); // 0 = code, 1 = in stock, 2 = price string price = DbUtils.BigMoney(conn, "CustPrice", typeObj, height.ToString(), depth.ToString(), width.ToString(), EnumParse.parseColorEnumToStr(color))[0]; conn.Close(); conn.Open(); string code = DbUtils.BigMoney(conn, "Code", typeObj, height.ToString(), depth.ToString(), width.ToString(), EnumParse.parseColorEnumToStr(color))[0]; conn.Close(); conn.Open(); bool inStock = int.Parse(DbUtils.BigMoney(conn, "Instock", typeObj, height.ToString(), depth.ToString(), width.ToString(), EnumParse.parseColorEnumToStr(color))[0]) > 0; ComponentSize size = new ComponentSize(height, width, depth); conn.Close(); return(new Door(double.Parse(price), typeof(Door).ToString().Split('.')[1], code, size, inStock, color, ifCup)); }