Пример #1
0
        /// <summary>
        /// Gửi text cho service EnVang
        /// </summary>
        /// <param name="cuocGoi">The cuoc goi.</param>
        /// <returns></returns>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/7/2015   created
        /// </Modified>
        //public static bool SendText(CuocGoi cuocGoi)
        //{
        //    var privateCodes = ProcessFastTaxi.GetVehiclePlatesFromPrivateCode(cuocGoi.XeDon, ".");
        //    if (string.IsNullOrEmpty(privateCodes)) return false;
        //    CuocGoi.EnVangVIP_TaoMessageConfirm(cuocGoi.IDCuocGoi, 3242, false, true, cuocGoi.GhiChuDienThoai, privateCodes);
        //    return Service_Common.EnvangVip.TryGet(p => p.SendText(privateCodes, cuocGoi.GhiChuDienThoai)).Success;
        //}

        /// <summary>
        /// Gửi confirm landmark.
        /// </summary>
        /// <param name="soHieuXe">The so hieu xe.</param>
        /// <param name="landMarkID">The land mark identifier.</param>
        /// <param name="ok">if set to <c>true</c> [ok].</param>
        /// <returns></returns>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/27/2015   created
        /// </Modified>
        public static bool SendConfirmLandmark(MessageConfirm message, byte ok, long landMarkGPSID, int node, long landMarkID)
        {
            if (!HasSendMobile(null))
            {
                return(false);
            }

            var landMarkAndDriver = message.MessageContent.Split("-".ToCharArray());

            if (ok == 1)
            {
                CuocGoi.EnVangVIP_NhapDuLieuGiamSatXe(message.SoHieuXe,
                                                      landMarkAndDriver[1],
                                                      "",
                                                      ((int)Enum_TrangThaiLaiXeBao.BaoDiemDo).ToString(),
                                                      landMarkID,
                                                      "1",
                                                      null,
                                                      null, node);
            }

            var result = Service_Common.EnvangVip.TryGet(p => p.SendConfirmLandmark(message.BienSoXe, (int)landMarkGPSID, ok == 1, node)).Success;

            return(result);
        }
Пример #2
0
        /// <summary>
        /// Mở cửa sổ thông báo
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="parent">The parent.</param>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/10/2015   created
        /// </Modified>
        public static void OpenFormInfo(MessageConfirm message, frmDieuHanhDienThoaiNEWCP_V4 parent)
        {
            frmInfo frmThongTin = new frmInfo();
            string  frmCaption  = string.Empty;

            if (MessageCodes.ContainsKey(message.MaMessage))
            {
                frmCaption = MessageCodes[message.MaMessage];
            }
            bool isButtonVisible = true;
            bool doUseTimer      = true;

            switch (message.MaMessage)
            {
            case MA_LENH_DADON:
                isButtonVisible = false;
                break;

            case MA_LENH_DAKETTHUC:
                doUseTimer = false;
                break;

            default:
                break;
            }
            frmThongTin.SetModel(message, frmCaption, parent, isButtonVisible, doUseTimer);
            frmThongTin.Show();
        }
        /// <summary>
        /// Mở cửa sổ thông báo
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="parent">The parent.</param>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/10/2015   created
        /// </Modified>
        public static frmInfo OpenFormInfo(MessageConfirm message, frmDieuHanhBoDamNEW_V4 parent)
        {
            frmInfo frmThongTin = new frmInfo();
            string  frmCaption  = string.Empty;

            if (MessageCodes.ContainsKey(message.MaMessage))
            {
                frmCaption = MessageCodes[message.MaMessage];
            }
            bool isButtonVisible = true;
            bool doUseTimer      = true;

            switch (message.MaMessage)
            {
            case MA_LENH_DADON:
            case MA_LENH_DENDIEM:
            case MA_LENH_BAOKHAITHAC:
            case MA_LENH_CUOCKT:
                isButtonVisible = false;
                break;

            case MA_LENH_DAKETTHUC:
                doUseTimer = false;
                break;

            default:
                break;
            }
            frmThongTin.SetModel(message, frmCaption, parent, isButtonVisible, doUseTimer);
            frmThongTin.Show();
            return(frmThongTin);
        }
