private void ExportReport(string exportTo)
 {
     try
     {
         if (objMaster.Current == null || objMaster.Current.Id == 0)
         {
             return;
         }
         long             id  = objMaster.Current.Id;
         frmInvoiceReport frm = new frmInvoiceReport();
         frm.ObjInvoice = objMaster.Current;
         var list  = General.GetQueryable <vu_Invoice>(a => a.Id == id).ToList();
         int count = list.Count;
         frm.DataSource = list;
         frm.GenerateReport();
         frm.ExportReport(objMaster.Current.InvoiceNo, "pdf");
     }
     catch (Exception ex)
     {
         ENUtils.ShowMessage(ex.Message);
     }
     //if (objMaster.Current == null || objMaster.Current.Id == 0) return;
     //long id = objMaster.Current.Id;
     //frmPreAccInvoiceReport frm = new frmPreAccInvoiceReport();
     //var list = General.GetQueryable<vu_Invoice>(a => a.Id == id).ToList();
     //int count = list.Count;
     //frm.DataSource = list;
     //frm.GenerateReport();
     //frm.ExportReport(objMaster.Current.InvoiceNo);
 }
        private void btnSendEmail_Click(object sender, EventArgs e)
        {
            try
            {
                if (objMaster.Current == null || objMaster.Current.Id == 0)
                {
                    return;
                }
                long id = objMaster.Current.Id;

                frmInvoiceReport frm = new frmInvoiceReport();
                frm.ObjInvoice = objMaster.Current;

                var list  = General.GetQueryable <vu_Invoice>(a => a.Id == id).ToList();
                int count = list.Count;
                frm.DataSource = list;
                frm.GenerateReport();
                frm.SendEmail(objMaster.Current.InvoiceNo, this.companyEmail);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
            //if (objMaster.Current == null || objMaster.Current.Id == 0) return;
            //long id = objMaster.Current.Id;
            //frmPreAccInvoiceReport frm = new frmPreAccInvoiceReport();
            //var list = General.GetQueryable<vu_Invoice>(a => a.Id == id).ToList();
            //int count = list.Count;
            //frm.DataSource = list;
            //frm.GenerateReport();
            //frm.SendEmail(objMaster.Current.InvoiceNo, this.companyEmail);
        }
예제 #3
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);
        }
        public override void Print()
        {
            //if (objMaster.Current == null || objMaster.Current.Id == 0) return;
            //long id = objMaster.Current.Id;
            //frmPreAccInvoiceReport frm = new frmPreAccInvoiceReport();
            //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("frmPreAccInvoiceReport1");
            //if (doc != null)
            //{
            //    doc.Close();
            //}
            //UI.MainMenuForm.MainMenuFrm.ShowForm(frm);

            try
            {
                if (objMaster.Current == null || objMaster.Current.Id == 0)
                {
                    return;
                }
                long             id  = objMaster.Current.Id;
                frmInvoiceReport frm = new frmInvoiceReport();
                frm.ObjInvoice = objMaster.Current;
                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("frmInvoiceReport1");
                if (doc != null)
                {
                    doc.Close();
                }
                UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
            //  MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
예제 #5
0
        private void btnSendEmail_Click(object sender, EventArgs e)
        {
            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();

            frm.SendEmail(objMaster.Current.InvoiceNo, this.companyEmail);
        }
예제 #6
0
        private void ExportReport(string exportTo)
        {
            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();

            frm.ExportReport(objMaster.Current.InvoiceNo, exportTo);
        }
예제 #7
0
        private void PrintStatement()
        {
            try
            {
                if (grdDriverRentLastStatement.Rows.Where(c => c.Cells["Check"].Value.ToBool() == true).Count() > 0)
                {
                    //foreach (var item in grdDriverRentLastStatement.Rows.Where(c => c.Cells["Check"].Value.ToBool() == true))
                    //{
                    //    long Id = item.Cells[COLS.Id].Value.ToLong();
                    //    ReportPrintDocument rpt = null;
                    //    frmDriverCommisionTransactionExpensesReport3 frm = null;
                    //    if (Id > 0)
                    //    {
                    //        frm = new frmDriverCommisionTransactionExpensesReport3(1);
                    //        var list = General.GetQueryable<vu_DriverCommisionExpenses2>(a => a.Id == Id).OrderBy(c => c.PickupDate).ToList();
                    //        int count = list.Count;

                    //        frm.DataSource = list;
                    //        var list2 = General.GetQueryable<vu_FleetDriverCommissionExpense>(c => c.CommissionId == Id).OrderBy(c => c.Date).ToList();
                    //        frm.DataSource2 = list2;

                    //        frm.IsFareAndWaitingWise = this.IsFareAndWaitingWiseComm;

                    //        frm.GenerateReport();
                    //        rpt = new ReportPrintDocument(frm.reportViewer1.LocalReport);
                    //        rpt.Print();
                    //        rpt.Dispose();
                    //    }
                    //}



                    var rows = grdDriverRentLastStatement.Rows.Where(c => c.Cells["Check"].Value.ToBool() == true).ToList();

                    var list = (from a in rows.Where(c => c.Cells[COLS.Id].Value.ToInt() > 0)
                                select new
                    {
                        Id = a.Cells[COLS.Id].Value.ToInt(),
                        CompanyId = a.Cells[COLS.DriverId].Value.ToInt(),
                        Driver = a.Cells[COLS.DriverNo].Value.ToStr()
                    }).ToList();

                    frmInvoiceReport    frm = new frmInvoiceReport();
                    ReportPrintDocument rpt = null;
                    foreach (var item in list)
                    {
                        if (item.Id > 0)
                        {
                            using (TaxiDataContext db = new TaxiDataContext())
                            {
                                var listInv = db.vu_Invoices.Where(a => a.Id == item.Id).OrderBy(c => c.PickupDate).ToList();

                                frm.DataSource = listInv;

                                var Invoice = db.Invoices.Where(c => c.Id == item.Id).FirstOrDefault();
                                frm.ObjInvoice = Invoice;

                                //var Inv=
                                //frm.ObjInvoice = listInv.;
                                frm.GenerateReport();
                                rpt = new ReportPrintDocument(frm.reportViewer1.LocalReport);
                                rpt.Print();
                                rpt.Dispose();
                            }
                        }
                    }


                    //if (list.Count > 0)
                    //{
                    //    frmDriverCommisionTransactionExpensesReport4 frm = new frmDriverCommisionTransactionExpensesReport4(list, DateTime.Now.ToDate(), DateTime.Now.ToDate());
                    //    frm.ShowDialog();
                    //    frm.Dispose();
                    //}
                }
                else
                {
                    ENUtils.ShowMessage("Please select statement to Print");
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }