Esempio n. 1
0
        private bool CheckTemplate()
        {
            if (string.IsNullOrEmpty(this.TemplatePath))
            {
                ENUtils.ShowMessage("Report Template is not defined in User Rights");
            }


            return(this.TemplatePath != string.Empty);
        }
Esempio n. 2
0
 private void SendSMS()
 {
     try
     {
     }
     catch (Exception ex)
     {
         ENUtils.ShowMessage(ex.Message);
     }
 }
Esempio n. 3
0
        private void OnSave()
        {
            try
            {
                if (objMaster.PrimaryKeyValue == null)
                {
                    objMaster.New();
                }
                else
                {
                    objMaster.Edit();
                }


                objMaster.Current.InvoiceDate = dtpInvoiceDate.Value.ToDate();
                objMaster.Current.CustomerId  = ddlCustomer.SelectedValue.ToIntorNull();


                objMaster.Current.InvoiceTypeId = Enums.INVOICE_TYPE.PRE_INVOICE_CUSTOMER;

                objMaster.Current.InvoiceTotal = grdLister.Rows.Sum(c => c.Cells[COLS.Total].Value.ToDecimal());



                string[] skipProperties             = { "Invoice", "Booking" };
                IList <Invoice_Charge> savedList    = objMaster.Current.Invoice_Charges;
                List <Invoice_Charge>  listofDetail = (from r in grdLister.Rows

                                                       select new Invoice_Charge
                {
                    Id = r.Cells[COLS.ID].Value.ToLong(),
                    InvoiceId = r.Cells[COLS.InvoiceId].Value.ToLong(),
                    BookingId = r.Cells[COLS.BookingId].Value.ToLongorNull(),
                }).ToList();


                Utils.General.SyncChildCollection(ref savedList, ref listofDetail, "Id", skipProperties);

                objMaster.Save();

                objMaster.GetByPrimaryKey(objMaster.PrimaryKeyValue);
                DisplayRecord();
            }
            catch (Exception ex)
            {
                if (objMaster.Errors.Count > 0)
                {
                    ENUtils.ShowMessage(objMaster.ShowErrors());
                }
                else
                {
                    ENUtils.ShowMessage(ex.Message);
                }
            }
        }
        private void btnExportPDF_Click(object sender, EventArgs e)
        {
            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();
                frm.ExportReport();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
        public void LoadReport()
        {
            try
            {
                DateTime? dtFrom = dtpFromDate.Value.ToDateorNull();
                DateTime? dtTill = dtpTillDate.Value.ToDateorNull();
                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;
                }

                this.reportViewer1.LocalReport.EnableExternalImages = true;
                var list=(new Taxi_Model.TaxiDataContext().stp_GetDriverLoginHour(dtFrom,dtTill+ TimeSpan.Parse("23:59:59"))).ToList();
                var list2 = (list.AsEnumerable().OrderBy(item => item.DriverNo, new NaturalSortComparer<string>())).ToList();
                this.stp_GetDriverLoginHourResultBindingSource.DataSource = list2;

                Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[1];
                string heading = string.Empty;
                heading = "For the Period " + string.Format("{0:dd/MM/yyyy}", dtFrom) + " to " + string.Format("{0:dd/MM/yyyy}", dtTill);
                //heading = "From: "+string.Format("{0:dd/MM/yyyy}", dtFrom) + " To: " + string.Format("{0:dd/MM/yyyy}", dtTill);
               // string EndDate = string.Format("{0:dd/MM/yyyy}", DateTime.Now);
                //string To = string.Format("{0:dd/MM/yyyy}", dtTill);
                param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_LoginPeriod", heading);
                //List<ClsLogo> objLogo = new List<ClsLogo>();
                //objLogo.Add(new ClsLogo { ImageInBytes = AppVars.objSubCompany.CompanyLogo != null ? AppVars.objSubCompany.CompanyLogo.ToArray() : null });
                //ReportDataSource imageDataSource = new ReportDataSource("Taxi_AppMain_Classes_ClsLogo", objLogo);
                //this.reportViewer1.LocalReport.DataSources.Add(imageDataSource);
                reportViewer1.LocalReport.SetParameters(param);
                this.reportViewer1.ZoomPercent = 100;
                this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
                this.reportViewer1.RefreshReport();
                IsReportLoaded = true;
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
        private void OnSave()
        {
            try
            {
                long?jobId = null;
                if (grdLister.Rows.Count > 0)
                {
                    jobId = grdLister.Rows[0].Cells["BookingId"].Value.ToLongorNull();
                }

                if (objMaster.PrimaryKeyValue == null)
                {
                    objMaster.New();
                }
                else
                {
                    objMaster.Edit();
                }


                objMaster.Current.ReportedDate    = dtpLPDate.Value.ToDate();
                objMaster.Current.Remarks         = txtRemarks.Text.ToStr();
                objMaster.Current.CustomerName    = txtCustomerName.Text.ToStr();
                objMaster.Current.CustomerAddress = txtAddressDetail.Text.ToStr();
                objMaster.Current.CustomerPhoneNo = txtCustomerMobileNo.Text.ToStr();
                objMaster.Current.Complaint       = txtComplain.Text.ToStr();
                objMaster.Current.JobId           = jobId;
                //objMaster.Current.Status = ddlStatus.SelectedItem.Text;


                objMaster.Current.Disposition = txtDespostion.Text.ToStr();
                objMaster.Current.Result      = txtResult.Text.ToStr();
                objMaster.Current.CheckedBy   = txtCheckedby.Text.ToStr();
                objMaster.Current.LostDate    = dtpLostDate.Value.ToDate();



                objMaster.Save();

                objMaster.GetByPrimaryKey(objMaster.PrimaryKeyValue);
                DisplayRecord();
                General.RefreshListWithoutSelected <frmLostPropertyList>("frmLostPropertyList1");
            }
            catch (Exception ex)
            {
                if (objMaster.Errors.Count > 0)
                {
                    ENUtils.ShowMessage(objMaster.ShowErrors());
                }
                else
                {
                    ENUtils.ShowMessage(ex.Message);
                }
            }
        }
Esempio n. 7
0
        private void AddPayment()
        {
            try
            {
                decimal  Payment   = numPayment.Value.ToDecimal();
                decimal  Balance   = txtBalance.Value.ToDecimal();
                DateTime?dtPayment = dtpPaymentDate.Value.ToDateorNull();

                string error = string.Empty;

                if (Payment == 0)
                {
                    error += "Required : Payment";
                }
                if (dtPayment == null)
                {
                    if (string.IsNullOrEmpty(error))
                    {
                        error += "Required : Payment Date";
                    }
                    else
                    {
                        error += Environment.NewLine + "Required : Payment Date";
                    }
                }

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


                GridViewRowInfo row = null;
                row = grdPayment.Rows.AddNew();

                row.Cells[COL_PAYMENT.PAYMENT].Value = Payment;
                row.Cells[COL_PAYMENT.BALANCE].Value = Balance;
                row.Cells[COL_PAYMENT.DATE].Value    = dtPayment;
                row.Cells[COL_PAYMENT.AddBy].Value   = AppVars.LoginObj.UserName;

                row.Cells[COL_PAYMENT.AddOn].Value = DateTime.Now.ToDateTime();


                grdPayment.CurrentRow = null;

                Save();

                numPayment.Value = 0;
            }
            catch (Exception ex)
            {
            }
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (txtAccountCode.Text != "")
     {
         Check();
     }
     else
     {
         ENUtils.ShowMessage("Required: Company Code");
     }
 }
Esempio n. 9
0
        //public override void Save()
        //{
        //    try
        //    {
        //        if (objSMSBunches.PrimaryKeyValue == null)
        //        {
        //            objSMSBunches.New();
        //        }
        //        else
        //        {
        //            objSMSBunches.Edit();
        //        }

        //        objSMSBunches.Current.MessageTemplate = txtMessage.Text.ToStr().Trim();

        //        objSMSBunches.Current.MessageValue = spnBunchValue.Value.ToInt();

        //        objSMSBunches.Save();

        //    }
        //    catch (Exception ex)
        //    {
        //        if (objSMSBunches.Errors.Count > 0)
        //            ENUtils.ShowMessage(objSMSBunches.ShowErrors());
        //        else
        //        {
        //            ENUtils.ShowMessage(ex.Message);
        //        }
        //    }
        //}



        private void btnRecreateBunch_Click(object sender, EventArgs e)
        {
            try
            {
                SMSCustomerBunch(spnBunchValue.Value);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Esempio n. 10
0
 private void btnExit_Click(object sender, EventArgs e)
 {
     try
     {
         this.Close();
     }
     catch (Exception ex)
     {
         ENUtils.ShowMessage(ex.Message);
     }
 }
 private void ViewDetailForm()
 {
     if (grdLister.CurrentRow != null && grdLister.CurrentRow is GridViewDataRowInfo)
     {
         ShowDetailForm(grdLister.CurrentRow.Cells["Id"].Value.ToInt());
     }
     else
     {
         ENUtils.ShowMessage("Please select a record");
     }
 }
Esempio n. 12
0
 public override void RefreshData()
 {
     try
     {
         PopulateData();
     }
     catch (Exception ex)
     {
         ENUtils.ShowMessage(ex.Message);
     }
 }
 private void Save()
 {
     try
     {
         if (objDriverCommision.Current == null)
         {
             return;
         }
         string Description = txtReason.Text.ToStr().Trim();
         if (string.IsNullOrEmpty(Description))
         {
             ENUtils.ShowMessage("Required : Description");
             return;
         }
         objDriverCommision.Edit();
         objDriverCommision.Current.Balance = numCurrBalance.Value.ToDecimal();
         Fleet_DriverCommissionExpense objDriverCommissionExpense = new Fleet_DriverCommissionExpense();
         if (rdoCredit.IsChecked)
         {
             objDriverCommissionExpense.Credit = spnCommissionPay.Value.ToDecimal();
             objDriverCommissionExpense.Amount = spnCommissionPay.Value.ToDecimal();
         }
         else
         {
             objDriverCommissionExpense.Debit  = spnCommissionPay.Value.ToDecimal();
             objDriverCommissionExpense.Amount = spnCommissionPay.Value.ToDecimal();
         }
         objDriverCommissionExpense.Date        = DateTime.Now;
         objDriverCommissionExpense.Description = Description;
         objDriverCommissionExpense.IsPaid      = true;
         if (objDriverCommision.Current.Fleet_DriverCommissionExpenses.Count == 0)
         {
             objDriverCommision.Current.Fleet_DriverCommissionExpenses.Add(objDriverCommissionExpense);
         }
         else
         {
             objDriverCommision.Current.Fleet_DriverCommissionExpenses.Add(objDriverCommissionExpense);
         }
         objDriverCommision.Save();
         DisplayRecord();
         //this.Close();
     }
     catch (Exception ex)
     {
         if (objDriverCommision.Errors.Count > 0)
         {
             ENUtils.ShowMessage(objDriverCommision.ShowErrors());
         }
         else
         {
             ENUtils.ShowMessage(ex.Message);
         }
     }
 }
Esempio n. 14
0
        public void LoadReport()
        {
            try
            {
                this.reportViewer1.LocalReport.EnableExternalImages = true;
                Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[3];
                this.stp_GetLostPropertyResultBindingSource.DataSource = GetData(LostId);



                string Name    = AppVars.objSubCompany.CompanyName;
                string PhoneNo = "Phone No: " + AppVars.objSubCompany.TelephoneNo;
                string address = AppVars.objSubCompany.Address;
                //string telNo = "Tel No. " + AppVars.objSubCompany.TelephoneNo;
                //string heading = string.Empty;
                //if (dtFrom != null && dtTill != null)
                //{
                //heading = string.Format("{0:dd/MM/yy}", dtFrom) + " to " + string.Format("{0:dd/MM/yy}", dtTill);
                // }


                param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_CompanyName", Name);
                param[1] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_CompanyAddress", address);
                param[2] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_CompanyPhoneNo", PhoneNo);
                // string address = AppVars.objSubCompany.Address;
                // string telNo = "Tel No. " + AppVars.objSubCompany.TelephoneNo;
                string heading = string.Empty;
                //if (dtFrom != null && dtTill != null)
                //{
                //heading = string.Format("{0:dd/MM/yy}", dtFrom) + " to " + string.Format("{0:dd/MM/yy}", dtTill);
                // }


                //  param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_Period", heading);

                List <ClsLogo> objLogo = new List <ClsLogo>();
                objLogo.Add(new ClsLogo {
                    ImageInBytes = AppVars.objSubCompany.CompanyLogo != null ? AppVars.objSubCompany.CompanyLogo.ToArray() : null
                });
                ReportDataSource imageDataSource = new ReportDataSource("Taxi_AppMain_Classes_ClsLogo", objLogo);
                this.reportViewer1.LocalReport.DataSources.Add(imageDataSource);
                reportViewer1.LocalReport.SetParameters(param);



                this.reportViewer1.ZoomPercent = 100;
                this.reportViewer1.ZoomMode    = Microsoft.Reporting.WinForms.ZoomMode.Percent;
                this.reportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
 void btnEmail_Click(object sender, EventArgs e)
 {
     try
     {
         SendEmail();
     }
     catch (Exception ex)
     {
         ENUtils.ShowMessage(ex.Message);
     }
 }
 private void ViewDetailForm()
 {
     if (grdLister.CurrentRow != null && grdLister.CurrentRow is GridViewDataRowInfo)
     {
         General.ShowPreCustomerInvoiceForm(grdLister.CurrentRow.Cells["Id"].Value.ToLong());
     }
     else
     {
         ENUtils.ShowMessage("Please select a record");
     }
 }
 private void btnViewReport_Click(object sender, EventArgs e)
 {
     try
     {
         ViewReport();
     }
     catch (Exception ex)
     {
         ENUtils.ShowErrorMessage(ex.Message);
     }
 }
 private void btnCalculateFare_Click(object sender, EventArgs e)
 {
     try
     {
         CalculateFares();
     }
     catch (Exception ex)
     {
         ENUtils.ShowMessage(ex.Message);
     }
 }
Esempio n. 19
0
 private void ViewDetailForm(GridViewRowInfo row)
 {
     if (row != null && row is GridViewDataRowInfo)
     {
         General.ShowBookingForm(row.Cells[COLS.ID].Value.ToInt(), true, "", "", Enums.BOOKING_TYPES.LOCAL);
     }
     else
     {
         ENUtils.ShowMessage("Please select a record");
     }
 }
 private void btnPickCustomerAddress_Click(object sender, EventArgs e)
 {
     if (grdLister.Rows.Count == 0)
     {
         PickCustomerAddress(txtCustomerMobileNo.Text.Trim());
     }
     else
     {
         ENUtils.ShowMessage("Booking Already In a List.");
     }
 }
        private void TransferJob()
        {
            try
            {
                int ThirdPartyCompanyId = ddlThirdPartyCompany.SelectedValue.ToInt();
                if (ThirdPartyCompanyId == 0)
                {
                    ENUtils.ShowMessage("Required : Company to transfer job");
                    return;
                }


                string subCompanyName = ddlThirdPartyCompany.Text.Trim();



                using (TaxiDataContext db = new TaxiDataContext())
                {
                    Booking obj = db.Bookings.FirstOrDefault(c => c.Id == JobId);


                    if (obj != null)
                    {
                        string OldSubCompanyName = this.objBooking.Gen_SubCompany.DefaultIfEmpty().CompanyName.ToStr();

                        obj.SubcompanyId = ThirdPartyCompanyId;

                        obj.Booking_Logs.Add(new Booking_Log
                        {
                            User          = AppVars.LoginObj.UserName.ToStr(),
                            BeforeUpdate  = "Transfer From : " + OldSubCompanyName
                            , AfterUpdate = "Transfer To : " + subCompanyName, BookingId = JobId, UpdateDate = DateTime.Now
                        });
                        db.SubmitChanges();
                    }
                }

                new BroadcasterData().BroadCastToAll(RefreshTypes.REFRESH_BOOKING_DASHBOARD);

                if (Application.OpenForms.OfType <Form>().Count(c => c.Name == "frmBookingsList") > 0)
                {
                    (Application.OpenForms.OfType <Form>().FirstOrDefault(c => c.Name == "frmBookingsList") as frmBookingsList).SetRefreshWhenActive("");
                }

                this.Close();

                //}
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
        void frmCompanyInvoiceList_Shown(object sender, EventArgs e)
        {
            try
            {
                grdLister.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;



                this.InitializeForm("frmEscortInvoice");
                LoadInvoiceList();

                grdLister.AddEditColumn();

                if (this.CanDelete)
                {
                    grdLister.AddDeleteColumn();
                    grdLister.Columns["btnDelete"].Width = 70;
                }


                grdLister.Columns["Id"].IsVisible = false;

                grdLister.Columns["InvoiceNo"].HeaderText = "Invoice No";
                grdLister.Columns["InvoiceNo"].Width      = 80;

                grdLister.Columns["InvoiceDate"].HeaderText = "Invoice Date";
                grdLister.Columns["InvoiceDate"].Width      = 100;

                (grdLister.Columns["InvoiceDate"] as GridViewDateTimeColumn).CustomFormat = "dd/MM/yyyy";
                (grdLister.Columns["InvoiceDate"] as GridViewDateTimeColumn).FormatString = "{0:dd/MM/yyyy}";

                grdLister.Columns["Escort"].Width  = 150;
                grdLister.Columns["Address"].Width = 240;


                grdLister.Columns["Telephone"].Width = 100;

                grdLister.Columns["Email"].Width = 110;


                grdLister.Columns["InvoiceTotal"].Width      = 100;
                grdLister.Columns["InvoiceTotal"].HeaderText = "Invoice Total";

                grdLister.Columns["btnEdit"].Width = 70;


                UI.GridFunctions.SetFilter(grdLister);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Esempio n. 23
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);
            }
        }
Esempio n. 24
0
        private void LoadListGrid()
        {
            try
            {
                using (TaxiDataContext db = new TaxiDataContext())
                {
                    var list = db.Fleet_Drivers.Where(c => c.IsActive == true).Select(args => new
                    {
                        args.Id,
                        args.DriverNo,
                        args.DriverName,
                        args.Fleet_VehicleType.VehicleType
                    }
                                                                                      ).ToList()
                               .OrderBy(c => c.DriverNo, new NaturalSortComparer <string>()).ToList();
                    //    var list = General.GetQueryable<Gen_Attribute>(null).OrderBy(c => c.Name).ToList();

                    grdAttributesList.RowCount = list.Count;
                    for (int i = 0; i < list.Count; i++)
                    {
                        grdAttributesList.Rows[i].Cells[Col_BookingAttributesList.Id].Value = list[i].Id;
                        //    grdAttributesList.Rows[i].Cells[Col_BookingAttributesList.Default].Value = list[i].IsDefault;
                        grdAttributesList.Rows[i].Cells[Col_BookingAttributesList.Name].Value      = list[i].DriverNo + " - " + list[i].DriverName + " [" + list[i].VehicleType + "]";
                        grdAttributesList.Rows[i].Cells[Col_BookingAttributesList.ShortName].Value = list[i].DriverNo;
                    }
                }
                //S,BC,SALO
                string[] ValuesArr = input_Ids.ToStr().Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var item in ValuesArr)
                {
                    foreach (DataGridViewRow row in grdAttributesList.Rows)
                    {
                        if (row.Cells[Col_BookingAttributesList.Id].Value.ToStr() == item.Trim())
                        {
                            row.Cells[Col_BookingAttributesList.Default].Value = true;
                        }
                    }

                    //var aRow = grdAttributesList.Rows.FirstOrDefault(c => c.Cells[Col_BookingAttributesList.ShortName].Value.ToStr().ToLower().Trim() == item.ToLower().Trim());

                    //if (aRow != null)
                    //{
                    //    aRow.Cells[Col_BookingAttributesList.Default].Value = true;
                    //}
                }

                input_values = string.Join(",", grdAttributesList.Rows.Cast <DataGridViewRow>().Where(r => r.Cells[Col_BookingAttributesList.Default].Value.ToBool() == true).Select(c => c.Cells[Col_BookingAttributesList.ShortName].Value.ToStr()).ToArray <string>());
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Esempio n. 25
0
        void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                string Error    = string.Empty;
                string MobileNo = txtMobileNo.Text.ToStr().Trim();
                string Email    = txtEmail.Text.ToStr().Trim();
                string Link     = txtLink.Text.ToStr().Trim();
                if (ddlApplicationType.SelectedIndex < 0)
                {
                    Error = "Please select Application Type";
                }
                if (chkSMS.Checked.ToBool() && string.IsNullOrEmpty(MobileNo))
                {
                    Error = "Required : Mobile No";
                }

                if (chkEmail.Checked.ToBool() && string.IsNullOrEmpty(Email))
                {
                    Error = "Required : Email";
                }

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

                bool IsSent = false;

                if (chkSMS.Checked.ToBool() && !string.IsNullOrEmpty(MobileNo))
                {
                    SendSMS(MobileNo, Link);
                    IsSent = true;
                }


                if (chkEmail.Checked.ToBool() && !string.IsNullOrEmpty(Email))
                {
                    SendEmail(txtEmail.Text);
                    IsSent = true;
                }

                if (IsSent)
                {
                    SendNotification();
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
        void frmUnProcessedJobsList_Shown(object sender, EventArgs e)
        {
            if (AppVars.objPolicyConfiguration.RentFromDateTime == null || AppVars.objPolicyConfiguration.RentToDateTime == null)
            {
                ENUtils.ShowMessage("Driver Rent From and Till Date is not defined in settings.");
                this.Close();
            }



            LoadFormSettings();
        }
Esempio n. 27
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 FleetMasterId             = ddlCompanyVehicle.SelectedValue.ToInt();
            rptfrmIncomeSummaryReport frm = new rptfrmIncomeSummaryReport();

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

            frm.LoadReport();

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

            if (doc != null)
            {
                doc.Close();
            }
            UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
        void btnEmail_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime?fromDate = dtpFromDate.Value.ToDate();
                DateTime?tillDate = dtpTillDate.Value.ToDate();
                if (fromDate > tillDate)
                {
                    ENUtils.ShowMessage("From Date can't greater then Till Date");
                    return;
                }
                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;
                }
                TimeSpan tillTime = TimeSpan.Zero;
                TimeSpan.TryParse("23:59:59", out tillTime);

                tillDate = tillDate + tillTime;

                DataSource = GetData(fromDate, tillDate);

                SendEmail();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Esempio n. 29
0
        //  delegate void UIDelegate(List<Fare_CustomJourney> list);


        private void SetDisplayRecords()
        {
            try
            {
                var list = (from obj in General.GetQueryable <Fare_CustomJourney>(c => c.Id != null)
                            select new
                {
                    Id = obj.Id,
                    DriverFares = obj.DriverFares,
                    DriverRtnFares = obj.DriverRtnFares,
                    CustomerFares = obj.CustomerFares,
                    CustomerRtnFares = obj.CustomerRtnFares,
                    CompanyId = obj.CompanyId,
                    CompanyFares = obj.CompanyFares,
                    CompanyRtnFares = obj.CompanyRtnFares,
                    Pickup = obj.Pickup,
                    Destination = obj.Destination,
                    ViaPoints = obj.ViaPoints,
                    EscortFares = obj.EscortFares,
                    EscortRtnFares = obj.EscortRtnFares,
                    DriverId = obj.DriverId,
                    EscortId = obj.EscortId,
                    CompanyName = obj.Gen_Company.CompanyName
                }).ToList();

                int Count = list.Count;
                grdFares.Rows.Clear();
                grdFares.RowCount = Count;
                for (int i = 0; i < grdFares.RowCount; i++)
                {
                    grdFares.Rows[i].Cells[COLS.Id].Value          = list[i].Id;
                    grdFares.Rows[i].Cells[COLS.RowNo].Value       = 0;
                    grdFares.Rows[i].Cells[COLS.Pickup].Value      = list[i].Pickup;
                    grdFares.Rows[i].Cells[COLS.Destination].Value = list[i].Destination;
                    grdFares.Rows[i].Cells[COLS.ViaPoints].Value   = list[i].ViaPoints;

                    grdFares.Rows[i].Cells[COLS.DriverFares].Value      = list[i].DriverFares;
                    grdFares.Rows[i].Cells[COLS.DriverRtnFares].Value   = list[i].DriverRtnFares;
                    grdFares.Rows[i].Cells[COLS.CustomerFares].Value    = list[i].CustomerFares;
                    grdFares.Rows[i].Cells[COLS.CustomerRtnFares].Value = list[i].CustomerRtnFares;

                    grdFares.Rows[i].Cells[COLS.CompanyFares].Value    = list[i].CompanyFares;
                    grdFares.Rows[i].Cells[COLS.CompanyRtnFares].Value = list[i].CompanyRtnFares;

                    grdFares.Rows[i].Cells[COLS.CompanyName].Value = list[i].CompanyName;
                }
            }

            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
        public override void Save()
        {
            try
            {
                //if (chkBlackList.Checked == true && txtResion.Text == "")
                //{
                //    ENUtils.ShowMessage("Requried: Resion");
                //}

                if (objMaster.PrimaryKeyValue == null)
                {
                    objMaster.New();
                }
                else
                {
                    objMaster.Edit();
                }



                objMaster.Current.Name        = txtName.Text.Trim();
                objMaster.Current.Email       = txtEmail.Text.Trim();
                objMaster.Current.TelephoneNo = txtTelephoneNo.Text.Trim();
                objMaster.Current.MobileNo    = txtMobileNo.Text.Trim();
                objMaster.Current.Address1    = txtAddress1.Text.Trim();
                objMaster.Current.Address2    = txtAddress2.Text.Trim();
                objMaster.Current.DoorNo      = txtDoorNo.Text.Trim();

                objMaster.Current.AccountNo       = chkDisableIVR.Checked ? "1" : "0";
                objMaster.Current.BlackList       = chkBlackList.Checked.ToBool();
                objMaster.Current.BlackListResion = txtResion.Text.ToString();
                objMaster.Current.TotalCalls      = txtTotalCalls.Value.ToInt();


                //    objMaster.Current.CreditCardDetails = txtCreditCard.Text.Trim();
                objMaster.Current.LikesAndDislikes = txtNotes.Text.Trim();
                objMaster.Save();

                //      General.RefreshListWithoutSelected<frmCustomersList>("frmCustomersList1");
                // General.RefreshListWithoutSelected<frmBlackCustomersList>("frmBlackCustomersList1");
            }
            catch (Exception ex)
            {
                if (objMaster.Errors.Count > 0)
                {
                    ENUtils.ShowMessage(objMaster.ShowErrors());
                }
                else
                {
                    ENUtils.ShowMessage(ex.Message);
                }
            }
        }