コード例 #1
0
        private void gridEX1_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
        {
            CSKHChiTiet objCSKH = (CSKHChiTiet)e.Row.DataRow;

            if (objCSKH.LAN1_Gio == DateTime.MinValue)
            {
                e.Row.Cells["LAN1_Gio"].Text = "";
            }
            if (objCSKH.LAN2_Gio == DateTime.MinValue)
            {
                e.Row.Cells["LAN2_Gio"].Text = "";
            }
            if (objCSKH.LAN3_Gio == DateTime.MinValue)
            {
                e.Row.Cells["LAN3_Gio"].Text = "";
            }
            else
            {
                GridEXFormatStyle RowStyle = new GridEXFormatStyle();
                RowStyle.BackColor = Color.Yellow;
                e.Row.RowStyle     = RowStyle;
            }
            if (objCSKH.LAN4_Gio == DateTime.MinValue)
            {
                e.Row.Cells["LAN4_Gio"].Text = "";
            }
            else
            {
                GridEXFormatStyle RowStyle = new GridEXFormatStyle();
                RowStyle.BackColor = Color.Red;
                e.Row.RowStyle     = RowStyle;
            }

            if (objCSKH.CSKH_Lan1_Gio == DateTime.MinValue)
            {
                e.Row.Cells["CSKH_Lan1_Gio"].Text = "";
            }
            if (objCSKH.CSKH_Lan2_Gio == DateTime.MinValue)
            {
                e.Row.Cells["CSKH_Lan2_Gio"].Text = "";
            }
            if (objCSKH.CSKH_Lan3_Gio == DateTime.MinValue)
            {
                e.Row.Cells["CSKH_Lan3_Gio"].Text = "";
            }
            if (objCSKH.CSKH_Lan4_Gio == DateTime.MinValue)
            {
                e.Row.Cells["CSKH_Lan4_Gio"].Text = "";
            }

            if (objCSKH.GioDonKhach == DateTime.MinValue)
            {
                e.Row.Cells["GioDon"].Text = "";
            }
        }
コード例 #2
0
        private void gridEX1_SelectionChanged(object sender, EventArgs e)
        {
            gridEX1.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
            CSKHChiTiet objOtem = new CSKHChiTiet();

            if (gridEX1.SelectedItems.Count > 0)
            {
                objOtem = (CSKHChiTiet)(gridEX1.SelectedItems[0]).GetRow().DataRow;

                HienThiLuaChoNgheGhiAm(objOtem);
            }
        }
コード例 #3
0
        /// <summary>
        /// hàm trả về ký tự wildcard của
        /// </summary>
        /// <param name="Item"></param>
        /// <param name="WidlCard"></param>
        /// <returns></returns>
        private string GetFileOfCuocGoi(CSKHChiTiet Item, out string WidlCard, out DateTime ThoiDiemGoiDiDen)
        {
            string fileName = "";

            WidlCard = ""; ThoiDiemGoiDiDen = DateTime.MinValue;
            if (radGoiDenLan1.Checked)
            {
                fileName = Item.LAN1_FileGhiAm; WidlCard = KYTU_GOIDEN; ThoiDiemGoiDiDen = Item.LAN1_Gio;
            }
            else if (radGoiDenLan2.Checked)
            {
                fileName = Item.LAN2_FileGhiAm; WidlCard = KYTU_GOIDEN; ThoiDiemGoiDiDen = Item.LAN2_Gio;
            }
            else if (radGoiDenLan3.Checked)
            {
                fileName = Item.LAN3_FileGhiAm; WidlCard = KYTU_GOIDEN; ThoiDiemGoiDiDen = Item.LAN3_Gio;
            }
            else if (radGoiDenLan4.Checked)
            {
                fileName = Item.LAN4_FileGhiAm; WidlCard = KYTU_GOIDEN; ThoiDiemGoiDiDen = Item.LAN4_Gio;
            }
            else if (radGoiCSLan1.Checked)
            {
                fileName = CuocGoiDi.GetFileGhiAmCuocGoiDi(Item.SoDienThoai, Item.CSKH_Lan1_Gio); WidlCard = KYTU_GOIDI; ThoiDiemGoiDiDen = Item.CSKH_Lan1_Gio;
            }
            else if (radGoiCSLan2.Checked)
            {
                fileName = CuocGoiDi.GetFileGhiAmCuocGoiDi(Item.SoDienThoai, Item.CSKH_Lan2_Gio); WidlCard = KYTU_GOIDI; ThoiDiemGoiDiDen = Item.CSKH_Lan2_Gio;
            }
            else if (radGoiCSLan3.Checked)
            {
                fileName = CuocGoiDi.GetFileGhiAmCuocGoiDi(Item.SoDienThoai, Item.CSKH_Lan3_Gio); WidlCard = KYTU_GOIDI; ThoiDiemGoiDiDen = Item.CSKH_Lan3_Gio;
            }
            else if (radGoiCSLan4.Checked)
            {
                fileName = CuocGoiDi.GetFileGhiAmCuocGoiDi(Item.SoDienThoai, Item.CSKH_Lan4_Gio); WidlCard = KYTU_GOIDI; ThoiDiemGoiDiDen = Item.CSKH_Lan4_Gio;
            }

            return(fileName);
        }
