Esempio n. 1
0
 /// <summary>
 /// Xử lý lệnh lái xe
 /// </summary>
 /// <param name="doAccept">The do accept.</param>
 /// <Modified>
 /// Name     Date         Comments
 /// LuanBH  8/11/2015   created
 /// </Modified>
 private void XuLyLenhLaiXe(byte doAccept)
 {
     CloseWithoutChoose = false;
     try
     {
         string driverMessage = string.Empty;
         if (Model.MaMessage == EnVangManagement.MA_LENH_MOIKHACH)
         {
             EnVangProcess.SendACKInvite(Model, doAccept);
         }
         else if (Model.MaMessage == EnVangManagement.MA_LENH_XINSODT)
         {
             EnVangProcess.SendACKGetPhone(Model, doAccept);
         }
         else if (Model.MaMessage == EnVangManagement.MA_LENH_DAKETTHUC)
         {
             EnVangProcess.SendConfirmDone(Model, doAccept);
             driverMessage = "Đã kết thúc";
         }
         CuocGoi.DIENTHOAI_SuaMessageConfirm_EnVangVip(Model.IDCuocGoi, driverMessage, Model.MaMessage, false, Model.SoHieuXe);
         //Parent.openedDialogs.Remove(Model.MaMessage + "_" + Model.XeDon);
         Close();
     }
     catch (System.Exception ex)
     {
         new Log().WriteLog(ThongTinDangNhap.USER_ID, "btnHienThi_Click", DateTime.Now, ex.Message);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Xử lý lệnh lái xe
        /// </summary>
        /// <param name="doAccept">The do accept.</param>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/11/2015   created
        /// </Modified>
        public void XuLyLenhLaiXe(byte doAccept, bool clickButton = true)
        {
            CloseWithoutChoose = false;
            try
            {
                string driverMessage = string.Empty;
                if (Model.MaMessage == EnVangManagement.MA_LENH_DAKETTHUC)
                {
                    if (clickButton)
                    {
                        EnVangProcess.SendConfirmDone(Model, doAccept);
                    }
                    driverMessage = "Đã kết thúc";
                }
                else if (Model.MaMessage == EnVangManagement.MA_LENH_XINDIEMDO)
                {
                    if (clickButton)
                    {
                        int landMarkGPSID = Convert.ToInt32(iluVungDH.EditValue);
                        int landMarkID    = 0;
                        landMarkID = Parent._controlDieuHanhBanCoBanCo.GetIDVung(landMarkGPSID);
                        int node = 0;
                        if (!string.IsNullOrEmpty(txtNode.Text))
                        {
                            node = Convert.ToInt32(txtNode.Text);
                        }
                        //else
                        //{
                        //    node = Parent._controlDieuHanhBanCoBanCo.GetNodeNum(landMarkID, Model.XeDon);
                        //}

                        var value = EnVangProcess.SendConfirmLandmark(Model, doAccept, landMarkGPSID, node, landMarkID);
                    }
                }
                else if (Model.MaMessage == EnVangManagement.MA_LENH_DRIVERCMD && HaveToConfirm)
                {
                    if (clickButton)
                    {
                        var value = EnVangProcess.SendACKActiveChange(Model, doAccept, MaLaiXe, PKCommandID);
                    }
                }
                //if (Model.IDCuocGoi > 0)
                {
                    CuocGoi.DIENTHOAI_SuaMessageConfirm_EnVangVip(Model.IDCuocGoi, driverMessage, Model.MaMessage, !clickButton, Model.SoHieuXe);
                }
                Close();
                Parent.XuLyMessageKhongCanConfirm(Model, doAccept);
            }
            catch (System.Exception ex)
            {
                new Log().WriteLog(ThongTinDangNhap.USER_ID, "btnHienThi_Click", DateTime.Now, ex.Message);
            }
        }