private void frmRaHoatDong_Load(object sender, EventArgs e)
        {
            if (ThongTinDangNhap.USER_ID.Length <= 0)
            {
                new MessageBox.MessageBox().Show(this, "Bạn cần đăng nhập hệ thống để sử dụng chức năng này.", "Thông báo", Taxi.MessageBox.MessageBoxButtons.OK, Taxi.MessageBox.MessageBoxIcon.Warning);
                this.Close();
            }

            timeServer = DieuHanhTaxi.GetTimeServer();
            if (timeServer != DateTime.MinValue)
            {
                editThoiDiemBao.Text     = string.Format("{0: HH:mm:ss dd/MM/yyyy}", timeServer);
                editThoiDiemBao.ReadOnly = true;
            }
            editSoHieuXe.Focus();
            if (mKieuBao == 4)
            {
                Xe objXe = new Xe();
                editViTriBao.Text = objXe.GetChiTietXe(editSoHieuXe.Text).GaraName;
                if (StringTools.TrimSpace(editViTriBao.Text).Length <= 0)
                {
                    editViTriBao.Text = "Gara";
                }
            }
        }
Exemplo n.º 2
0
        private void frmBaoCaoBieuMau2_Load(object sender, EventArgs e)
        {
            DateTime dateCurrent = DieuHanhTaxi.GetTimeServer();

            lblThoiDiem.Text = string.Format("{0: dd/MM/yyyy HH:mm}", dateCurrent);
            LoadDulieuBaoCao_BieuMau14();
        }
Exemplo n.º 3
0
        private void frmTimKiem_Load(object sender, EventArgs e)
        {
            if (!g_ChonDongNhapVaoLuot)
            {
                btnXuatExcel.Enabled = false;
                btnSearch.Enabled    = true;
                lblMessage.Visible   = false;
            }
            else
            {
                DateTime timeServer = DieuHanhTaxi.GetTimeServer();
                cbDenNgay.Value     = timeServer;
                cbTuNgay.Value      = timeServer.AddDays(-10);
                cbDenNgay.Enabled   = false;
                cbTuNgay.Enabled    = false;
                txtSoDienThoai.Text = g_soDienThoai;
                lstPhanAnh          = objPhanAnh.SearchPhanAnh(g_soDienThoai, "", cbTuNgay.Value, cbDenNgay.Value, TrangThai, ChuyenDV);

                grdGiaiQuyetPA.DataMember = "lstThongTinPA";
                grdGiaiQuyetPA.SetDataBinding(lstPhanAnh, "lstThongTinPA");
                btnSearch.Enabled    = false;
                btnXuatExcel.Enabled = false;
                lblMessage.Visible   = true;
            }
        }
Exemplo n.º 4
0
        private void frmBaoCaoBieuMau2_Load(object sender, EventArgs e)
        {
            DateTime dateCurrent = DieuHanhTaxi.GetTimeServer();

            calNgay.Value = dateCurrent;
            LoadDulieuBaoCao_BieuMau1_New();
        }
Exemplo n.º 5
0
 private void grdNhanVien_DoubleClick(object sender, EventArgs e)
 {
     grdNhanVien.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
     if (grdNhanVien.SelectedItems.Count > 0)
     {
         GridEXRow row   = ((GridEXSelectedItem)grdNhanVien.SelectedItems[0]).GetRow();
         int       KmTra = int.Parse(row.Cells["KmTra"].Value.ToString());
         int       ID    = int.Parse(row.Cells["ID"].Value.ToString());
         if (KmTra > 0)
         {
             DateTime ThoiDiem   = Convert.ToDateTime(row.Cells["ThoiDiem"].Value.ToString());
             DateTime timeServer = DieuHanhTaxi.GetTimeServer();
             TimeSpan timeSpan   = timeServer - ThoiDiem;
             if (timeSpan.TotalHours < 4)
             {
                 frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(ID, true);
                 frmNhapNhatKyThueBaocontrol.ShowDialog();
             }
             else
             {
                 new MessageBox.MessageBoxBA().Show("Bạn chỉ sửa thông tin trong vòng 4 giờ khi đã nhập.");
             }
         }
         else
         {
             frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(ID);
             frmNhapNhatKyThueBaocontrol.ShowDialog();
         }
         this.LoadDSThueBao();
     }
 }