コード例 #4
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            if (TimKiem_BaoCao.CheckTuNgayDenNgay(calTuNgay.Value, calDenNgay.Value))
            {
                string sVung            = "";
                int    SoLanKhachGoiLai = 0;
                if (StringTools.TrimSpace(txtSoLanGoiLai.Text).Length > 0)
                {
                    SoLanKhachGoiLai = Convert.ToInt32(StringTools.TrimSpace(txtSoLanGoiLai.Text));
                }

                bool   isGoiTaxi      = chkGoiTaxi.Checked;
                bool   isGoiLai       = chkGoiLai.Checked;
                bool   isDonDuoc      = (chkDonDuoc.Checked & isGoiTaxi);
                bool   isDonDuoc888   = (chkDonDuocXe888.Checked & isGoiTaxi);
                bool   isTruotHoan    = (chkTruotHoan.Checked & isGoiTaxi);
                bool   isKhongXe      = (chkKhongXe.Checked & isGoiTaxi);
                bool   isKhongXe999   = (chkXe999.Checked & isGoiTaxi);
                string idTongDai      = StringTools.TrimSpace(txtIDTD.Text);
                string idCS           = StringTools.TrimSpace(txtIDCS.Text);
                string idDienThoai    = StringTools.TrimSpace(txtIDDT.Text);
                string strSoDienThoai = txtSoDienThoai.Text;
                if (idCS.Length < 2)
                {
                    idCS = string.Empty;
                }
                sVung              = StringTools.TrimSpace(txtVung.Text);
                g_ListDuLieu       = CSKHChiTiet.GetBCCSKHChiTiet(calTuNgay.Value, calDenNgay.Value, sVung, SoLanKhachGoiLai, isDonDuoc, isDonDuoc888, isTruotHoan, isKhongXe, isKhongXe999, idTongDai, idCS, idDienThoai, isGoiTaxi, isGoiLai, strSoDienThoai);
                gridEX1.DataMember = "ListDienThoai";
                gridEX1.SetDataBinding(g_ListDuLieu, "ListDienThoai");
                SetUnActiveRefreshButton();
            }
            else
            {
                MessageBox.MessageBoxBA msgDialog = new MessageBox.MessageBoxBA();
                msgDialog.Show(this, "Bạn phải nhập [Từ ngày] nhỏ hơn hoặc bằng [Đến ngày].", "Thông báo", MessageBox.MessageBoxButtonsBA.OK, MessageBox.MessageBoxIconBA.Warning);
            }
        }
