private DataTable GetPurchaseRange()
        {
            var dbCon = DBConnection.Instance();

            dbCon.IsConnect();
            MySqlCommand cmd = new MySqlCommand();

            cmd.Connection  = dbCon.Connection;
            cmd.CommandType = CommandType.Text;

            cmd.CommandText = "  SELECT        itemName, SUM(Total) AS Expr1 FROM po_report_view WHERE(_date BETWEEN '" + SalesDateStart.SelectedDate.Value.ToString("yyyy-MM-dd") + "' AND '" + SalesDateEnd.SelectedDate.Value.ToString("yyyy-MM-dd") + "')  GROUP BY itemName  ";

            DataSetReportPurchase.PurchaseTableDataTable dSPurchase = new DataSetReportPurchase.PurchaseTableDataTable();

            MySqlDataAdapter mySqlDa = new MySqlDataAdapter(cmd);

            mySqlDa.Fill(dSPurchase);

            return(dSPurchase);
        }
        private DataTable GetPurchaseYear()
        {
            var dbCon = DBConnection.Instance();

            dbCon.IsConnect();
            MySqlCommand cmd = new MySqlCommand();

            cmd.Connection  = dbCon.Connection;
            cmd.CommandType = CommandType.Text;
            string year = ((ComboBoxItem)ComboBoxYearSales.SelectedItem).Content.ToString();//same problem

            cmd.CommandText = "   SELECT        itemName, SUM(Total) AS Expr1 FROM po_report_view  WHERE(YEAR(_date) = '" + year + "')  GROUP BY itemName  ";

            DataSetReportPurchase.PurchaseTableDataTable dSPurchase = new DataSetReportPurchase.PurchaseTableDataTable();

            MySqlDataAdapter mySqlDa = new MySqlDataAdapter(cmd);

            mySqlDa.Fill(dSPurchase);

            return(dSPurchase);
        }
        private DataTable GetPurchase()
        {
            var dbCon = DBConnection.Instance();

            dbCon.IsConnect();
            MySqlCommand cmd = new MySqlCommand();

            cmd.Connection  = dbCon.Connection;
            cmd.CommandType = CommandType.Text;


            cmd.CommandText = " SELECT        itemName, SUM(Total) AS Expr1 FROM po_report_view GROUP BY itemName   ";

            DataSetReportPurchase.PurchaseTableDataTable dSPurchase = new DataSetReportPurchase.PurchaseTableDataTable();

            MySqlDataAdapter mySqlDa = new MySqlDataAdapter(cmd);

            mySqlDa.Fill(dSPurchase);

            return(dSPurchase);
        }
        private DataTable GetPurchaseMonth()
        {
            string month = ((ComboBoxItem)ComboBoxMonthSales.SelectedItem).Content.ToString();//same problem

            var dbCon = DBConnection.Instance();

            dbCon.IsConnect();
            MySqlCommand cmd = new MySqlCommand();

            cmd.Connection  = dbCon.Connection;
            cmd.CommandType = CommandType.Text;


            cmd.CommandText = "     SELECT        itemName, SUM(Total) AS Expr1 FROM po_report_view WHERE (MONTHNAME(_date) = '" + month + "') AND (YEAR(_date) = YEAR(CURDATE())) GROUP BY itemName ";

            DataSetReportPurchase.PurchaseTableDataTable dSPurchase = new DataSetReportPurchase.PurchaseTableDataTable();

            MySqlDataAdapter mySqlDa = new MySqlDataAdapter(cmd);

            mySqlDa.Fill(dSPurchase);

            return(dSPurchase);
        }