/// <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);
        }
Пример #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();
        }
Пример #3
0
  protected void onInfoEvent(object sender, EventArgs e)
  {
      frmInfo Info = new frmInfo(dTOConfig);

      Info.Show();

      throw new NotImplementedException();
  }
Пример #4
0
        private void btnInfo_Click(object sender, EventArgs e)
        {
            frmInfo frm = new frmInfo();

            frm.Show();
        }
Пример #5
0
        private void layDuLieuThayDoi_Tick(object sender, EventArgs e)
        {
            _timeXoaDuLieu++;
            try
            {
                if (DuLieu == null)
                {
                    DuLieu = new List <Booking>();
                }
                if (_iSearch > 0)
                {
                    //  _iSearch--;
                }
                else if (_iSearch == 0)
                {
                    shGridControl_Bookings.DataSource = DuLieu;
                    shGridControl_Bookings.RefreshDataSource();
                    _iSearch = -1;
                }
                var data = Booking.Inst.GetByDateTime(ThongTinCauHinh.CacLineCuaTaxiOperation, _thoiDiemTruocLayDuLieu);

                if (data != null && data.Count > 0)
                {
                    TaxiReturn_Process.timerServer = DieuHanhTaxi.GetTimeServer();
                    _thoiDiemTruocLayDuLieu        = TaxiReturn_Process.timerServer;
                    //Kiểm tra là trạng thái chấp nhận,đã đón khách,chờ xử lý thì thêm và cập nhận lại.
                    data.Where(p => !DieuKienXoa(p)).ToList().ForEach(p =>
                    {
                        var dl = DuLieu.FirstOrDefault(pi => pi.PK_BooID == p.PK_BooID);
                        if (dl != null)
                        {
                            dl.CopyPropertyValue(p, p.GetPropertiesName());
                        }
                        else
                        {
                            if (p.FK_TaxiReturn == 0 && p.OpStatus == (int)Enum_Bookings_OpStatus.ChoXuLy)
                            {
                                var control = this.ActiveControl;
                                if (this.ParentForm != null)
                                {
                                    control = this.ParentForm.ActiveControl;
                                }
                                if (!string.IsNullOrEmpty(ThongTinDangNhap.USER_ID) && ThongTinDangNhap.HasPermission(StaxiPermission.GhepXeChieuVe))
                                {
                                    FrmThongTin = new frmInfo();
                                    FrmThongTin.SetModel(p);
                                    FrmThongTin.Show();
                                }
                                bool check = false;
                                foreach (Form item in Application.OpenForms)
                                {
                                    if (item.Visible && item is frmKhachCanXe)
                                    {
                                        item.Focus();
                                        item.Activate();
                                        check = true;
                                    }
                                }
                                if (!check && control != null)
                                {
                                    control.Focus();
                                }
                            }
                            else
                            {
                                if (p.OpReceivedTime == null)
                                {
                                    p.OpReceived(p.PK_BooID, ThongTinDangNhap.USER_ID);
                                    TaxiReturn_Process.OperationHasReceive(p.PK_BooID, ThongTinCauHinh.GPS_MaCungXN.To <int>());
                                }
                            }
                            DuLieu.Insert(0, p);
                        }
                    });
                    //kiểm tra xem đã kết thúc và xóa khỏi lưới.
                    data.Where(DieuKienXoa).ToList().ForEach(p =>
                    {
                        var dl = DuLieu.FirstOrDefault(pi => pi.PK_BooID == p.PK_BooID);
                        if (dl != null)
                        {
                            DuLieu.Remove(dl);
                        }
                    });
                    if (_iSearch == -1)
                    {
                        shGridControl_Bookings.DataSource = DuLieu;
                        shGridControl_Bookings.RefreshDataSource();
                    }
                    //  DuLieu = DuLieu.OrderBy(p => p.CreatedDate).ToList();
                }
                //Duyệt các cuốc xe thời gian đã hết chưa và thực hiện dấu số điện thoại.
                DuLieu.ForEach(p =>
                {
                    if (p.OpStatus == (int)Enum_Bookings_OpStatus.ChapNhan || p.OpStatus == (int)Enum_Bookings_OpStatus.DaDonKhach)
                    {
                        p.Mobile_ThoiGian = p.Mobile;
                    }
                    else if (p.OpStatus == (int)Enum_Bookings_OpStatus.ChoXuLy)
                    {
                        if (IsDieuXe)
                        {
                            if (string.IsNullOrEmpty(p.OpCommand))
                            {
                                var dt = p.OpReceivedTime ?? p.CreatedDate;
                                //Trạng thái số phút còn lại thực hiện
                                int val = ((p.OpReceivedTime == null ? 1 : 5) * 60) - (int)(TaxiReturn_Process.timerServer - dt.Value).TotalSeconds;
                                // nếu hết thời gian sẽ cập nhật là không xử lý.
                                if (val <= 0)
                                {
                                    //p.OpStatus = (int)Enum_Bookings_OpStatus.KhongXuLy;
                                    //p.OpAcceptedUser = ThongTinDangNhap.USER_ID;
                                    //p.OpAcceptedTime = TaxiReturn_Process.timerServer;
                                    p.UpdateStatus(p.PK_BooID, Enum_Bookings_OpStatus.KhongXuLy, ThongTinDangNhap.USER_ID);
                                    DuLieu.Remove(p);
                                }
                                else
                                {
                                    int sophut        = (val / 60);
                                    int soGiay        = val - sophut * 60;
                                    p.Mobile_ThoiGian = string.Format("Còn lại {0}:{1}", sophut, soGiay);
                                }
                            }
                            else
                            {
                                p.Mobile_ThoiGian = string.Empty;
                            }
                        }
                        else
                        {
                            p.Mobile_ThoiGian = string.Empty;
                        }
                    }

                    else
                    {
                        p.Mobile_ThoiGian = string.Empty;
                    }
                });

                if (_timeXoaDuLieu >= 3)
                {
                    _timeXoaDuLieu = 0;
                    if (DuLieu.Count > 0)
                    {
                        string lsId = string.Empty;
                        DuLieu.ForEach(p => lsId += string.Format("{0},", p.PK_BooID));
                        var lsDelete = Booking.Inst.GetDataDelete(lsId);
                        DuLieu.Where(p => lsDelete.Any(pi => pi == p.PK_BooID)).ToList().ForEach(p => {
                            p.OpReceivedTime = DateTime.Now;
                            DuLieu.Remove(p);
                        });
                    }
                    //DuLieu = DuLieu.OrderBy(p => p.CreatedDate).ToList();
                }
                shGridControl_Bookings.RefreshDataSource();
                //int index = gridView_Bookings.FocusedRowHandle;
                //shGridControl_Bookings.DataSource = DuLieu.Where(DieuKienTimKiem).ToList();
                //if (index < gridView_Bookings.RowCount) gridView_Bookings.FocusedRowHandle = index;
            }
            catch (Exception ex)
            {
                new Log().WriteLog(ThongTinDangNhap.USER_ID, "ctrlListBook\\layDuLieuThayDoi_Tick", DateTime.Now, ex.Message);
            }
        }
Пример #6
0
        private void menuInfo_Click(object sender, EventArgs e)
        {
            frmInfo fi = new frmInfo();

            fi.Show();
        }