コード例 #5
0
        private void btnPlay_Click(object sender, EventArgs e)
        {
            string filenameDB    = "";
            string filenameVoice = "";

            gridEX1.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
            CSKHChiTiet objItem              = null;
            string      KyTuDaiDienCuocGoi   = "";
            DateTime    ThoiDiemCuocGoiDiDen = DateTime.MinValue;

            if (gridEX1.SelectedItems.Count > 0)
            {
                objItem = (CSKHChiTiet)(gridEX1.SelectedItems[0]).GetRow().DataRow;

                filenameDB       = GetFileOfCuocGoi(objItem, out KyTuDaiDienCuocGoi, out ThoiDiemCuocGoiDiDen);
                lblFilename.Text = filenameDB;

                if (filenameDB.Length > 0)
                {
                    filenameVoice = NgheLaiCuocGoi.GetFileNameCuocDi(filenameDB);
                }
            }
            else
            {
                return;
            }
            // Xay dung Tools tìm kiếm file.

            //if (!FileTools.IsExsitFile(filenameVoice))
            //{
            //    filenameVoice = NgheLaiCuocGoi.GetFileVoiceCuaMotCuocGoi(objItem.Line, objItem.PhoneNumber, objItem.ThoiDiemGoi, Taxi.Utils.TypeCall.Incoming, ThongTinCauHinh.ThuMucFileAmThanh);
            //}

            if (filenameVoice.Length > 0)
            {
                player1.FileName = filenameVoice;
                if (player1.FileName != "")
                {
                    player1.Play();
                    btnPause.Text       = "Pause";
                    this.timer1.Enabled = true;
                }
                else
                {
                    new MessageBox.MessageBoxBA().Show(@"File không tồn tại.Bạn cần kiểm tra lại đường dẫn tới thư mục lưu file âm thanh.Thư mục này phải được lưu cùng với thư mục của hệ thống bắt số.Ví dụ : \\\maychu\GhiAm. Hoặc bạn có thể tìm ở file gốc.");
                }
            }
            else
            {
                if (objItem == null)
                {
                    return;
                }

                if (new MessageBox.MessageBoxBA().Show(this, "Chọn file gốc để nghe.", "Thong bao", Taxi.MessageBox.MessageBoxButtonsBA.OKCancel, Taxi.MessageBox.MessageBoxIconBA.Question).ToString() == DialogResult.OK.ToString())
                {
                    string     FileNameWildcard = StringTools.GetFilenameWidlcard(KyTuDaiDienCuocGoi, objItem.SoDienThoai);
                    frmTimFile frmTim           = new frmTimFile(NgheLaiCuocGoi.GetFullDirectory(ThongTinCauHinh.ThuMucFileAmThanh, ThoiDiemCuocGoiDiDen), FileNameWildcard);
                    frmTim.ShowDialog();
                    if (frmTim.DialogResult == DialogResult.OK)
                    {
                        player1.FileName      = frmTim.GetFilename();
                        this.lblFilename.Text = player1.FileName;
                        if (player1.FileName != "")
                        {
                            player1.Play();
                            btnPause.Text       = "Pause";
                            this.timer1.Enabled = true;
                        }
                        else
                        {
                            new MessageBox.MessageBoxBA().Show(@"File không tồn tại.Bạn cần kiểm tra lại đường dẫn tới thư mục lưu file âm thanh.");
                        }
                    }
                }
            }
        }
コード例 #6
0
        private void HienThiLuaChoNgheGhiAm(CSKHChiTiet objOtem)
        {
            if (objOtem.LAN1_Gio != DateTime.MinValue)
            {
                radGoiDenLan1.Visible = true;
            }
            else
            {
                radGoiDenLan1.Visible = false;
            }

            if (objOtem.LAN2_Gio != DateTime.MinValue)
            {
                radGoiDenLan2.Visible = true;
            }
            else
            {
                radGoiDenLan2.Visible = false;
            }

            if (objOtem.LAN3_Gio != DateTime.MinValue)
            {
                radGoiDenLan3.Visible = true;
            }
            else
            {
                radGoiDenLan3.Visible = false;
            }

            if (objOtem.LAN4_Gio != DateTime.MinValue)
            {
                radGoiDenLan4.Visible = true;
            }
            else
            {
                radGoiDenLan4.Visible = false;
            }

            if (objOtem.CSKH_Lan1_Gio != DateTime.MinValue)
            {
                radGoiCSLan1.Visible = true;
            }
            else
            {
                radGoiCSLan1.Visible = false;
            }

            if (objOtem.CSKH_Lan2_Gio != DateTime.MinValue)
            {
                radGoiCSLan2.Visible = true;
            }
            else
            {
                radGoiCSLan2.Visible = false;
            }

            if (objOtem.CSKH_Lan3_Gio != DateTime.MinValue)
            {
                radGoiCSLan3.Visible = true;
            }
            else
            {
                radGoiCSLan3.Visible = false;
            }

            if (objOtem.CSKH_Lan4_Gio != DateTime.MinValue)
            {
                radGoiCSLan4.Visible = true;
            }
            else
            {
                radGoiCSLan4.Visible = false;
            }
        }