Exemplo n.º 6
0
        private void frmTimKiemXeThueBao_Load(object sender, EventArgs e)
        {
            DateTime timeServer = DieuHanhTaxi.GetTimeServer();

            calTuNgay.EditValue  = timeServer.Subtract(new TimeSpan(4, 0, 0, 0, 0));
            calDenNgay.EditValue = timeServer;
        }
Exemplo n.º 7
0
        private void frmBC_5_5_XeGapSuCo_Load(object sender, EventArgs e)
        {
            DateTime dateCurrent = DieuHanhTaxi.GetTimeServer();

            calTuNgay.Value    = dateCurrent.Date;
            date_DenNgay.Value = dateCurrent;
        }
        private void grdNhanVien_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                grdNhanVien.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
                if (grdNhanVien.SelectedItems.Count > 0)
                {
                    GridEXRow row   = ((GridEXSelectedItem)grdNhanVien.SelectedItems[0]).GetRow();
                    int       KmTra = int.Parse(row.Cells["KmTra"].Value.ToString());
                    int       ID    = int.Parse(row.Cells["ID"].Value.ToString());

                    if (KmTra > 0)
                    {
                        DateTime ThoiDiem   = Convert.ToDateTime(row.Cells["ThoiDiem"].Value.ToString());
                        DateTime timeServer = DieuHanhTaxi.GetTimeServer();
                        TimeSpan timeSpan   = timeServer - ThoiDiem;
                        if (ThongTinDangNhap.HasPermission(DanhSachQuyen.UpdateThueBaoTuyen))
                        {
                            frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(ID, true);
                            frmNhapNhatKyThueBaocontrol.Show();
                        }
                        else
                        {
                            new MessageBox.MessageBox().Show("Bạn chỉ sửa thông tin trong vòng 4 giờ khi đã nhập.");
                        }
                    }
                    else
                    {
                        frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(ID);
                        frmNhapNhatKyThueBaocontrol.Show();
                    }
                    this.LoadDSThueBao();
                }
            }
        }
Exemplo n.º 9
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            DateTime timeServer = DieuHanhTaxi.GetTimeServer();

            if (calTuNgay.Value > timeServer)
            {
                MessageBox.MessageBoxBA msgDialog = new Taxi.MessageBox.MessageBoxBA();
                msgDialog.Show(this, "Bạn phải nhập  nhỏ hơn hoặc bằng tháng hiện tại.", "Thông báo", Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Warning);
                return;
            }
            // Create a background thread
            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork             += new DoWorkEventHandler(bw_DoWorkNew);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

            // Create a progress form on the UI thread
            m_fmProgress = new fmProgress();

            // Kick off the Async thread
            bw.RunWorkerAsync();

            // Lock up the UI with this modal progress form.
            try
            {
                m_fmProgress.ShowDialog(this);
                m_fmProgress = null;
            }
            catch (Exception ex)
            {
            }
            SetUnActiveRefreshButton();
        }
        public static bool UpdateVoiceFile_DurationHearCall()
        {
            // Tim trong cuoc goi duoc nghe
            try
            {
                DateTime  timeServer  = DieuHanhTaxi.GetTimeServer();
                string    VOCFileName = ProcessVocFile.GetVOCFileFullPath(timeServer);
                DataTable dtCalls     = new DataTable();
                dtCalls = Data.ProcessVocFile.GetListVoiceFile_DurationHearCall(VOCFileName);

                if ((dtCalls != null) && (dtCalls.Rows.Count > 0))
                {
                    foreach (DataRow dr in dtCalls.Rows)
                    {
                        if (!DieuHanhTaxi.UpdateCuocGoiDenFileVoice_Duration(dr["Line"].ToString(), dr["PhoneNumber"].ToString(), (DateTime)dr["ThoiDiemGoi"], (DateTime)dr["DoDaiCuocGoi"], dr["VoiceFilePath"].ToString()))
                        {
                            ////  LogError.WriteLog("Loi luu xuong DB cuoc goi Duration ", new Exception("[ UpdateVoiceFile_DurationHearCall ]"));
                        }
                    }
                }
                dtCalls.Dispose();
                dtCalls = null;

                return(true);
            }
            catch (Exception ex)
            {
                ////  LogError.WriteLog("Loi cap nhat Duration -VoiceFile GetListVoiceFile_DurationHearCall : ", ex); return false;
            }
            return(false);
        }
