private void btnPick_Click(object sender, EventArgs e)
 {
     try
     {
         if (rdoAccount.IsChecked == true)
         {
             int CompanyId = 0;
             CompanyId = ddlAccount.SelectedValue.ToInt();
             if (CompanyId == 0)
             {
                 ENUtils.ShowMessage("Required : Account");
                 return;
             }
             frmSearchBooking frm = new frmSearchBooking(CompanyId, true);
             frm.ShowDialog();
         }
         else if (rdoDriver.IsChecked == true)
         {
             int DriverId = 0;
             DriverId = ddlDriver.SelectedValue.ToInt();
             if (DriverId == 0)
             {
                 ENUtils.ShowMessage("Required : Driver");
                 return;
             }
             frmSearchBooking frm = new frmSearchBooking(DriverId, true, true);
             frm.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         ENUtils.ShowMessage(ex.Message);
     }
 }
示例#2
0
        void btnLastBookings_Click(object sender, EventArgs e)
        {
            try
            {
                if (grdLister.CurrentRow != null && grdLister.CurrentRow is GridViewDataRowInfo)
                {
                    string MobileNo = grdLister.CurrentRow.Cells["Name"].Value.ToStr();

                    int a = MobileNo.IndexOf("(");
                    MobileNo = MobileNo.Substring(a, MobileNo.Length - a);


                    MobileNo = MobileNo.Replace("(", "");
                    MobileNo = MobileNo.Replace(")", "");
                    frmSearchBooking frm = new frmSearchBooking(MobileNo);
                    frm.ShowDialog();


                    //using (Taxi_Model.TaxiDataContext db = new Taxi_Model.TaxiDataContext())
                    //{
                    //    db.Messages.DeleteOnSubmit(db.Messages.FirstOrDefault(c => c.Id == Id));
                    //    db.SubmitChanges();


                    //}

                    //PopulateData();
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
        private void SearchBooking()
        {
            try
            {
                frmSearchBooking frm = new frmSearchBooking(txtCustomerName.Text, "", txtCustomerMobileNo.Text.Trim());

                frm.ShowDialog();

                if (frm.IsSelected)
                {
                    txtCustomerName.Text = frm.CustomerName;
                    string Pick        = frm.from;
                    string Destination = frm.to;
                    int?   jobId       = frm.JobId;
                    string pickupDate  = frm.pickUpdate;
                    string Refno       = frm.RefNo;
                    string Vechile     = frm.Vechile;


                    GridViewRowInfo row;

                    row = grdLister.Rows.AddNew();

                    row.Cells[COLS.BookingId].Value   = jobId;
                    row.Cells[COLS.PickupPoint].Value = Pick;
                    row.Cells[COLS.Destination].Value = Destination;
                    row.Cells[COLS.PickupDate].Value  = pickupDate;
                    row.Cells[COLS.RefNumber].Value   = Refno;
                    row.Cells[COLS.Vehicle].Value     = Vechile;

                    frm.Dispose();
                    return;
                }
            }
            catch (Exception ex)
            {
            }
        }