public double getPrice(int height, int width, int depth, string color, PanelsType panelsType, string typeObj) { conn = new MySqlConnection(MyConString); conn.Open(); typeObj = typeObj + " " + EnumParse.parseTypeEnumToStr(panelsType); string price = DbUtils.BigMoney(conn, "CustPrice", typeObj, height.ToString(), depth.ToString(), width.ToString(), color)[0]; conn.Close(); return(double.Parse(price)); }
public CatalogueComponents createComponents(int height, int width, int depth, ComponentColor color, PanelsType panelsType, string typeObj) { conn = new MySqlConnection(MyConString); conn.Open(); // 0 = code, 1 = in stock, 2 = price typeObj = typeObj + " " + EnumParse.parseTypeEnumToStr(panelsType); 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 Panels(double.Parse(price), typeof(Panels).ToString().Split('.')[1], code, size, inStock, color, panelsType)); }