Пример #4
0
 /// <summary>
 /// Set giao diện cho form trước khi hiển thị lên màn hình
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="lenhLaiXe">The lenh lai xe.</param>
 /// <param name="parent">The parent.</param>
 /// <param name="isButtonVisible">if set to <c>true</c> [is button visible].</param>
 /// <param name="doUseTimer">if set to <c>true</c> [do use timer].</param>
 /// <Modified>
 /// Name     Date         Comments
 /// LuanBH  8/11/2015   created
 /// </Modified>
 public void SetModel(MessageConfirm model, string lenhLaiXe, frmDieuHanhBoDamNEW_V3 parent, bool isButtonVisible, bool doUseTimer)
 {
     if (model == null)
     {
         this.Close();
         return;
     }
     Parent              = parent;
     txtDiaChiDon.Text   = model.DiaChiDonKhach;
     lblPrivateCode.Text = model.XeDon;
     grbForm.Text        = lenhLaiXe;
     Model = model;
     if (doUseTimer)
     {
         if (model.MaMessage == EnVangManagement.MA_LENH_DADON)
         {
             _time = 1 * 15;
         }
         timer1.Start();
     }
     if (!isButtonVisible)
     {
         btnYes.Visible = false;
         btnNo.Visible  = false;
     }
 }
        /// <summary>
        ///     Please see <seealso cref="IEncodeMessageService{T}.Encode" /> for documentation.
        /// </summary>
        /// <param name="feedConfirmParameters">-</param>
        /// <returns>-</returns>
        public EncodedMessage Encode(FeedConfirmParameters feedConfirmParameters)
        {
            var messageHeaderParameters = new MessageHeaderParameters
            {
                ApplicationMessageId = feedConfirmParameters.ApplicationMessageId,
                TeamSetContextId     = feedConfirmParameters.TeamsetContextId ?? "",
                TechnicalMessageType = TechnicalMessageTypes.DkeFeedConfirm,
                Mode = RequestEnvelope.Types.Mode.Direct
            };

            var messagePayloadParameters = new MessagePayloadParameters
            {
                TypeUrl = MessageConfirm.Descriptor.FullName
            };

            var messageConfirm = new MessageConfirm();

            feedConfirmParameters.MessageIds?.ForEach(messageId => messageConfirm.MessageIds.Add(messageId));

            messagePayloadParameters.Value = messageConfirm.ToByteString();

            var encodedMessage = new EncodedMessage
            {
                Id      = Guid.NewGuid().ToString(),
                Content = EncodeMessageService.Encode(messageHeaderParameters, messagePayloadParameters)
            };

            return(encodedMessage);
        }
Пример #6
0
        /// <summary>
        /// 关闭
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void picClose_Click(object sender, EventArgs e)
        {
            bool           isOk    = false;
            MessageConfirm confirm = new MessageConfirm("退出后任务计划将停止,确定要退出吗?");

            confirm.CallBack += () =>
            {
                isOk = true;
            };
            confirm.ShowDialog(this);
            if (isOk)
            {
                wxlg.isCloseWinForm = true;
                wxlg.isStartTask    = false;
                if (wxlg.taskForm != null)
                {
                    wxlg.taskForm.ShowStartButtonText("启动计划");
                }
                if (wxlg.historyForm != null)
                {
                    wxlg.historyForm.ShowStartButtonText("启动计划");
                }

                wxlg.wxcontactsForm = null;
                this.Close();
            }
        }
