示例#1
0
        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));
        }
示例#2
0
        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));
        }