Exemplo n.º 11
0
        private void TimerLayDuLieu_Tick(object sender, System.EventArgs e)
        {
            var data = XeDiDuongDai.Inst.GetDataByDateTime(deNgayDon.EditValue.To <DateTime>(), _thoiGianTruocLayDuLieu);

            if (data != null && data.Count > 0)
            {
                _thoiGianTruocLayDuLieu = DieuHanhTaxi.GetTimeServer();

                data.Where(p => !p.isDelete).ToList().ForEach(p =>
                {
                    var val = dulieu.FirstOrDefault(p1 => p1.ID == p.ID);
                    if (val != null)
                    {
                        var i = dulieu.IndexOf(val);
                        dulieu.Remove(val);
                        dulieu.Insert(i, p);
                    }
                    else
                    {
                        dulieu.Add(p);
                    }
                });
                data.Where(p => p.isDelete).ToList().ForEach(p =>
                {
                    var v = dulieu.FirstOrDefault(p1 => p1.ID == p.ID);
                    if (v != null)
                    {
                        dulieu.Remove(v);
                    }
                });
                shGridControl1.RefreshDataSource();
            }
        }
Exemplo n.º 12
0
        public void DieuXe()
        {
            #region Lấy dữ liệu đầy đủ cho lưới.
            TaxiReturn_Process.timerServer = DieuHanhTaxi.GetTimeServer();
            if (deTuNgay.EditValue == null || deDenNgay.EditValue == null)
            {
                return;
            }
            _thoiDiemTruocLayDuLieu = TaxiReturn_Process.timerServer;
            var start = _thoiDiemTruocLayDuLieu.Date.AddMonths(-3);
            var end   = _thoiDiemTruocLayDuLieu.Date.AddMonths(3);
            DuLieu = Booking.Inst.Search(ThongTinCauHinh.CacLineCuaTaxiOperation, string.Empty, string.Empty, start, end).OrderByDescending(p => p.CreatedDate).ToList();
            shGridControl_Bookings.DataSource = DuLieu;
            shGridControl_Bookings.Refresh();
            #endregion

            #region thiết lập thời gian

            _layDuLieuThayDoi.Interval = 1000;
            _layDuLieuThayDoi.Tick    += layDuLieuThayDoi_Tick;

            _layDuLieuThayDoi.Start();

            #endregion
        }
        ///// <summary>
        ///// báo về báo
        ///// </summary>
        ///// <param name="ParentForm"></param>
        ///// <param name="KieuBao"></param>
        //public frmSanBayDuongDai(Form ParentForm, int KieuBao)
        //{
        //    InitializeComponent();
        //    this.frmParent = ParentForm;
        //    this.mKieuBao = KieuBao;
        //    DisplayControls( );
        //}

        //public frmSanBayDuongDai(Form ParentForm, int KieuBao, string SoHieuXe)
        //{
        //    InitializeComponent();
        //    this.frmParent = ParentForm;
        //    this.mKieuBao = KieuBao;
        //    DisplayControls();
        //    editSoHieuXe.Text = SoHieuXe;
        //    // lấy thong tin xe
        //    //  editSoHieuXe_TextChanged(null, null);
        //}

        private void frmRaHoatDong_Load(object sender, EventArgs e)
        {
            if (ThongTinDangNhap.USER_ID.Length <= 0)
            {
                new MessageBox.MessageBox().Show(this, "Bạn cần đăng nhập hệ thống để sử dụng chức năng này.", "Thông báo", Taxi.MessageBox.MessageBoxButtons.OK, Taxi.MessageBox.MessageBoxIcon.Warning);
                this.Close();
            }


            if (isNewItem)
            {
                timeServer        = DieuHanhTaxi.GetTimeServer();
                lblTitle.Text     = "Tạo mới cuốc sân bay, đường dài";
                radSanBay.Checked = true;
                ThietLapConTrolChoSanBay();
            }
            else
            {
                timeServer           = g_thoiDiemDon; // update
                editSoHieuXe.Text    = g_soHieuXe;
                editSoHieuXe.Enabled = false;
                lblTitle.Text        = "Cập nhật cuốc sân bay, đường dài";
                // lấy thông tin cuộc đường dài
                GetThongTinXe(g_soHieuXe, g_thoiDiemDon);
            }
            if (timeServer != DateTime.MinValue)
            {
                editThoiDiemBao.Text     = string.Format("{0: HH:mm:ss dd/MM/yyyy}", timeServer);
                editThoiDiemBao.ReadOnly = true;
            }
        }