Пример #7
0
        /// <summary>
        /// Set giao diện cho form trước khi hiển thị lên màn hình
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="lenhLaiXe">The lenh lai xe.</param>
        /// <param name="parent">The parent.</param>
        /// <param name="isButtonVisible">if set to <c>true</c> [is button visible].</param>
        /// <param name="doUseTimer">if set to <c>true</c> [do use timer].</param>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/11/2015   created
        /// </Modified>
        public void SetModel(MessageConfirm model, string lenhLaiXe, frmDieuHanhDienThoaiNEWCP_V4 parent, bool isButtonVisible, bool doUseTimer)
        {
            if (model == null)
            {
                this.Close();
                return;
            }
            ParentForm          = parent;
            txtDiaChiDon.Text   = model.DiaChiDonKhach;
            lblPrivateCode.Text = model.XeDon;
            grbForm.Text        = lenhLaiXe;
            Model = model;
            if (doUseTimer)
            {
                timer1.Start();
            }

            if (model.MaMessage == EnVangManagement.MA_LENH_XINDIEMDO)
            {
                iluVungDH.Bind();
                pnlVungDH.Visible = true;
                pnlDiaChi.Visible = false;
                iluVungDH.SetValue(model.MessageContent);
            }

            if (!isButtonVisible)
            {
                btnYes.Visible = false;
                btnNo.Visible  = false;
                this.Height    = this.Height - btnYes.Height;
            }
        }
Пример #8
0
 /// <summary>
 /// Confirm message báo kết thúc cuốc
 /// </summary>
 /// <param name="cuocGoi">The cuoc goi.</param>
 /// <param name="result">The result.</param>
 /// <returns></returns>
 /// <Modified>
 /// Name     Date         Comments
 /// LuanBH  8/7/2015   created
 /// </Modified>
 public static bool SendConfirmDone(MessageConfirm message, byte result)
 {
     if (!HasSendMobile(null))
     {
         return(false);
     }
     return(Service_Common.EnvangVip.TryGet(p => p.SendConfirmDone(message.IDCuocGoi.ToString(), result, string.Empty)).Success);
 }
Пример #9
0
 protected virtual void OnDispose()
 {
     if (_confirmBox != null)
     {
         _confirmBox.Close();
     }
     _confirmBox = null;
 }
Пример #10
0
        /// <summary>
        /// Trả lời confirm ăn ca, rời xe
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="status">The status.</param>
        /// <returns></returns>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  9/8/2015   created
        /// </Modified>
        public static bool SendACKActiveChange(MessageConfirm message, byte status, string driverCode, short commandId)
        {
            if (!HasSendMobile(null))
            {
                return(false);
            }

            return(Service_Common.EnvangVip.TryGet(p => p.SendACKActiveChange(message.BienSoXe, status, driverCode, message.XeDon, message.MaMessage, commandId)).Success);
        }
Пример #11
0
        /// <summary>
        /// Trả lời confirm ăn ca, rời xe
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="status">The status.</param>
        /// <returns></returns>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  9/8/2015   created
        /// </Modified>
        public static bool SendACKActiveChange(MessageConfirm message, byte status, string driverCode, short commandId)
        {
            var vehiclePlates = ProcessFastTaxi.GetVehiclePlatesFromPrivateCode(message.XeDon, ",");

            if (string.IsNullOrEmpty(vehiclePlates))
            {
                return(false);
            }
            return(Service_Common.EnvangVip.TryGet(p => p.SendACKActiveChange(vehiclePlates, status, driverCode, message.XeDon, message.MaMessage, commandId)).Success);
        }
Пример #12
0
 protected MessageConfirmBox(string ImageTitleUrl, string message)
 {
     _confirmBox = new MessageConfirm()
     {
         DataContext = new MessageConfirmViewModel(message,
                                                   string.Empty,
                                                   ConfirmBoxButtons.OK)
         {
             TitleImageUrl = ImageTitleUrl
         }
     };
 }
Пример #13
0
 protected MessageConfirmBox(string ImageTitleUrl,
                             string message,
                             string caption,
                             ConfirmBoxButtons messageBoxButtons)
 {
     _confirmBox = new MessageConfirm()
     {
         DataContext = new MessageConfirmViewModel(message,
                                                   caption,
                                                   messageBoxButtons)
         {
             TitleImageUrl = ImageTitleUrl
         }
     };
 }
