コード例 #1
0
        public override void Print()
        {
            if (objMaster.Current == null || objMaster.Current.Id == 0)
            {
                return;
            }
            long id = objMaster.Current.Id;


            frmDriverTransactionReport frm = new frmDriverTransactionReport(1);

            var list  = General.GetQueryable <vu_DriverRent>(a => a.Id == id).ToList();
            int count = list.Count;

            frm.DataSource = list;


            frm.GenerateReport();


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

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

            UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
コード例 #2
0
        public override void Print()
        {
            if (objMaster.Current == null || objMaster.Current.Id == 0)
            {
                return;
            }
            long id = objMaster.Current.Id;

            frmInvoiceReport frm = new frmInvoiceReport();


            var list  = General.GetQueryable <vu_Invoice>(a => a.Id == id).OrderBy(c => c.PickupDate).ToList();
            int count = list.Count;

            frm.DataSource = list;


            frm.GenerateReport();


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

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

            UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            //  MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
コード例 #3
0
        public override void Print()
        {
            try
            {
                if (objMaster.Current == null || objMaster.Current.Id == 0)
                {
                    return;
                }
                long id = objMaster.Current.Id;

                rptfrmCustomerInvoice frm = new rptfrmCustomerInvoice();


                var list  = General.GetQueryable <vu_Invoice>(a => a.Id == id).ToList();
                int count = list.Count;

                frm.DataSource = list;


                frm.GenerateReport();


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

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

                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
                //if (objMaster.Current == null || objMaster.Current.Id == 0) return;
                //long id = objMaster.Current.Id;

                //rptfrmPreCustomerInvoice frm = new rptfrmPreCustomerInvoice();


                //var list = General.GetQueryable<vu_Invoice>(a => a.Id == id).ToList();
                //int count = list.Count;

                //frm.DataSource = list;


                //frm.GenerateReport();


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

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

                //UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
                //  MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
コード例 #4
0
        void AddCommisionItems3_Click(object sender, EventArgs e)
        {
            try
            {
                if (grdLister.CurrentRow != null && grdLister.CurrentRow is GridViewDataRowInfo)
                {
                    int  id          = grdLister.CurrentRow.Cells["Id"].Value.ToInt();
                    long?lastTransId = 0;
                    using (TaxiDataContext db = new TaxiDataContext())
                    {
                        lastTransId = db.Fleet_DriverCommisions.Where(c => c.DriverId == id).Select(c => c.Id).OrderByDescending(c => c).FirstOrDefault();
                    }

                    if (lastTransId.ToLong() == 0)
                    {
                        MessageBox.Show("no record found");
                    }
                    else
                    {
                        frmDriverCommissionDebitCredit5 frm = new frmDriverCommissionDebitCredit5();
                        frm.OnDisplayRecord(lastTransId);
                        DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmDriverCommissionDebitCredit51");
                        if (doc != null)
                        {
                            doc.Close();
                        }
                        MainMenuForm.MainMenuFrm.ShowForm(frm);
                    }
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
コード例 #5
0
        public override void Print()
        {
            try
            {
                rptfrmVehicleListReportViewer frm = new rptfrmVehicleListReportViewer();

                //frm.ReportHeading = "Date Range : " + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", toDate);

                frm.DataSource = GetDataSource().ToList();

                frm.GenerateReport();

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

                if (doc != null)
                {
                    doc.Close();
                }
                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
コード例 #6
0
        public override void Print()
        {
            DateTime?fromDate = (dtpFromDate.Value.ToDate() + dtpFromTime.Value.Value.TimeOfDay).ToDateTime();
            DateTime?tillDate = (dtpTillDate.Value.ToDate() + dtptilltime.Value.Value.TimeOfDay).ToDateTime();

            string error = string.Empty;


            if (fromDate == null)
            {
                if (string.IsNullOrEmpty(error))
                {
                    error += Environment.NewLine;
                }

                error += "Required : From Date";
            }

            if (tillDate == null)
            {
                if (string.IsNullOrEmpty(error))
                {
                    error += Environment.NewLine;
                }

                error += "Required : To Date";
            }

            if (!string.IsNullOrEmpty(error))
            {
                ENUtils.ShowMessage(error);
                return;
            }


            int companyId    = ddlCompany.SelectedValue.ToInt();
            int driverId     = ddlDriver.SelectedValue.ToInt();
            int SubCompanyId = ddlSubCompany.SelectedValue.ToInt();

            long         FleetMasterId = ddlCompanyVehicle.SelectedValue.ToLong();
            rptfrmIncome frm           = new rptfrmIncome();



            frm.ReportHeading = "Income Report for Date Range :" + string.Format("{0:dd/MM/yyyy HH:mm}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy HH:mm}", tillDate);
            frm.DataSource    = GetDataSource(fromDate, tillDate, companyId, driverId, SubCompanyId, FleetMasterId);

            frm.GenerateReport();

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

            if (doc != null)
            {
                doc.Close();
            }
            UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
コード例 #7
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);
            }
        }
コード例 #8
0
        void btnPrint_Click(object sender, EventArgs e)
        {
            rptfrmDriverIncomeStatement frm = new rptfrmDriverIncomeStatement();
            DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("rptfrmDriverIncomeStatement1");

            if (doc != null)
            {
                doc.Close();
            }
            MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
        void btnPrint_Click(object sender, EventArgs e)
        {
            rptfrmDriverPaymentAccountBookings frm = new rptfrmDriverPaymentAccountBookings();
            DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("rptfrmDriverPaymentAccountBookings1");

            if (doc != null)
            {
                doc.Close();
            }
            MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
コード例 #10
0
        void AddCommisionItems1_Click(object sender, EventArgs e)
        {
            try
            {
                if (grdLister.CurrentRow != null && grdLister.CurrentRow is GridViewDataRowInfo)
                {
                    int        id  = grdLister.CurrentRow.Cells["Id"].Value.ToInt();
                    frmInvoice frm = new frmInvoice(id);



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

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

                    MainMenuForm.MainMenuFrm.ShowForm(frm);

                    //if (AppVars.listUserRights.Count(c => c.formName == "frmDriverCommision") > 0)
                    //{
                    //    frmDriverCommision frm = new frmDriverCommision(id);

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

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

                    //    MainMenuForm.MainMenuFrm.ShowForm(frm);
                    //}
                    //else
                    //{
                    //    frmDriverCommissionDebitCredit frm = new frmDriverCommissionDebitCredit(id);

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

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

                    //    MainMenuForm.MainMenuFrm.ShowForm(frm);
                    //}
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
コード例 #11
0
        void btnPrint_Click(object sender, EventArgs e)
        {
            DateTime?dtFrom = dtpFromDate.Value.ToDateorNull();
            DateTime?dtTill = dtpToDate.Value.ToDateorNull();


            if (dtFrom != null && dtpFromTime.Value != null && dtpFromTime.Value.Value != null)
            {
                dtFrom = (dtFrom.Value.ToDate() + dtpFromTime.Value.Value.TimeOfDay).ToDateTime();
            }



            if (dtTill != null && dtptilltime.Value != null && dtptilltime.Value.Value != null)
            {
                dtTill = (dtTill.Value.ToDate() + dtptilltime.Value.Value.TimeOfDay).ToDateTime();
            }
            string Error = string.Empty;

            if (dtFrom == null)
            {
                Error = "Required: From Date";
            }
            if (dtTill == null)
            {
                if (string.IsNullOrEmpty(Error))
                {
                    Error = "Required: To Date";
                }
                else
                {
                    Error += Environment.NewLine + "Required: To Date";
                }
            }
            if (!string.IsNullOrEmpty(Error))
            {
                ENUtils.ShowMessage(Error);
                return;
            }
            rptfrmDriverEarning frm = new rptfrmDriverEarning();

            frm.LoadReport();

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

            if (doc != null)
            {
                doc.Close();
            }
            UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            //LoadReport();
        }
コード例 #12
0
        private void ShowDriverCommissionDebitCredit(long Id)
        {
            frmDriverCommissionDebitCredit4 frm = new frmDriverCommissionDebitCredit4();

            frm.OnDisplayRecord(Id);
            DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmDriverCommissionDebitCredit41");

            if (doc != null)
            {
                doc.Close();
            }
            MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
コード例 #13
0
        public void ShowDriverRent(int Id)
        {
            frmDriverRentDebitCredit frm = new frmDriverRentDebitCredit();

            frm.OnDisplayRecord(Id);


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

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

            MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
コード例 #14
0
        public void ShowDriverCommission(int Id)
        {
            frmDriverCommision frm = new frmDriverCommision();

            frm.OnDisplayRecord(Id);


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

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

            MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
コード例 #15
0
        void ShowForm(long id)
        {
            frmCompanyVehcile frm = new frmCompanyVehcile();

            frm.OnDisplayRecord(id);


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

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

            frm.ShowDialog();
            frm.Dispose();
        }
コード例 #16
0
        public override void Print()
        {
            try
            {
                DateTime?fromDate = dtpFromDate.Value.ToDateorNull();
                DateTime?toDate   = dtpToDate.Value.ToDateorNull();

                if (fromDate != null && dtpFromTime.Value != null && dtpFromTime.Value.Value != null)
                {
                    fromDate = (fromDate.Value.ToDate() + dtpFromTime.Value.Value.TimeOfDay).ToDateTime();
                }

                if (toDate != null && dtptilltime.Value != null && dtptilltime.Value.Value != null)
                {
                    toDate = (toDate.Value.ToDate() + dtptilltime.Value.Value.TimeOfDay).ToDateTime();
                }

                rptfrmCustomerAppUsersReport frm = new rptfrmCustomerAppUsersReport();

                frm.ReportHeading = "Date Range : " + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", toDate);

                frm.DataSource = GetDataSource(fromDate, toDate);

                frm.GenerateReport();

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

                if (doc != null)
                {
                    doc.Close();
                }
                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
コード例 #17
0
        void ShowForm(long id)
        {
            //if (AppVars.listUserRights.Count(c => c.formName == "frmDriverRent") > 0)
            //{
            //    frmDriverRent frm = new frmDriverRent();
            //    frm.OnDisplayRecord(id);


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

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

            //    MainMenuForm.MainMenuFrm.ShowForm(frm);
            //}
            //else
            //{
            //frmDriverRentDebitCredit
            if (AppVars.listUserRights.Count(c => c.formName == "frmDriverRentDebitCredit") > 0)
            {
                frmDriverRentDebitCredit frm = new frmDriverRentDebitCredit();
                frm.OnDisplayRecord(id);


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

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

                MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            //}
        }
コード例 #18
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);
            }
        }
コード例 #19
0
 private void App_Startup(object sender, StartupEventArgs e)
 {
     try
     {
         CultureInfo cultureInfo = null;
         if (Thread.CurrentThread.CurrentCulture.Name == "zh-CN")
         {
             Setting.Language = "0";
             cultureInfo      = new CultureInfo("zh-Hans");
         }
         else
         {
             Setting.Language = "1";
             cultureInfo      = new CultureInfo("en-US");
         }
         Thread.CurrentThread.CurrentCulture   = cultureInfo;
         Thread.CurrentThread.CurrentUICulture = cultureInfo;
         MultiLanguage.Culture = cultureInfo;
         singleInstanceWatcher = new Semaphore(0, 1, Assembly.GetExecutingAssembly().GetName().Name, out createdNew);
         string text  = string.Empty;
         string empty = string.Empty;
         if (e.Args.Length > 0)
         {
             empty = e.Args[0].Substring(e.Args[0].LastIndexOf('.'));
             text  = ((empty.ToLower() == ".kfb") ? e.Args[0] : ((empty.ToLower() == ".case") ? e.Args[0].Substring(0, e.Args[0].Length - empty.Length) : ((!(empty.ToLower() == ".ano")) ? e.Args[0] : e.Args[0].Substring(0, e.Args[0].Length - empty.Length))));
         }
         if (createdNew)
         {
             DockWindow dockWindow = new DockWindow();
             if (e.Args.Length == 1)
             {
                 if (File.Exists(text))
                 {
                     if (Setting.IsMutiScreen == "1" && Screen.AllScreens.Length > 1)
                     {
                         dockWindow.WindowState = System.Windows.WindowState.Minimized;
                         Screen    screen      = Screen.AllScreens[Screen.AllScreens.Length - 1];
                         Rectangle workingArea = screen.WorkingArea;
                         dockWindow.Top  = workingArea.Y;
                         dockWindow.Left = workingArea.X;
                     }
                     dockWindow.Show();
                     dockWindow.Left   = 0.0;
                     dockWindow.Top    = 0.0;
                     dockWindow.Height = SystemParameters.WorkArea.Height;
                     dockWindow.Width  = SystemParameters.WorkArea.Width;
                     if (KCommon.CheckVersion(text))
                     {
                         Mainpage content = new Mainpage(text);
                         string   text2   = text.Substring(text.LastIndexOf("\\") + 1, text.Length - text.LastIndexOf("\\") - 1);
                         text2 = text2.Substring(0, text2.Length - 4);
                         BitmapImage kFBThumnail = KCommon.GetKFBThumnail(text);
                         if (kFBThumnail.StreamSource == null)
                         {
                             MessageWind messageWind = new MessageWind(MessageBoxButton.OK, System.Windows.Application.Current.MainWindow, dockWindow.languageSetter.LanguageResource["Filedamage"], dockWindow.languageSetter.LanguageResource["Prompt"], MessageBoxIcon.Exclamation, false);
                             messageWind.ShowDialog();
                             dockWindow.Close();
                         }
                         else
                         {
                             dockWindow.AddItem(text + DateTime.Now.ToString("yyyyMMddhhmmss"), text2, content, kFBThumnail);
                             dockWindow.imgs._evm.SearchViewModel.UIConfirmedParseName = text.Substring(0, text.LastIndexOf("\\"));
                         }
                     }
                 }
                 else
                 {
                     MessageWind messageWind2 = new MessageWind(MessageBoxButton.OK, System.Windows.Application.Current.MainWindow, "文件不存在!", dockWindow.languageSetter.LanguageResource["Prompt"], MessageBoxIcon.Exclamation, false);
                     messageWind2.ShowDialog();
                     dockWindow.Close();
                 }
             }
             else
             {
                 if (Setting.IsMutiScreen == "1" && Screen.AllScreens.Length > 1)
                 {
                     dockWindow.WindowState = System.Windows.WindowState.Minimized;
                     Screen    screen2      = Screen.AllScreens[Screen.AllScreens.Length - 1];
                     Rectangle workingArea2 = screen2.WorkingArea;
                     dockWindow.Top    = workingArea2.Y;
                     dockWindow.Left   = workingArea2.X;
                     dockWindow.Width  = workingArea2.Width;
                     dockWindow.Height = workingArea2.Height;
                 }
                 dockWindow.Show();
                 dockWindow.Left   = 0.0;
                 dockWindow.Top    = 0.0;
                 dockWindow.Height = SystemParameters.WorkArea.Height;
                 dockWindow.Width  = SystemParameters.WorkArea.Width;
                 dockWindow.imagelist.Show();
             }
         }
         else
         {
             Process   currentProcess  = Process.GetCurrentProcess();
             Process   proc            = null;
             Process[] processesByName = Process.GetProcessesByName(currentProcess.ProcessName);
             foreach (Process process in processesByName)
             {
                 if (process.Id != currentProcess.Id)
                 {
                     NativeMethods.ShowWindow(process.MainWindowHandle, WindowShowStyle.ShowNormal);
                     NativeMethods.SetForegroundWindow(process.MainWindowHandle);
                     proc = process;
                     break;
                 }
             }
             if (text.Length > 0)
             {
                 writetemp(text);
                 PostMessage(proc, text);
             }
             Environment.Exit(0);
         }
     }
     catch (Exception ex)
     {
         Xceed.Wpf.Toolkit.MessageBox.Show(ex.ToString());
     }
 }
コード例 #20
0
        public override void Print()
        {
            try
            {
                int?companyId = null;

                int?     driverId = ddl_Driver.SelectedValue.ToIntorNull();
                DateTime?fromDate = dtpFromDate.Value.ToDateTimeorNull();
                DateTime?tillDate = dtpTillDate.Value.ToDateTimeorNull();

                string error = string.Empty;

                if (driverId == null)
                {
                    error += "Required : Driver";
                }

                if (fromDate == null)
                {
                    if (string.IsNullOrEmpty(error))
                    {
                        error += Environment.NewLine;
                    }

                    error += "Required : From Date";
                }

                if (tillDate == null)
                {
                    if (string.IsNullOrEmpty(error))
                    {
                        error += Environment.NewLine;
                    }

                    error += "Required : To Date";
                }

                if (!string.IsNullOrEmpty(error))
                {
                    ENUtils.ShowMessage(error);
                    return;
                }

                int statementType = 0;

                //int creditCardAccountId = 0;

                //if (chkExcludeCC.Checked)
                //{
                //    creditCardAccountId = General.GetObject<Gen_Company>(c => c.CompanyName.ToUpper().Replace(" ", "").Trim() == "CREDITCARD").DefaultIfEmpty().Id;
                //}



                //if (optCreditCard.ToggleState == ToggleState.On)
                //{
                //    companyId = General.GetObject<Gen_Company>(c => c.CompanyName.ToLower() == "credit card" || c.CompanyName.ToLower() == "creditcard").DefaultIfEmpty().Id;


                //}



                rptfrmDriverStatement frm = new rptfrmDriverStatement();


                frm.objSubCompany = General.GetObject <Gen_SubCompany>(c => c.Id == ddlSubCompany.SelectedValue.ToInt());

                if (optAccount.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
                {
                    statementType = eStatementType.AccountStatement;
                }
                else if (optCash.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
                {
                    statementType = eStatementType.CashStatement;
                }

                else if (optBoth.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
                {
                    statementType = eStatementType.Both;
                }
                else if (optCreditCard.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
                {
                    statementType = eStatementType.CREDITCARD;
                }


                UM_Form_Template objTemplate = General.GetObject <UM_Form_Template>(c => c.UM_Form.FormName == "rptfrmDriverStatement" && c.IsDefault == true);


                if (objTemplate.TemplateName.ToStr() == "Template1" || objTemplate.TemplateName.ToStr() == "Template2")
                {
                    frm.DataSource = GetDataSource(driverId, statementType, fromDate, tillDate, companyId);
                }
                else if (objTemplate.TemplateName.ToStr() == "Template3")
                {
                    frm.DataSource2   = GetDataSource2(fromDate, tillDate, driverId, companyId, statementType);
                    frm.fromDate      = fromDate;
                    frm.tillDate      = tillDate;
                    frm.driverId      = driverId;
                    frm.companyId     = null;
                    frm.statementType = statementType;
                }



                frm.Rent = ChkRent.Checked == true?txtRent.Value.ToInt() : 0;


                frm.ObjDriver = General.GetObject <Fleet_Driver>(c => c.Id == driverId).DefaultIfEmpty();


                frm.DatePeriod    = "For the Period : " + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", tillDate);
                frm.StatementType = statementType;
                frm.GenerateReport();

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

                if (doc != null)
                {
                    doc.Close();
                }
                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
コード例 #21
0
        public override void Print()
        {
            try
            {
                DateTime?fromDate = dtpFromDate.Value.ToDateorNull();
                DateTime?toDate   = dtpToDate.Value.ToDateorNull();

                if (fromDate != null && dtpFromTime.Value != null && dtpFromTime.Value.Value != null)
                {
                    fromDate = (fromDate.Value.ToDate() + dtpFromTime.Value.Value.TimeOfDay).ToDateTime();
                }



                if (toDate != null && dtptilltime.Value != null && dtptilltime.Value.Value != null)
                {
                    toDate = (toDate.Value.ToDate() + dtptilltime.Value.Value.TimeOfDay).ToDateTime();
                }

                //var data1 = General.GetQueryable<Vu_BookingBase>(c => c.PaymentTypeId == Enums.PAYMENT_TYPES.CREDIT_CARD)
                //               .OrderByDescending(c => c.PickupDateTime );

                int    DriverId = ddlDrivers.SelectedValue.ToInt();
                bool   AuthCode = chkAuthCode.Checked;
                string Auth     = "";

                if (AuthCode)
                {
                    Auth = "auth";
                }
                //var data1 = General.GetQueryable<Vu_BookingBase>(c => c.PaymentTypeId == Enums.PAYMENT_TYPES.CREDIT_CARD )
                //                 .OrderByDescending(c => c.PickupDateTime);

                var data1 = General.GetQueryable <Vu_BookingBase>(c => (c.PaymentTypeId == Enums.PAYMENT_TYPES.CREDIT_CARD) &&
                                                                  (DriverId == 0 || c.DriverId == DriverId) && (Auth != "" ? (c.AuthCode != null && c.AuthCode != "") : (c.AuthCode == "" || c.AuthCode == null || c.AuthCode != "")))
                            .OrderByDescending(c => c.PickupDateTime);



                var list = (from a in data1

                            where


                            ((fromDate == null || a.PickupDateTime.Value.Date >= fromDate) && (toDate == null || a.PickupDateTime.Value.Date <= toDate))
                            select a).ToList();



                rptfrmJobPaymentViewer frm = new rptfrmJobPaymentViewer();


                frm.ReportHeading = "Date Range : " + string.Format("{0:dd/MM/yyyy HH:mm}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy HH:mm}", toDate);
                frm.DataSource    = list;

                frm.GenerateReport();

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

                if (doc != null)
                {
                    doc.Close();
                }
                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
コード例 #22
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                string FromPostCode = null;
                string ToPostCode   = null;
                int    FromLocId    = 0;
                int    ToLocId      = 0;
                int    FromZoneId   = 0;
                int    ToZoneId     = 0;
                if (rbtnPostCode.IsChecked == true)
                {
                    string PostCode = txtPostCode.Text.Trim();
                    if (string.IsNullOrEmpty(PostCode))
                    {
                        ENUtils.ShowMessage("Requierd : Post Code");
                        return;
                    }
                    if (rbtnPickup.IsChecked == true)
                    {
                        FromPostCode = PostCode;
                    }
                    else if (rbtnDestination.IsChecked == true)
                    {
                        ToPostCode = PostCode;
                    }
                    else
                    {
                        FromPostCode = PostCode;
                        ToPostCode   = PostCode;
                    }
                }
                else if (rbtnLocation.IsChecked == true)
                {
                    int LocationId = ddlLocation.SelectedValue.ToInt();
                    if (LocationId == 0)
                    {
                        ENUtils.ShowMessage("Requierd : Loaction Code");
                        return;
                    }
                    if (rbtnPickup.IsChecked == true)
                    {
                        FromLocId = LocationId;
                    }
                    else if (rbtnDestination.IsChecked == true)
                    {
                        ToLocId = LocationId;
                    }
                    else
                    {
                        ToLocId   = LocationId;
                        FromLocId = LocationId;
                    }
                }
                else
                {
                    int ZoneId = ddlArea.SelectedValue.ToInt();
                    if (ZoneId == 0)
                    {
                        ENUtils.ShowMessage("Requierd : Area Code");
                        return;
                    }
                    if (rbtnPickup.IsChecked == true)
                    {
                        FromZoneId = ZoneId;
                    }
                    else if (rbtnDestination.IsChecked == true)
                    {
                        ToZoneId = ZoneId;
                    }
                    else
                    {
                        FromZoneId = ZoneId;
                        ToZoneId   = ZoneId;
                    }
                }
                rptfrmJobStatisticsReport frm = new rptfrmJobStatisticsReport(FromPostCode, ToPostCode, FromLocId, ToLocId, FromZoneId, ToZoneId, fromDate.Value.ToDate(), tillDate.Value.ToDate());
                // frm.ReportHeading = "Date Range : " + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", toDate);
                //  frm.DataSource = GetDataSource(GetReportType(), ddlCompany.SelectedValue.ToInt(), fromDate, toDate, ddlAllDriver.SelectedValue.ToInt());

                //frm.GenerateReport();

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

                if (doc != null)
                {
                    doc.Close();
                }
                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
コード例 #23
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            try
            {
                string ReportType = "";
                string DateType   = "";
                int    Month      = 0;
                int    Year       = 0;

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

                if (rdoAccountVsCash.IsChecked == true)
                {
                    ReportType = "ACCOUNT_CASH";
                }
                else if (rdoTotalJobs.IsChecked == true)
                {
                    if (rdoWeekly.IsChecked == true)
                    {
                        ReportType = "WEEKLY_JOBS";
                    }
                    else if (rdoDaily.IsChecked == true)
                    {
                        ReportType = "DAILY_TOTAL_JOBS";
                    }
                    else if (rdoMonthly.IsChecked == true)
                    {
                        ReportType = "MONTHLY_BOOKINGS";
                    }
                }

                else if (rdoHourJobs.IsChecked == true)
                {
                    ReportType = "HOUR_JOBS";
                }
                else if (rdoTopDrivers.IsChecked == true)
                {
                    ReportType = "TOP_BOTTOM_DRIVERS";
                }
                else if (rdoYearlyReport.IsChecked == true)
                {
                    ReportType = "YEARLY_BOOKINGS";
                }
                else if (rdoTotalDespatch.IsChecked == true)
                {
                    ReportType = "TOTAL_DESPATCH";
                }
                else if (rdoTotalCallRecive.IsChecked == true)
                {
                    ReportType = "TOTAL_CALLRECIVE";
                }
                else if (rdoDriverRejectJobs.IsChecked == true)
                {
                    ReportType = "DRIVER_REJECT_BOOKING";
                }
                else if (rdoLateDespatchJob.IsChecked == true)
                {
                    ReportType = "LATE_BOOKING_DISPATCH";
                }
                else if (rdoDriverCompaints.IsChecked == true)
                {
                    ReportType = "COMPLAINT_DRIVERS";
                }
                else if (rdoOperatorCompaints.IsChecked == true)
                {
                    ReportType = "COMPLAINT_CONTROLLER";
                }
                else if (rdoAllOperatorTaken.IsChecked == true)
                {
                    ReportType = "TOTAL_TAKEN_All_OPERATOR";
                }
                else if (rdoAllOperatorDespatched.IsChecked == true)
                {
                    ReportType = "TOTAL_DESPATCH_All_OPERATOR";
                }
                else if (rdoDriverEarning.IsChecked == true)
                {
                    ReportType = "DRIVER_TOTAL_EARNING";
                }
                else if (rdoVehicleEarning.IsChecked == true)
                {
                    ReportType = "VEHICLE_EARNING";
                }
                else if (rdoFleetVehicleEarning.IsChecked == true)
                {
                    ReportType = "COMPANY_VEHICLE_EARNING";
                }
                else if (rdoDailyJobsTaken.IsChecked == true)
                {
                    ReportType = "DAILY_JOBS";

                    if (ddlUsers.SelectedValue == null)
                    {
                        ENUtils.ShowMessage("Operator Required");
                        return;
                    }
                }
                else if (rdoWeeklyJobsTaken.IsChecked == true)
                {
                    ReportType = "WEEKLY_JOBS_TAKEN";
                    if (ddlUsers.SelectedValue == null)
                    {
                        ENUtils.ShowMessage("Operator Required");
                        return;
                    }
                }
                else if (rdoMonthlyJobsTaken.IsChecked == true)
                {
                    ReportType = "MONTHLY_JOBS_TAKEN";
                    if (ddlUsers.SelectedValue == null)
                    {
                        ENUtils.ShowMessage("Operator Required");
                        return;
                    }
                }
                else if (rdoDriverRecoverJob.IsChecked == true)
                {
                    ReportType = "DRIVER_RECOVERED_BOOKING";
                }

                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 (rdoDateCriteria.IsChecked == true)
                {
                    DateType = "Datewise";
                }
                else if (rdoDaily.IsChecked == true)
                {
                    DateType = "DAILY";
                }



                if (rdoAll.Checked == true)
                {
                    DayName = "";
                }
                else if (rdoMon.Checked == true)
                {
                    DayName = "Monday";
                }
                else if (rdoTues.Checked == true)
                {
                    DayName = "Tuesday";
                }
                else if (rdoWed.Checked == true)
                {
                    DayName = "Wednesday";
                }
                else if (rdoThurs.Checked == true)
                {
                    DayName = "Thursday";
                }
                else if (rdoFri.Checked == true)
                {
                    DayName = "Friday";
                }
                else if (rdoSat.Checked == true)
                {
                    DayName = "Saturday";
                }
                else if (rdoSat.Checked == true)
                {
                    DayName = "Sunday";
                }



                frmGraphsReport frm = new frmGraphsReport(ddlUsers.SelectedValue.ToInt(), DayName, ReportType, DateType, Month, Year, From.ToString(), Till.ToString());

                if (frm._cond == true)
                {
                    DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmGraphsReport1");

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


                    MainMenuForm.MainMenuFrm.ShowForm(frm);
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #24
0
        public override void Print()
        {
            try
            {
                int driverId = ddl_Driver.SelectedValue.ToInt();



                if (dtpFromDate.Value != null && dtpFromDate.Value.Value.Year == 1753)
                {
                    dtpFromDate.Value = null;
                }

                if (dtpTillDate.Value != null && dtpTillDate.Value.Value.Year == 1753)
                {
                    dtpTillDate.Value = null;
                }

                DateTime?fromDate = string.Format("{0:dd/MM/yyyy HH:mm}", dtpFromDate.Value.ToDate() + dtpFromTime.Value.Value.TimeOfDay).ToDateTime();
                ;
                DateTime?tillDate = string.Format("{0:dd/MM/yyyy HH:mm}", dtpTillDate.Value.ToDate() + dtpTillTime.Value.Value.TimeOfDay).ToDateTime();



                string error = string.Empty;
                if (driverId == 0)
                {
                    error += "Required : Driver";
                }

                if (fromDate == null)
                {
                    if (string.IsNullOrEmpty(error))
                    {
                        error += Environment.NewLine;
                    }

                    error += "Required : From Date";
                }

                if (tillDate == null)
                {
                    if (string.IsNullOrEmpty(error))
                    {
                        error += Environment.NewLine;
                    }

                    error += "Required : To Date";
                }

                if (!string.IsNullOrEmpty(error))
                {
                    ENUtils.ShowMessage(error);
                    return;
                }



                rptfrmDriverJobLog frm = new rptfrmDriverJobLog();

                frm.DataSource = GetDataSource(driverId, fromDate, tillDate);



                frm.DatePeriod = "For the Period : " + string.Format("{0:dd/MM/yyyy HH:mm}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy HH:mm}", tillDate);
                //   frm.StatementType = statementType;
                frm.GenerateReport();

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

                if (doc != null)
                {
                    doc.Close();
                }
                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
            }
        }
コード例 #25
0
        public override void Print()
        {
            int      driverId = ddl_Driver.SelectedValue.ToInt();
            int      userId   = ddlController.SelectedValue.ToInt();
            string   userName = ddlController.Text.Trim();
            DateTime?fromDate = dtpFromDate.Value.ToDate();
            DateTime?tillDate = dtpTillDate.Value.ToDate();



            string error = string.Empty;


            if (fromDate == null)
            {
                if (string.IsNullOrEmpty(error))
                {
                    error += Environment.NewLine;
                }

                error += "Required : From Date";
            }

            if (tillDate == null)
            {
                if (string.IsNullOrEmpty(error))
                {
                    error += Environment.NewLine;
                }

                error += "Required : To Date";
            }

            if (!string.IsNullOrEmpty(error))
            {
                ENUtils.ShowMessage(error);
                return;
            }



            int reportType = eReportType.ALL;

            if (optReject.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
            {
                reportType = eReportType.REJECTED;
            }
            else if (optNotAcceped.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
            {
                reportType = eReportType.NOTACCEPTED;
            }
            else if (optRecover.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
            {
                reportType = eReportType.RECOVER;
            }



            rptfrmSinBinReport frm = new rptfrmSinBinReport();


            frm.DataSource = GetDataSource(driverId, reportType, fromDate, tillDate, userName);



            frm.Criteria = "For the Period : " + Environment.NewLine + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", tillDate);
            //    frm.StatementType = statementType;
            frm.GenerateReport();

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

            if (doc != null)
            {
                doc.Close();
            }
            UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
コード例 #26
0
        public override void Print()
        {
            try
            {
                int?     companyId = ddlCompany.SelectedValue.ToIntorNull();
                DateTime?fromDate  = dtpFromDate.Value.ToDate();
                DateTime?tillDate  = dtpTillDate.Value.ToDate();

                string error = string.Empty;

                if (companyId == null)
                {
                    error += "Required : Account";
                }

                if (fromDate == null)
                {
                    if (string.IsNullOrEmpty(error))
                    {
                        error += Environment.NewLine;
                    }

                    error += "Required : From Date";
                }

                if (tillDate == null)
                {
                    if (string.IsNullOrEmpty(error))
                    {
                        error += Environment.NewLine;
                    }

                    error += "Required : To Date";
                }

                if (!string.IsNullOrEmpty(error))
                {
                    ENUtils.ShowMessage(error);
                    return;
                }



                rptfrmCashAccStatement frm = new rptfrmCashAccStatement();

                frm.ReportType = this.reportType;
                frm.DataSource = GetDataSource(companyId, fromDate, tillDate);



                frm.DatePeriod = "For the Period : " + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", tillDate);
                //   frm.StatementType = statementType;
                frm.GenerateReport();

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

                if (doc != null)
                {
                    doc.Close();
                }
                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
            }
        }
コード例 #27
0
        public override void Print()
        {
            try
            {
                int?     driverId = ddl_Driver.SelectedValue.ToIntorNull();
                DateTime?fromDate = dtpFromDate.Value.ToDate();
                DateTime?tillDate = dtpTillDate.Value.ToDate();

                string error = string.Empty;



                if (fromDate == null)
                {
                    if (string.IsNullOrEmpty(error))
                    {
                        error += Environment.NewLine;
                    }

                    error += "Required : From Date";
                }

                if (tillDate == null)
                {
                    if (string.IsNullOrEmpty(error))
                    {
                        error += Environment.NewLine;
                    }

                    error += "Required : To Date";
                }

                if (!string.IsNullOrEmpty(error))
                {
                    ENUtils.ShowMessage(error);
                    return;
                }



                rptfrmDrvRentAccStatmentSummary frm = new rptfrmDrvRentAccStatmentSummary();



                frm.DataSource = GetDataSource(driverId, fromDate, tillDate);



                frm.DatePeriod = "For the Period : " + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", tillDate);
                frm.GenerateReport();

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

                if (doc != null)
                {
                    doc.Close();
                }
                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
コード例 #28
0
        private void btnEmail_Click(object sender, EventArgs e)
        {
            try
            {
                string error = string.Empty;


                var list = (from row in grdLister.Rows.Where(c => c.Cells["Check"].Value.ToBool() == true)
                            select new
                {
                    Id = row.Cells[COLS.Id].Value.ToInt(),
                    DriverName = row.Cells[COLS.FirstName].Value.ToStr(),
                    Surname = row.Cells[COLS.SurName].Value.ToStr(),
                    DriverNo = row.Cells[COLS.DriverNo].Value.ToStr(),
                    PHCBadge = row.Cells[COLS.PHCBadge].Value.ToStr(),
                    PHCExp = row.Cells[COLS.PHCExp].Value.ToDateorNull(),
                    Address = row.Cells[COLS.Address].Value.ToStr(),
                    MobileNo = row.Cells[COLS.MobileNo].Value.ToStr(),
                    LicenseNo = row.Cells[COLS.LicenceNo].Value.ToStr(),
                    LicenseExpiry = row.Cells[COLS.LicenceExp].Value.ToDateorNull(),
                    NI = row.Cells[COLS.NINo].Value.ToStr()
                }).ToList();



                rptfrmDriverListReportViewer frm = new rptfrmDriverListReportViewer();

                //frm.ReportHeading = "Date Range : " + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", toDate);

                //stp_GetDriversListReportResult
                List <stp_GetDriversListReportResult> obj = new List <stp_GetDriversListReportResult>();

                foreach (var item in list)
                {
                    obj.Add(new stp_GetDriversListReportResult
                    {
                        Id            = item.Id,
                        Address       = item.Address,
                        DriverName    = item.DriverName,
                        DriverNo      = item.DriverNo,
                        LicenseExpiry = item.LicenseExpiry,
                        LicenseNo     = item.LicenseNo,
                        MobileNo      = item.MobileNo,
                        NI            = item.NI,
                        PHCExp        = item.PHCExp,
                        PHCBadge      = item.PHCBadge
                    });
                }
                // frm.DataSource = //GetDataSource().ToList();


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

                if (doc != null)
                {
                    doc.Close();
                }
                frm.DataSource = obj;
                frm.GenerateReport();
                frm.SendEmail();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }