Exemplo n.º 1
0
        public string sumextension()
        {
            string             sum  = "";
            Validate_Statistic vali = new Validate_Statistic();

            if (vali.Requiredcbo(cboday, 1, 31) == false)
            {
                sum += "\n Choose valid day";
            }
            if (vali.Requiredcbo(cbomonth, 1, 12) == false)
            {
                sum += "\n Choose valid month";
            }
            if (vali.Requiredcbo(cboyear, 2010, 2020) == false)
            {
                sum += "\n Choose valid year";
            }
            if (vali.Rangetextcbo(cbofill, "All", "Top 5", "Top 10", "Top 20") == false)
            {
                sum += "\n Choose valid filter";
            }
            return(sum);
        }
Exemplo n.º 2
0
        public bool loaddata()
        {
            bool flag = false;

            if (rbdate.Checked == true)
            {
                string aaa = sumextension();
                if (aaa == "")
                {
                    if (cbofill.Text == "All")
                    {
                        int ngay  = 0;
                        int thang = 0;
                        int nam   = 0;
                        if (cboday.Text != "All")
                        {
                            ngay = int.Parse(cboday.Text);
                        }
                        if (cbomonth.Text != "All")
                        {
                            thang = int.Parse(cbomonth.Text);
                        }
                        if (cboyear.Text != "All")
                        {
                            nam = int.Parse(cboyear.Text);
                        }
                        showinformationdate(ngay, thang, nam);
                        flag = true;
                    }
                    if (cbofill.Text == "Top 5")
                    {
                        int ngay  = 0;
                        int thang = 0;
                        int nam   = 0;
                        if (cboday.Text != "All")
                        {
                            ngay = int.Parse(cboday.Text);
                        }
                        if (cbomonth.Text != "All")
                        {
                            thang = int.Parse(cbomonth.Text);
                        }
                        if (cboyear.Text != "All")
                        {
                            nam = int.Parse(cboyear.Text);
                        }
                        showinformationdatetop5(ngay, thang, nam);
                        flag = true;
                    }
                    if (cbofill.Text == "Top 10")
                    {
                        int ngay  = 0;
                        int thang = 0;
                        int nam   = 0;
                        if (cboday.Text != "All")
                        {
                            ngay = int.Parse(cboday.Text);
                        }
                        if (cbomonth.Text != "All")
                        {
                            thang = int.Parse(cbomonth.Text);
                        }
                        if (cboyear.Text != "All")
                        {
                            nam = int.Parse(cboyear.Text);
                        }
                        showinformationdatetop10(ngay, thang, nam);
                        flag = true;
                    }
                    if (cbofill.Text == "Top 20")
                    {
                        int ngay  = 0;
                        int thang = 0;
                        int nam   = 0;
                        if (cboday.Text != "All")
                        {
                            ngay = int.Parse(cboday.Text);
                        }
                        if (cbomonth.Text != "All")
                        {
                            thang = int.Parse(cbomonth.Text);
                        }
                        if (cboyear.Text != "All")
                        {
                            nam = int.Parse(cboyear.Text);
                        }
                        showinformationdatetop20(ngay, thang, nam);
                        flag = true;
                    }
                }
                else
                {
                    MessageBox.Show(aaa);
                    flag = false;
                }
            }


            if (rbdistance.Checked == true)
            {
                Validate_Statistic vali = new Validate_Statistic();
                if (vali.Rangetextcbo(cbofill, "All", "Top 5", "Top 10", "Top 20") == true)
                {
                    if (cbofill.Text == "All")
                    {
                        showinformationdistance((DateTime)dtfrom.Value, (DateTime)dtto.Value);
                        flag = true;
                    }

                    if (cbofill.Text == "Top 5")
                    {
                        showinformationdistancetop5((DateTime)dtfrom.Value, (DateTime)dtto.Value);
                        flag = true;
                    }

                    if (cbofill.Text == "Top 10")
                    {
                        showinformationdistancetop10((DateTime)dtfrom.Value, (DateTime)dtto.Value);
                        flag = true;
                    }

                    if (cbofill.Text == "Top 20")
                    {
                        showinformationdistancetop20((DateTime)dtfrom.Value, (DateTime)dtto.Value);
                        flag = true;
                    }
                }
                else
                {
                    MessageBox.Show("Choose valid filter");
                    flag = false;
                }
            }
            return(flag);
        }