Пример #14
0
        /// <summary>
        /// Gửi lệnh có thể/không thể mời được khách sang service EnVang
        /// </summary>
        /// <param name="cuocGoi">The cuoc goi.</param>
        /// <param name="coMoiKhach">The co moi khach.</param>
        /// <returns></returns>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/3/2015   created
        /// </Modified>
        public static bool SendACKInvite(MessageConfirm message, byte coMoiKhach, string msg)
        {
            var privateCodes = ProcessFastTaxi.GetVehiclePlatesFromPrivateCode(message.XeDon, ",");

            if (string.IsNullOrEmpty(privateCodes))
            {
                return(false);
            }

            if (Global.HasInternet == 1)
            {
                return(Service_Common.EnvangVip.TryGet(p => p.SendACKInvite(message.IDCuocGoi.ToString(), privateCodes, coMoiKhach, string.Empty)).Success);
            }
            else
            {
                return(SendSMSMessage(null, "Đã mời khách"));
            }
        }
Пример #15
0
 private void pbClose_Click(object sender, EventArgs e)
 {
     if (!ImportStart)
     {
         this.Close();
     }
     else
     {
         bool           isOk  = false;
         MessageConfirm alert = new MessageConfirm(ImportType == "goods" ? "正在导入商品,确认退出吗?" : "正在导入PID,确认退出吗?");
         alert.CallBack += () => { isOk = true; };
         alert.ShowDialog(this);
         if (isOk)
         {
             this.Close();
         }
     }
 }
Пример #16
0
 public void AlertConfirm(string text, string title, Action <bool> callback)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <string, string, Action <bool> >(AlertConfirm), new object[] { text, title, callback });
     }
     else
     {
         bool           isOk  = false;
         MessageConfirm alert = new MessageConfirm(text, title);
         alert.StartPosition = FormStartPosition.CenterScreen;
         alert.CallBack     += () =>
         {
             isOk = true;
         };
         alert.ShowDialog();
         callback?.Invoke(isOk);
     }
 }
Пример #17
0
        /// <summary>
        /// Gửi lệnh đồng ý/không đồng ý cho số sang service EnVang
        /// </summary>
        /// <param name="cuocGoi">The cuoc goi.</param>
        /// <param name="coChoSo">The co cho so.</param>
        /// <returns></returns>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/3/2015   created
        /// </Modified>
        public static bool SendACKGetPhone(MessageConfirm message, byte coChoSo)
        {
            var privateCodes = ProcessFastTaxi.GetVehiclePlatesFromPrivateCode(message.XeDon, ",");

            if (string.IsNullOrEmpty(privateCodes))
            {
                return(false);
            }

            if (Global.HasInternet == 1)
            {
                return(Service_Common.EnvangVip.TryGet(p => p.SendACKGetPhone(message.IDCuocGoi.ToString(), coChoSo, privateCodes)).Success);
            }
            else
            {
                //string message = string.Format("So dien thoai khach hang: {0}", cuocGoi.PhoneNumber);
                return(SendSMSMessage(null, string.Empty));
            }
        }
Пример #18
0
        /// <summary>
        /// Gửi confirm landmark.
        /// </summary>
        /// <param name="soHieuXe">The so hieu xe.</param>
        /// <param name="landMarkID">The land mark identifier.</param>
        /// <param name="ok">if set to <c>true</c> [ok].</param>
        /// <returns></returns>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/27/2015   created
        /// </Modified>
        public static bool SendConfirmLandmark(MessageConfirm message, byte ok)
        {
            var vehiclePlates = ProcessFastTaxi.GetVehiclePlatesFromPrivateCode(message.XeDon, ",");

            if (string.IsNullOrEmpty(vehiclePlates))
            {
                return(false);
            }
            var landMarkAndDriver = message.MessageContent.Split("-".ToCharArray());
            int node = 0;

            if (ok == 1)
            {
                node = CuocGoi.EnVangVIP_NhapDuLieuGiamSatXe(vehiclePlates, landMarkAndDriver[1], ""
                                                             , ((int)Enum_TrangThaiLaiXeBao.BaoDiemDo).ToString(), Convert.ToInt32(landMarkAndDriver[0]),
                                                             "1", null, null);
            }
            return(Service_Common.EnvangVip.TryGet(p => p.SendConfirmLandmark(vehiclePlates, Convert.ToInt32(landMarkAndDriver[0]), ok == 1, node)).Success);
        }
Пример #19
0
 private void ShowConfirm(VersionModel version)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <VersionModel>(ShowConfirm), new object[] { version });
     }
     else
     {
         bool           isUpdate = false;
         MessageConfirm cfr      = new MessageConfirm("发现新版本,是否马上下载更新?");
         cfr.CallBack += () =>
         {
             isUpdate = true;
         };
         cfr.StartPosition = FormStartPosition.CenterScreen;
         cfr.ShowDialog();
         if (isUpdate)
         {
             Process.Start(version.url);
         }
     }
 }
Пример #20
0
        /// <summary>
        /// Set giao diện cho form trước khi hiển thị lên màn hình
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="lenhLaiXe">The lenh lai xe.</param>
        /// <param name="parent">The parent.</param>
        /// <param name="isButtonVisible">if set to <c>true</c> [is button visible].</param>
        /// <param name="doUseTimer">if set to <c>true</c> [do use timer].</param>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/11/2015   created
        /// </Modified>
        public void SetModel(MessageConfirm model, string lenhLaiXe, frmDieuHanhBoDamNEW_V4 parent, bool isButtonVisible, bool doUseTimer)
        {
            if (model == null)
            {
                this.Close();
                return;
            }
            Parent              = parent;
            txtDiaChiDon.Text   = model.DiaChiDonKhach;
            lblPrivateCode.Text = model.XeDon;

            lblMsg.Text    = "";
            lblMsg.Visible = false;
            Model          = model;
            if (doUseTimer)
            {
                if (model.MaMessage == EnVangManagement.MA_LENH_DADON)
                {
                    _time = 1 * 15;
                }
                else
                {
                    _time = 1 * model.Timeout;
                }
                timer1.Start();
            }

            if (model.MaMessage == EnVangManagement.MA_LENH_XINDIEMDO)
            {
                iluVungDH.Bind();
                pnlVungDH.Visible   = true;
                pnlDiaChi.Visible   = false;
                iluVungDH.EditValue = Convert.ToInt64(model.MessageContent.Split("-".ToCharArray())[0]);
            }
            if (model.MaMessage == EnVangManagement.MA_LENH_BAOKHAITHAC)
            {
                pnlVungDH.Visible = false;
                pnlDiaChi.Visible = false;
            }
            if (model.MaMessage == EnVangManagement.MA_LENH_DRIVERCMD) //Trường hợp dùng driver command
            {
                if (string.IsNullOrEmpty(model.MessageContent))
                {
                    CloseWithoutChoose = false;
                    XuLyLenhLaiXe(0, false);
                    this.Close();
                }

                //Message Content hiện giờ đang ở định dạng:
                //Có confirm hay không (0,1) - Mã số lái xe - ID TrangThaiXeBao - Số phút FromMinute - PK Của MessageXeBao ; Text của command
                var messageParts = model.MessageContent.Split(";".ToCharArray());

                lenhLaiXe = messageParts[1];
                var cmdInfo = messageParts[0].Split("-".ToCharArray());
                isButtonVisible = cmdInfo[0].Equals("1");
                HaveToConfirm   = isButtonVisible;
                MaLaiXe         = cmdInfo[1];
                PKCommandID     = Convert.ToInt16(cmdInfo[4]);

                pnlVungDH.Visible = false;
                pnlDiaChi.Visible = false;

                lblMsg.Text    = lenhLaiXe;
                lblMsg.Visible = true;
            }

            if (!isButtonVisible)
            {
                btnYes.Text   = "[&O]K";
                btnNo.Visible = false;
            }
            grbForm.Text = lenhLaiXe;

            bwBanCo.WorkerSupportsCancellation = true;
            bwBanCo.DoWork += bwBanCo_DoWork;
        }
Пример #21
0
 private void Awake()
 {
     Controller = GameObject.Find("Confirm").GetComponent <MessageConfirm>();
 }