Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
        //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);
        }
Beispiel #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);
        }
        ////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);
        }
        //get maxCategoryID
        public int GetMaxCategoryID()
        {
            int maxcat;

            maxcat = Convert.ToInt32(ConnectionDB.GetOnlyRow("select max(CategoryID) from tb_Category"));
            return(maxcat);
        }
        //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);
        }
Beispiel #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);
            }
        }
Beispiel #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);
            }
        }
Beispiel #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);
            }
        }
Beispiel #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));
            }
        }
Beispiel #13
0
        //CheckExist
        public string CheckExist(string condition)
        {
            string sql = "select [ProductID] from [tb_OrderDetail] " + condition;

            return(ConnectionDB.GetOnlyRow(sql));
        }