コード例 #1
0
        //GetMaxInputID
        public int GetMaxInputID(string con)
        {
            int max_input_id = 0;

            Int32.TryParse(ConnectionDB.GetOnlyRow("select max(InputID) from tb_InputHistory"), out max_input_id);
            return(max_input_id);
        }
コード例 #2
0
        //GetMaxSalespersonID
        public int GetMaxSalespersonID(string con)
        {
            int max_salesperson_id = 0;

            Int32.TryParse(ConnectionDB.GetOnlyRow("select max(SalespersonID) from tb_Salesperson"), out max_salesperson_id);
            return(max_salesperson_id);
        }
コード例 #3
0
        //GetMaxSettingID
        public int GetMaxSettingID(string con)
        {
            int max_setting_id = 0;

            Int32.TryParse(ConnectionDB.GetOnlyRow("select max(SettingID) from tb_Currency"), out max_setting_id);
            return(max_setting_id);
        }
コード例 #4
0
        //GetMaxPaymentID
        public int GetMaxPaymentID(string con)
        {
            int max_payment_id = 0;

            Int32.TryParse(ConnectionDB.GetOnlyRow("select max(PaymentID) from tb_Payment"), out max_payment_id);
            return(max_payment_id);
        }
コード例 #5
0
        //GetMaxOrderID
        public int GetMaxOrderID(string con)
        {
            int max_order_id = 0;

            Int32.TryParse(ConnectionDB.GetOnlyRow("select max(OrderID) from tb_Order"), out max_order_id);
            return(max_order_id);
        }
コード例 #6
0
        ////get category follow paging
        //public DataTable GetCategoryFollowPaging(int be_limit, int af_limit, string con1, string con2)
        //{
        //    DataTable tb = new DataTable();
        //    string sql = "select * from [tb_Category] where [CategoryID] not in (select [CategoryID] from [tb_Category] " + con1 + " limit " + be_limit + ") " + con2 + " limit " + af_limit;
        //    tb = ConnectionDB.GetData(sql);
        //    return tb;
        //}

        //GetMaxCategoryID
        public int GetMaxCategoryID(string con)
        {
            int max_category_id = 0;

            Int32.TryParse(ConnectionDB.GetOnlyRow("select max(CategoryID) from tb_Category"), out max_category_id);
            return(max_category_id);
        }
コード例 #7
0
        //get maxCategoryID
        public int GetMaxCategoryID()
        {
            int maxcat;

            maxcat = Convert.ToInt32(ConnectionDB.GetOnlyRow("select max(CategoryID) from tb_Category"));
            return(maxcat);
        }
コード例 #8
0
        //get sum Category
        public int GetSumCategory(string con)
        {
            int    sum_category  = 0;
            string _sum_category = ConnectionDB.GetOnlyRow("select count([CategoryID]) from [tb_Category] " + con);

            sum_category = Convert.ToInt32(_sum_category);
            return(sum_category);
        }
コード例 #9
0
        //get sum order
        public int GetSumOrder(string con)
        {
            int    sum_order  = 0;
            string _sum_order = ConnectionDB.GetOnlyRow("select count([OrderID]) from [tb_Order] " + con);

            if (int.TryParse(_sum_order, out sum_order) == true)
            {
                return(sum_order);
            }
            else
            {
                return(0);
            }
        }
コード例 #10
0
        //find product is active
        public bool FindProductIsActive(int categoryid)
        {
            string sql    = "SELECT [ProductID] from [tb_Product] where [CategoryID] = " + categoryid + " AND [Active] = 1";
            string result = ConnectionDB.GetOnlyRow(sql);

            if (result == "")
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
コード例 #11
0
        //get sum Product
        public int GetTotalProduct(string con)
        {
            int    sum_product  = 0;
            string _sum_product = ConnectionDB.GetOnlyRow("select count([ProductID]) from [tb_Product] " + con);

            if (Int32.TryParse(_sum_product, out sum_product))
            {
                return(sum_product);
            }
            else
            {
                return(0);
            }
        }
コード例 #12
0
        //GetQtyProductOutput
        public int GetQtyProductOutput(string con)
        {
            string qty_productoutput = "";
            string sql = "SELECT SUM(Qty) FROM [tb_OrderDetail] " + con;

            qty_productoutput = ConnectionDB.GetOnlyRow(sql);
            if (qty_productoutput == "")
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(qty_productoutput));
            }
        }
コード例 #13
0
        //CheckExist
        public string CheckExist(string condition)
        {
            string sql = "select [ProductID] from [tb_OrderDetail] " + condition;

            return(ConnectionDB.GetOnlyRow(sql));
        }