Пример #1
0
        private void btnAllDrivers_Click(object sender, EventArgs e)
        {
            try
            {
                string DateType = "";
                int    Month    = 0;
                int    Year     = 0;

                DateTime?FromDate = dtpFromDate.Value.ToDateorNull();
                DateTime?TillDate = dtpTillDate.Value.ToDateorNull();
                TillDate = TillDate + TimeSpan.Parse("23:59:59");

                if (rdoWeekly.IsChecked == true)
                {
                    DateType = "CURRENT_WEEK";
                    if (chkLastWeek.Checked == true)
                    {
                        DateType = "LAST_WEEK";
                    }
                }
                else if (rdoMonthly.IsChecked == true)
                {
                    DateType = "MONTHLY";
                    Month    = ddlMonths.SelectedIndex.ToInt();
                    string yr = ddlYear.SelectedText == "" ? DateTime.Now.Year.ToStr() : ddlYear.SelectedText.ToStr();
                    Year = (yr).ToInt();
                }
                else if (rdoDaily.IsChecked == true)
                {
                    DateType = "DAILY";
                }

                if (rdoDateCriteria.IsChecked == true)
                {
                    frmMultiGraphsReports frm = new frmMultiGraphsReports(ddlUsers.SelectedValue.ToInt(), DayName, "DRIVERS", DateType, Month, Year, FromDate.ToDateTime(), TillDate.ToDateTime());


                    DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmMultiGraphsReports1");

                    if (doc != null)
                    {
                        doc.Close();
                    }


                    MainMenuForm.MainMenuFrm.ShowForm(frm);
                }
                else
                {
                    ENUtils.ShowMessage("Select Date Criteria from Multi Graphs");
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowErrorMessage(ex.Message);
            }
        }
Пример #2
0
        private void rdoGraphVehicles_Click(object sender, EventArgs e)
        {
            try
            {
                string DateType = "";
                int    Month    = 0;
                int    Year     = 0;

                DateTime?FromDate = dtpFromDate.Value.ToDateorNull();
                DateTime?TillDate = dtpTillDate.Value.ToDateorNull();
                TillDate = TillDate + TimeSpan.Parse("23:59:59");

                if (rdoDateCriteria.IsChecked == true)
                {
                    frmMultiGraphsReports frm = new frmMultiGraphsReports(ddlUsers.SelectedValue.ToInt(), DayName, "VEHICLE", DateType, Month, Year, FromDate.ToDateTime(), TillDate.ToDateTime());

                    DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmMultiGraphsReports1");

                    if (doc != null)
                    {
                        doc.Close();
                    }


                    MainMenuForm.MainMenuFrm.ShowForm(frm);
                }
                else
                {
                    ENUtils.ShowMessage("Select Date Criteria from Multi Graphs");
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowErrorMessage(ex.Message);
            }
        }