Exemplo n.º 14
0
        //private void LoadDuLieuCuocGoiDiTuPhanCung()
        //{
        //    // Create a background thread
        //    BackgroundWorker bw = new BackgroundWorker();
        //    bw.DoWork += new DoWorkEventHandler(bw_DoWork);
        //    bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

        //    // Create a progress form on the UI thread
        //    m_fmProgress = new fmProgress();

        //    // Kick off the Async thread
        //    bw.RunWorkerAsync();

        //    // Lock up the UI with this modal progress form.
        //    try
        //    {
        //        m_fmProgress.ShowDialog(this);
        //        m_fmProgress = null;
        //    }
        //    catch (Exception ex)
        //    {

        //    }
        //}

        //private void bw_DoWork(object sender, DoWorkEventArgs e)
        //{


        //    m_fmProgress.lblDescription.Invoke(
        //       (MethodInvoker)delegate()
        //       {
        //           m_fmProgress.lblDescription.Text = "Loading ... cuộc gọi đi";
        //           m_fmProgress.progressBar1.Value = 50;
        //       }
        //   );
        //    CaptureCuocGoiDi();
        //    if (m_fmProgress.Cancel)
        //    {
        //        // Set the e.Cancel flag so that the WorkerCompleted event
        //        // knows that the process was canceled.
        //        e.Cancel = true;
        //        return;
        //    }
        //}

        //private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        //{
        //    // The background process is complete. First we should hide the
        //    // modal Progress Form to unlock the UI. The we need to inspect our
        //    // response to see if an error occured, a cancel was requested or
        //    // if we completed succesfully.

        //    // Hide the Progress Form
        //    if (m_fmProgress != null)
        //    {
        //        m_fmProgress.Hide();
        //        m_fmProgress = null;
        //    }

        //    // Check to see if an error occured in the
        //    // background process.
        //    if (e.Error != null)
        //    {
        //        new MessageBox.MessageBox().Show(this, "Có lỗi trong quá trình xử lý dữ liệu. [" + e.Error.Message + "]");
        //        return;
        //    }

        //    // Check to see if the background process was cancelled.
        //    if (e.Cancelled)
        //    {
        //        // new Taxi.MessageBox.MessageBox().Show("Processing cancelled.");
        //        return;
        //    }
        //}

        /// <summary>
        /// nhan thong tin cac cuoc goi di va cap nhat vao DB
        /// </summary>
        private void CaptureCuocGoiDi()
        {
            try
            {
                // lay du lieu
                DateTime  timeServer  = DieuHanhTaxi.GetTimeServer();
                string    VOCFileName = ProcessVocFile.GetVOCFileFullPath(timeServer);
                DataTable dt          = new DataTable();
                dt = ProcessVocFile.GetEarlyPhoneDialOut(VOCFileName);
                if ((dt != null) && (dt.Rows.Count > 0))
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        CuocGoiDi objGoiDi = new CuocGoiDi(dr["Line"].ToString(), dr["PhoneNumber"].ToString(), (DateTime)dr["ThoiDiemGoi"], (DateTime)dr["DoDaiCuocGoi"], dr["VoiceFilePath"].ToString());
                        if (!objGoiDi.Insert())
                        {
                            //  LogError.WriteLog("Loi luu xuong DB cuoc goi di ", new Exception("[ Cuoc goi di ]"));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //  LogError.WriteLog("Loi luu xuong DB cuoc goi di ", ex);
            }
        }
Exemplo n.º 15
0
        //private void LoadDuLieuCuocGoiDiTuPhanCung()
        //{
        //    // Create a background thread
        //    BackgroundWorker bw = new BackgroundWorker();
        //    bw.DoWork += new DoWorkEventHandler(bw_DoWork);
        //    bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

        //    // Create a progress form on the UI thread
        //    m_fmProgress = new fmProgress();

        //    // Kick off the Async thread
        //    bw.RunWorkerAsync();

        //    // Lock up the UI with this modal progress form.
        //    try
        //    {
        //        m_fmProgress.ShowDialog(this);
        //        m_fmProgress = null;
        //    }
        //    catch (Exception ex)
        //    {

        //    }
        //}

        //private void bw_DoWork(object sender, DoWorkEventArgs e)
        //{


        //    m_fmProgress.lblDescription.Invoke(
        //       (MethodInvoker)delegate()
        //       {
        //           m_fmProgress.lblDescription.Text = "Loading ... cuộc gọi đi";
        //           m_fmProgress.progressBar1.Value = 50;
        //       }
        //   );
        //    CaptureCuocGoiDi();
        //    if (m_fmProgress.Cancel)
        //    {
        //        // Set the e.Cancel flag so that the WorkerCompleted event
        //        // knows that the process was canceled.
        //        e.Cancel = true;
        //        return;
        //    }
        //}

        //private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        //{
        //    // The background process is complete. First we should hide the
        //    // modal Progress Form to unlock the UI. The we need to inspect our
        //    // response to see if an error occured, a cancel was requested or
        //    // if we completed succesfully.

        //    // Hide the Progress Form
        //    if (m_fmProgress != null)
        //    {
        //        m_fmProgress.Hide();
        //        m_fmProgress = null;
        //    }

        //    // Check to see if an error occured in the
        //    // background process.
        //    if (e.Error != null)
        //    {
        //        new MessageBox.MessageBox().Show(this, "Có lỗi trong quá trình xử lý dữ liệu. [" + e.Error.Message + "]");
        //        return;
        //    }

        //    // Check to see if the background process was cancelled.
        //    if (e.Cancelled)
        //    {
        //        // new Taxi.MessageBox.MessageBox().Show("Processing cancelled.");
        //        return;
        //    }
        //}

        /// <summary>
        /// nhan thong tin cac cuoc goi di va cap nhat vao DB
        /// </summary>
        private void CaptureCuocGoiDi()
        {
            try
            {
                DateTime  timeServer  = DieuHanhTaxi.GetTimeServer();
                string    VOCFileName = ProcessVocFile.GetVOCFileFullPath(timeServer);
                DataTable dt          = new DataTable();
                dt = ProcessVocFile.GetEarlyPhoneDialOut(VOCFileName);
                if ((dt != null) && (dt.Rows.Count > 0))
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        CuocGoiDi objGoiDi = new CuocGoiDi(dr["Line"].ToString(), dr["PhoneNumber"].ToString(), (DateTime)dr["ThoiDiemGoi"], (DateTime)dr["DoDaiCuocGoi"], dr["VoiceFilePath"].ToString());
                        if (!objGoiDi.Insert())
                        {
                            new MessageBoxBA().Show("Lỗi khi thêm mới dữ liệu!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogError.WriteLogError("CaptureCuocGoiDi: ", ex);
            }
        }
 private void FillDefaultDataToForm(int formStatus)
 {
     g_DateTimeServer = DieuHanhTaxi.GetTimeServer();
     g_FormStatus     = formStatus;
     g_IDKhachDat     = 0;
     if (formStatus == 1)
     {
         calThoiDiemTiepNhan.EditValue = g_DateTimeServer;
         calThoiDiemTiepNhan.Visible   = true;
         cbSoPhut.Value           = 15;
         calGioDon.EditValue      = new DateTime(1900, 1, 1, g_DateTimeServer.Hour, g_DateTimeServer.Minute, 0);
         calNgayBatDau.EditValue  = g_DateTimeServer;
         calNgayKetThuc.EditValue = g_DateTimeServer;
         GetKhachDat_NgayTiepNhan();
         chk4Cho.Checked = false;
         chk7Cho.Checked = false;
         txtSoLuong.Text = "1";
         txtKenh.Value   = 0;
         txtGhiChu.Text  = "";
         txtLoaiXe.Text  = "";
     }
     else if (formStatus == 0)
     {
         txtKenh.Text               = null;
         cbSoPhut.Text              = "";
         calGioDonTu.EditValue      = new DateTime(1900, 1, 1, 0, 0, 0);
         calGioDonDen.EditValue     = new DateTime(1900, 1, 1, 23, 59, 0);
         calTGTiepNhanTu.EditValue  = new DateTime(g_DateTimeServer.Year, g_DateTimeServer.Month, g_DateTimeServer.Day, 0, 0, 0);
         calTGTiepNhanDen.EditValue = new DateTime(g_DateTimeServer.Year, g_DateTimeServer.Month, g_DateTimeServer.Day, 23, 59, 59);
     }
 }
 private void fillDefaultDataToForm(int formStatus)
 {
     g_DateTimeServer = DieuHanhTaxi.GetTimeServer();
     GetHeThongDat();
     if (formStatus == 1)
     {//for Addnew item
         calThoiDiemTiepNhan.Value = g_DateTimeServer;
         cbSoPhut.Value            = 15;
         calGioDon.Value           = new DateTime(1900, 1, 1, g_DateTimeServer.Hour, g_DateTimeServer.Minute, 0);
         calNgayBatDau.Value       = g_DateTimeServer;
         calNgayKetThuc.Value      = g_DateTimeServer;
         getKhachDat_NgayTiepNhan();
         txtTenKH.Focus();
     }
     else if (formStatus == 0)
     {
         //for Search item
         txtKenh.Value             = null;
         cbSoPhut.TextBox.Text     = "";
         calNgayBatDau.IsNullDate  = true;
         calNgayKetThuc.IsNullDate = true;
         calGioDonTu.Value         = new DateTime(1900, 1, 1, 0, 0, 0);
         calGioDonDen.Value        = new DateTime(1900, 1, 1, 23, 59, 0);
         calTGTiepNhanTu.Value     = new DateTime(g_DateTimeServer.Year, g_DateTimeServer.Month, g_DateTimeServer.Day, 0, 0, 0);
         calTGTiepNhanDen.Value    = new DateTime(g_DateTimeServer.Year, g_DateTimeServer.Month, g_DateTimeServer.Day, 23, 59, 0);
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// set don vi quan lý ve
        /// và - lý do hủy
        /// </summary>
        private void SetGiaTriMacDinh()
        {
            DateTime timeServer = DieuHanhTaxi.GetTimeServer();

            txtNam.Text    = timeServer.Year.ToString();
            lblGhiChu.Text = "";
        }
Exemplo n.º 19
0
        private void btn10_Click(object sender, EventArgs e)
        {
            gCurrentTime = DieuHanhTaxi.GetTimeServer();
            DateTime tuNgay  = gCurrentTime.AddMinutes(-10);
            DateTime denNgay = gCurrentTime;

            getDataForSearch_Fix(tuNgay, denNgay);
        }
        private void frmBaoCaoBieuMau2_Load(object sender, EventArgs e)
        {
            DateTime dateCurrent = DieuHanhTaxi.GetTimeServer();

            calTuNgay.Value  = dateCurrent;
            calDenNgay.Value = dateCurrent;
            LoadData(calTuNgay.Value, calDenNgay.Value);
        }
        private void KhoiTaoDuLieu()
        {
            DateTime dateCurrent = DieuHanhTaxi.GetTimeServer();

            dateCurrent      = new DateTime(dateCurrent.Year, dateCurrent.Month, dateCurrent.Day, 0, 0, 0);
            calTuNgay.Value  = dateCurrent;
            calDenNgay.Value = dateCurrent;
        }
        private void frmBaoCaoBieuMau2_Load(object sender, EventArgs e)
        {
            DateTime dateCurrent = DieuHanhTaxi.GetTimeServer();

            cbTuNgay.Value  = dateCurrent.Date;
            cbDenNgay.Value = dateCurrent;
            LoadTinhThanh();
            LoadGara();
            cbGara.SelectedIndex = 0;
        }
Exemplo n.º 23
0
        private void frmBaoCaoBieuMau2_Load(object sender, EventArgs e)
        {
            DateTime dateCurrent = DieuHanhTaxi.GetTimeServer();

            calTuNgay.Value        = dateCurrent;
            calDenNgay.Value       = dateCurrent;
            btnRefresh.Enabled     = false;
            btnPrint.Enabled       = false;
            btnExportExcel.Enabled = false;
        }
Exemplo n.º 24
0
        private void frmBaoCaoBieuMau2_Load(object sender, EventArgs e)
        {
            DateTime dateCurrent = DieuHanhTaxi.GetTimeServer();

            dateCurrent = new DateTime(dateCurrent.Year, dateCurrent.Month, dateCurrent.Day, 0, 0, 0);

            calTuNgay.Value   = dateCurrent;
            radTheoCa.Checked = true;
            //LoadData(calTuNgay.Value, radTheoCa.Checked);
        }
Exemplo n.º 25
0
        public static bool DeleteNhungCuocGoiDiNhoHon3ThangGanDay()
        {
            DateTime TuNgayGio = new DateTime(2000, 01, 01, 0, 0, 0);

            DateTime DenNgayGio = DieuHanhTaxi.GetTimeServer();

            DenNgayGio = DenNgayGio.Subtract(new TimeSpan(90, 0, 0, 0));

            return(new Data.CuocGoiDi().Delete(TuNgayGio, DenNgayGio));
        }
        private void frmBaoCaoCSKHTongHopV2_Load(object sender, EventArgs e)
        {
            btnRefresh.Enabled     = false;
            btnExportExcel.Enabled = false;

            DateTime dateCurrent = DieuHanhTaxi.GetTimeServer();

            calTuNgay.Value  = new DateTime(dateCurrent.Year, dateCurrent.Month, dateCurrent.Day, 0, 0, 0);
            calDenNgay.Value = new DateTime(dateCurrent.Year, dateCurrent.Month, dateCurrent.Day, 0, 0, 0);
        }
Exemplo n.º 27
0
        private void ThemDoiTac()
        {
            // Khoi tao doi tuong DoiTac voi ma

            DoiTac objDoiTac = new DoiTac("", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, 0, 0, string.Empty, true, "", "", 0, "");

            frmDoiTac frm = new frmDoiTac(objDoiTac, true, G_ListDoiTac, G_ListDoiTacUnActive);// them moi

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                objDoiTac = frm.DoiTac;
                // objDoiTac.
                // Insert DataBase
                // Clone
                objDoiTac.NguoiTao = ThongTinDangNhap.USER_ID;
                objDoiTac.NgayTao  = DieuHanhTaxi.GetTimeServer();
                if (!objDoiTac.Insert())
                {
                    new MessageBox.MessageBox().Show("Lỗi thêm mới đối tác");
                    return;
                }
                else
                {
                    //Load lai grid
                    if (G_IsActive)
                    {
                        TimVaCapNhatCuocGoi(ref G_ListDoiTac, objDoiTac);
                        HienThiTrenLuoi(true, true);
                    }
                    else
                    {
                        TimVaCapNhatCuocGoi_UnActive(ref G_ListDoiTacUnActive, objDoiTac);
                        HienThiTrenLuoi_UnActive(true, true);
                    }
                    //if (new MessageBox.MessageBox().Show("Có một môi giới mới, bạn cần cập nhật lại cuộc gọi môi giới", "Thông báo", Taxi.MessageBox.MessageBoxButtons.YesNo, Taxi.MessageBox.MessageBoxIcon.Question).ToString() == DialogResult.Yes.ToString())
                    //{
                    //    // Lay cuoc goi da ket thuc
                    //    List<DieuHanhTaxi> lstDieuHanhTaxi = new List<DieuHanhTaxi>();
                    //    lstDieuHanhTaxi = new DieuHanhTaxi().Get_CuocGoi_KetThuc(" ", " ");

                    //    if (!DieuHanhTaxi.UpdateLaiCuocGoiMoiGioi(objDoiTac, lstDieuHanhTaxi))
                    //    {
                    //        new MessageBox.MessageBox().Show("Lỗi cập nhật cuộc gọi môi giới");
                    //        return;
                    //    }
                    //    else
                    //    {
                    //        new MessageBox.MessageBox().Show("Cập nhật cuộc gọi môi giới thành công");
                    //        return;
                    //    }
                    //}
                }
            }
        }
        private void frmThongTinSuCo_Input_Load(object sender, EventArgs e)
        {
            string strDateTime = DieuHanhTaxi.GetTimeServer().ToString("HH:mm:ss dd/MM/yyyy", new System.Globalization.CultureInfo("vi-VN", false));

            Xe_lblThoiGian.Text  = strDateTime;
            The_lblThoiGian.Text = strDateTime;
            if (G_KiemSoatLienLac != null && G_KiemSoatLienLac.SoHieuXe != null && G_KiemSoatLienLac.SoHieuXe != "")
            {
                SetData(G_KiemSoatLienLac);
            }
        }
Exemplo n.º 29
0
        private void frmThongTinNhanVienLamViec_Load(object sender, EventArgs e)
        {
            DateTime timerServer = DieuHanhTaxi.GetTimeServer();

            calTuNgay.Text  = string.Format("{0:HH:mm:ss dd/MM/yyyy}", timerServer);
            calDenNgay.Text = string.Format("{0:HH:mm:ss dd/MM/yyyy}", timerServer);
            gridNhanVienLamViec.DataMember = "lstNhanvienDangLamViec";
            gridNhanVienLamViec.SetDataBinding(ThongTinDangNhap.GetNhungNhanVienDangLamViec(), "lstNhanvienDangLamViec");
            g_bChonDangLamViec = true;
            btnRefresh.Enabled = false;
        }
Exemplo n.º 30
0
        public static void LoadVehicles_Active_LastUpdate()
        {
            try
            {
                if ((Vehicles_Active_LastUpdate == DateTime.MinValue) && DicObjecXe != null && DicObjecXe.Count > 0)
                {
                    Vehicles_Active_LastUpdate = DicObjecXe.Max(p => p.Value.LastUpdate);
                }
                if ((Vehicles_Active_LastUpdate == null || Vehicles_Active_LastUpdate == DateTime.MinValue))
                {
                    Vehicles_Active_LastUpdate = DieuHanhTaxi.GetTimeServer();
                }
                if ((Vehicles_Active_LastUpdate == null || Vehicles_Active_LastUpdate == DateTime.MinValue))
                {
                    Vehicles_Active_LastUpdate = DateTime.Now;
                }
                var ListXeUpdate = Data.BanCo.Entity.DM.DMXe.Inst.GetLastUpdate(Vehicles_Active_LastUpdate);

                if (ListXeUpdate != null && ListXeUpdate.Count > 0)
                {
                    foreach (var item in ListXeUpdate)
                    {
                        if (item.LastUpdate > Vehicles_Active_LastUpdate)
                        {
                            Vehicles_Active_LastUpdate = item.LastUpdate;
                        }
                        if (!DicXe.ContainsKey(item.PK_SoHieuXe))
                        {
                            DicXe.Add(item.PK_SoHieuXe, item.BienKiemSoat);
                        }
                        else
                        {
                            DicXe[item.PK_SoHieuXe] = item.BienKiemSoat;
                        }
                        if (!DicObjecXe.ContainsKey(item.PK_SoHieuXe))
                        {
                            DicObjecXe.Add(item.PK_SoHieuXe, item);
                        }
                        else
                        {
                            DicObjecXe[item.PK_SoHieuXe] = item;
                        }
                    }
                    if (DicObjecXe != null)
                    {
                        ListXe = DicObjecXe.Select(p => p.Value).ToList();
                    }
                }
            }
            catch (Exception ex)
            {
                LogError.WriteLogError("LoadVehicles_Active_LastUpdate", ex);
            }
        }