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);
        }
        private void EmailInvoices()
        {
            try
            {
                string subject = txtSubject.Text.Trim();

                if (string.IsNullOrEmpty(subject))
                {
                    ENUtils.ShowMessage("Required : Email Subject");
                    return;
                }

                var rows = grdDriverRent.Rows.Where(c => c.Cells[COLS.RentId].Value.ToLong() > 0).ToList();



                List <long> invoiceIds = rows.Select(c => c.Cells[COLS.RentId].Value.ToLong()).ToList <long>();

                if (invoiceIds.Count > 0)
                {
                    frmDriverTransactionReport frm = new frmDriverTransactionReport(1);

                    var list = General.GetQueryable <vu_DriverRent>(a => invoiceIds.Contains(a.Id)).ToList();

                    frm.CompanyHeader = ddlSubCompany.Text.Trim();

                    List <Fleet_Driver> driversList = General.GetGeneralList <Fleet_Driver>(c => c.DriverTypeId == 1);

                    frmEmail frmEmail = new frmEmail(null, "", "");


                    foreach (var item in rows)
                    {
                        frm.DataSource = list.Where(c => c.Id == item.Cells[COLS.RentId].Value.ToLong()).OrderBy(c => c.PickupDate).ToList();


                        frm.GenerateReport();



                        string email = driversList.FirstOrDefault(c => c.Id == item.Cells[COLS.Id].Value.ToInt()).DefaultIfEmpty().Email.ToStr().Trim();



                        if (!string.IsNullOrEmpty(email))
                        {
                            frm.SendEmailInternally(frmEmail, subject, item.Cells[COLS.DriverNo].Value.ToStr().Trim(), email);
                        }
                    }



                    ENUtils.ShowMessage("Email has been sent successfully");
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
        private void PrintDocument()
        {
            try
            {
                try
                {
                    var rows = grdDriverRent.Rows.Where(c => c.Cells[COLS.RentId].Value.ToLong() > 0).ToList();



                    List <long> invoiceIds = rows.Select(c => c.Cells[COLS.RentId].Value.ToLong()).ToList <long>();

                    if (invoiceIds.Count > 0)
                    {
                        frmDriverTransactionReport frm = new frmDriverTransactionReport(1);

                        frm.CompanyHeader = ddlSubCompany.Text.Trim();

                        var list = General.GetQueryable <vu_DriverRent>(a => invoiceIds.Contains(a.Id)).ToList();


                        List <Fleet_Driver> driversList = General.GetGeneralList <Fleet_Driver>(c => c.DriverTypeId == 1);

                        frmEmail frmEmail = new frmEmail(null, "", "");


                        foreach (var item in rows)
                        {
                            frm.DataSource = list.Where(c => c.Id == item.Cells[COLS.RentId].Value.ToLong()).OrderBy(c => c.PickupDate).ToList();


                            frm.GenerateReport();

                            ReportPrintDocument rpt = new ReportPrintDocument(frm.reportViewer1.LocalReport);
                            rpt.Print();
                            rpt.Dispose();
                        }
                    }
                }
                catch (Exception ex)
                {
                    ENUtils.ShowMessage(ex.Message);
                }
            }
            catch (Exception ex)
            {
            }
        }