コード例 #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            {
                DieuHanhTaxi objDHTaxi = new DieuHanhTaxi();
                objDHTaxi.Line                = g_Line;
                objDHTaxi.PhoneNumber         = StringTools.TrimSpace(editPhoneNumber.Text);
                objDHTaxi.DiaChiDonKhach      = StringTools.TrimSpace(txtDiaChiDonKhach.Text);
                objDHTaxi.KieuKhachHangGoiDen = g_KieuKHGoi;
                objDHTaxi.MaDoiTac            = g_MaDoiTac;
                objDHTaxi.TrangThaiCuocGoi    = TrangThaiCuocGoiTaxi.TrangThaiKhac;
                //Luon luon la cuoc goi den
                objDHTaxi.TrangThaiLenh  = TrangThaiLenhTaxi.KhongTruyenDi;
                objDHTaxi.SoLuotDoChuong = 1;
                objDHTaxi.GPS_KinhDo     = txtDiaChiDonKhach.KinhDo;
                objDHTaxi.GPS_ViDo       = txtDiaChiDonKhach.ViDo;
                //Lap lai 5 lan neu khong chen duoc
                bool bInsertOK = false;
                int  iLan      = 0;

                while ((!bInsertOK) && (iLan < 5))
                {
                    bInsertOK = objDHTaxi.InsertCuocGoiLanDau_TongDai();
                    iLan++;
                    if (!bInsertOK)
                    {
                        Thread.Sleep(50);
                    }
                }
                if (!bInsertOK)
                {
                    return;
                }
                this.Close();
            }
        }