Esempio n. 1
0
        private void frmVeThem_Load(object sender, EventArgs e)
        {
            chkDen.Checked         = _GiaoDichO.SoLuongVe == 2;
            _ListDaiLyO            = new D_DAILY().All();
            _ListHangBayO          = new D_HANGBAY().DuLieu();
            _ListTuyenBayO         = new D_TUYENBAY().DuLieu();
            NhanVienDB.DataSource  = new D_DAILY().NhanVien();
            LoaiKhachDB.DataSource = DuLieuTaoSan.LoaiKhachHang_Ve();
            LoaiVeDB.DataSource    = DuLieuTaoSan.LoaiGiaoDich_Ve(true).Where(w => !w.ID.Equals(8) && !w.ID.Equals(9));
            DaiLyDB.DataSource     = _ListDaiLyO.Where(w => w.LoaiKhachHang.Equals(LoaiKhachHang));
            _ListNCC         = new D_NHACUNGCAP().DuLieu();
            NCCDB.DataSource = _ListNCC;
            tuyenBayOBindingSource.DataSource = _ListTuyenBayO;
            rHD.DataSource = DuLieuTaoSan.HinhThucHoaDon();
            iAn.Visible    = DuLieuTaoSan.Q.VeAdmin;

            #region NVGiaoDich
            iNVGiaoDich.Properties.ReadOnly = _GiaoDichO.NVGiaoDich != DuLieuTaoSan.NV.ID;

            if (_GiaoDichO.NVGiaoDich == DuLieuTaoSan.NV.ID || _GiaoDichO.NVGiaoDich < 1 || DuLieuTaoSan.NV.MienPhat)
            {
                _GiaoDichO.NVGiaoDich = DuLieuTaoSan.NV.ID;
            }
            else if (_GiaoDichO.NVHoTro < 1 || DuLieuTaoSan.NV.MienPhat)
            {
                _GiaoDichO.NVHoTro = DuLieuTaoSan.NV.ID;
            }
            #endregion

            iGhiChu.Text      = _GiaoDichO.GhiChu;
            DuLieuTaoSan.Adic = XuLyDuLieu.ConvertClassToTable(this, _GiaoDichO);
            _LSTDIC           = XuLyDuLieu.BanTamGrid(GVGD);
            XuLyGiaoDien.OpenForm(this);
            btnLuu.Visible = DuLieuTaoSan.Q.VeThemSua;
        }
Esempio n. 2
0
 private void frmChinhSachThem_Load(object sender, EventArgs e)
 {
     intStringBindingSource.DataSource = DuLieuTaoSan.LoaiKhachHang_Ve();
     XuLyDuLieu.ConvertClassToTable(this, _ChinhSachO);
     XuLyGiaoDien.OpenForm(this);
     btnLuu.Visible = DuLieuTaoSan.Q.ChinhSachThemSua;
 }
Esempio n. 3
0
        private void grpc2_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
        {
            if (chinhSachOBindingSource.Count > 1)
            {
                switch (e.Button.Properties.Caption)
                {
                case "Thêm":
                    XuLyDuLieu.ConvertClassToTable(this, new O_CTCHINHSACH());
                    igroupControl1.Text = "Chi tiết chính sách thêm";
                    btnHuy.Enabled      = btnLuu.Enabled = true;
                    chk.Checked         = true;
                    break;

                default:
                    if (GVCTCS.GetSelectedRows().Count() > 0)
                    {
                        _CTchinhSachO = GVCTCS.GetRow(GVCTCS.GetSelectedRows()[0]) as O_CTCHINHSACH;
                        if (_CTchinhSachO != null)
                        {
                            btnHuy.Enabled      = btnLuu.Enabled = true;
                            igroupControl1.Text = "Chi tiết chính sách sửa";
                            XuLyDuLieu.ConvertClassToTable(this, _CTchinhSachO);
                            chk.Checked = false;
                        }
                    }
                    break;
                }
            }
        }
Esempio n. 4
0
 private void frmNCCGD_Load(object sender, EventArgs e)
 {
     nCCOBindingSource.DataSource      = new D_NHACUNGCAP().DuLieu();
     intStringBindingSource.DataSource = DuLieuTaoSan.LoaiPhi(false);
     XuLyGiaoDien.OpenForm(this);
     XuLyDuLieu.ConvertClassToTable(this, _nCCGDO);
 }
Esempio n. 5
0
 private void frmKPIThem_Load(object sender, EventArgs e)
 {
     kPIHangMucOBindingSource.DataSource = new D_KPIHANGMUC().DuLieu1();
     XuLyDuLieu.ConvertClassToTable(this, kpi);
     XuLyGiaoDien.OpenForm(this);
     btnLuu2.Visible = DuLieuTaoSan.Q.TuyenBayThemSua;
 }
Esempio n. 6
0
 private void frmTuyenBayThem_Load(object sender, EventArgs e)
 {
     _list = new D_SANBAY().DuLieu();
     sanBayOBindingSource.DataSource = _list;
     XuLyDuLieu.ConvertClassToTable(this, _TuyenBayO);
     XuLyGiaoDien.OpenForm(this);
     btnLuu2.Visible = DuLieuTaoSan.Q.TuyenBayThemSua;
 }
 private void frmThemSignIn_Load(object sender, EventArgs e)
 {
     hangBayOBindingSource.DataSource = new D_HANGBAY().DuLieu().Where(w => w.SapXep);
     if (hangBayOBindingSource.Count < 21)
     {
         iHangBay.Properties.DropDownRows = hangBayOBindingSource.Count;
     }
     DuLieuTaoSan.Adic = XuLyDuLieu.ConvertClassToTable(this, _SignInO);
     XuLyGiaoDien.OpenForm(this);
 }
Esempio n. 8
0
 private void frmDaiLyThem_Load(object sender, EventArgs e)
 {
     hangBayOBindingSource.DataSource = new D_HANGBAY().DuLieu();
     XuLyGiaoDien.OpenForm(this);
     DuLieuTaoSan.Adic = XuLyDuLieu.ConvertClassToTable(this, _DaiLyO);
     iTinhTrang.Properties.DataSource = new D_TRANGTHAI().DuLieu(_DaiLyO.LoaiKhachHang);
     iChinhSach.Properties.DataSource = new D_CHINHSACH().DuLieuDL(_DaiLyO.LoaiKhachHang);
     btnLuu.Visible        = DuLieuTaoSan.Q.DaiLyThemSua;
     lbl15.Visible         = iDuHoSo.Visible = iNVGiaoDich.Visible = DuLieuTaoSan.NV.TenDangNhapCty.ToUpper().Equals("ITADMIN");
     NhanVienDB.DataSource = new D_DAILY().NhanVien();
 }
Esempio n. 9
0
 private void GVCTCS_Click(object sender, EventArgs e)
 {
     if (GVCTCS.GetSelectedRows().Count() > 0)
     {
         _CTchinhSachO = GVCTCS.GetRow(GVCTCS.GetSelectedRows()[0]) as O_CTCHINHSACH;
         if (_CTchinhSachO != null)
         {
             XuLyDuLieu.ConvertClassToTable(this, _CTchinhSachO);
             igroupControl1.Text = "Chi tiết chính sách";
         }
     }
 }
Esempio n. 10
0
 private void frmNhanVienThem_Load(object sender, EventArgs e)
 {
     dt.Columns.Add("col1");
     dt.Columns.Add("col2");
     dt.Columns.Add("col3");
     XuLyGiaoDien.OpenForm(this);
     _HoHang           = _KhachHangO.ThongTinLienLac;
     DuLieuTaoSan.Adic = XuLyDuLieu.ConvertClassToTable(this, _KhachHangO);
     quyenOBindingSource.DataSource   = new D_NHOMQUYEN().DuLieu();
     gioiTinhBindingSource.DataSource = DuLieuTaoSan.GioiTinh();
     e2.EditValue = DateTime.Now;
     NguoiThanKhach();
 }
Esempio n. 11
0
 private void frmHoaDonThem_Load(object sender, EventArgs e)
 {
     daiLyDs = new D_DAILY().All();
     daiLyOBindingSource1.DataSource   = daiLyDs;
     nCCOBindingSource.DataSource      = new D_NHACUNGCAP().DuLieu();
     tuyenBayOBindingSource.DataSource = new D_TUYENBAY().DuLieu();
     bindingSource1.DataSource         = daiLyD.NhanVien();
     IntStringBindingSource.DataSource = DuLieuTaoSan.LoaiKhachHang_GiaoDich(false);
     hoaDonOBindingSource1.DataSource  = _HoaDonD.LayThongTinMST();
     hangBayOBindingSource.DataSource  = new D_HANGBAY().DuLieu();
     XuLyGiaoDien.OpenForm(this);
     DuLieuTaoSan.Adic = XuLyDuLieu.ConvertClassToTable(this, _HoaDonO);
     daiLyOBindingSource.DataSource = daiLyDs.Where(w => w.LoaiKhachHang.Equals((int)iLoaiKhachHang.EditValue));
     bandedGridView1.BestFitColumns();
 }
Esempio n. 12
0
 private void frmTongHopThem_Load(object sender, EventArgs e)
 {
     daiLyOs           = new D_DAILY().All();
     DuLieuTaoSan.Adic = XuLyDuLieu.ConvertClassToTable(this, Gd);
     loaiKhachOBindingSource.DataSource     = DuLieuTaoSan.LoaiKhachHang_GiaoDich().Where(w => w.ID.Equals(1) || w.ID.Equals(2));
     loaiGiaoDichOBindingSource1.DataSource = DuLieuTaoSan.LoaiGiaoDich_Ve(false);
     XuLyGiaoDien.OpenForm(this);
     iTenKhach.Text = "Thời gian: " + DateTime.Now.ToString("HH:mm");
     if ((new List <int>()
     {
         7, 11, 12
     }).Contains(Gd.LoaiGiaoDich))
     {
         iGiaThu.Value  = Gd.GiaHoan;
         iTenKhach.Text = Gd.TenKhach;
     }
 }
Esempio n. 13
0
        private void frmKhachSanThem_Load(object sender, EventArgs e)
        {
            #region NVGiaoDich
            iNVGiaoDich.Properties.ReadOnly = iNVHoTro.Properties.ReadOnly = _ks.NVGiaoDich != DuLieuTaoSan.NV.ID;
            LoaiKhachDB.DataSource          = DuLieuTaoSan.LoaiKhachHang_Ve();

            if (_ks.NVGiaoDich == DuLieuTaoSan.NV.ID || _ks.NVGiaoDich < 1 || DuLieuTaoSan.NV.MienPhat)
            {
                _ks.NVGiaoDich = DuLieuTaoSan.NV.ID;
            }
            else if (_ks.NVHoTro < 1 || DuLieuTaoSan.NV.MienPhat)
            {
                _ks.NVHoTro = DuLieuTaoSan.NV.ID;
            }
            #endregion

            DuLieuTaoSan.Adic = XuLyDuLieu.ConvertClassToTable(this, _ks);
            XuLyGiaoDien.OpenForm(this);
            DuLieu();
        }
Esempio n. 14
0
        private void frmThemGiaoDichTK_Load(object sender, EventArgs e)
        {
            loaiGiaoDichOBindingSource.DataSource = new D_LOAIGIAODICH().DuLieu_NganHang_TheoLoai(0, true);
            DataLoaiKhach.DataSource = DuLieuTaoSan.LoaiKhachHang_NganHang();
            _NganHang = new D_NGANHANG().All();
            nganHangNguonBindingSource.DataSource = _NganHang;
            nhanVienOBindingSource.DataSource     = new D_DAILY().NhanVien();
            IntStringBindingSource.DataSource     = DuLieuTaoSan.TrangThai_NganHang();

            if (CTM.NVGiaoDich < 1)
            {
                CTM.NVGiaoDich = DuLieuTaoSan.NV.ID;
            }

            DuLieuTaoSan.Adic = XuLyDuLieu.ConvertClassToTable(this, CTM);
            XuLyGiaoDien.OpenForm(this);
            if (!CTM.TrangThaiID)
            {
                iTrangThaiID.EditValue = true;
            }
        }
Esempio n. 15
0
        private void frmVeHoanThem_Load(object sender, EventArgs e)
        {
            chkDen.Checked = _GiaoDichO.SoLuongVe == 2;
            DuLieuKhachLe();
            _ListHangBayO                     = new D_HANGBAY().DuLieu();
            _ListTuyenBayO                    = new D_TUYENBAY().DuLieu();
            LoaiKhachDB.DataSource            = DuLieuTaoSan.LoaiKhachHang_Ve();
            NCCDB.DataSource                  = new D_NHACUNGCAP().DuLieu();
            NhanVienDB.DataSource             = new D_DAILY().NhanVien();
            tuyenBayOBindingSource.DataSource = _ListTuyenBayO;
            iTinhCongNo.Visible               = DuLieuTaoSan.Q.TheoDoiHoanAdmin;
            if (Owner.ActiveMdiChild is frmVe)
            {
                iTinhCongNo.Visible = true;
                iTinhCongNo.Checked = true;
            }
            iAn.Visible = DuLieuTaoSan.Q.VeAdmin;

            #region NVGiaoDich
            iNVGiaoDich.Properties.ReadOnly = _GiaoDichO.NVGiaoDich != DuLieuTaoSan.NV.ID;
            if (_GiaoDichO.NVGiaoDich < 1)
            {
                _GiaoDichO.NVGiaoDich = DuLieuTaoSan.NV.ID;
            }
            else if (DuLieuTaoSan.NV.MienPhat)
            {
                _GiaoDichO.NVGiaoDich = DuLieuTaoSan.NV.ID;
            }
            #endregion

            iGhiChu.Text = _GiaoDichO.GhiChu;
            _LSTDIC      = XuLyDuLieu.BanTamGrid(GVH);
            XuLyDuLieu.ConvertClassToTable(this, _GiaoDichO);
            XuLyGiaoDien.OpenForm(this);
            if (!_GiaoDichO.TinhCongNo)
            {
                iNgayGD.DateTime = DateTime.Now;
            }
            btnLuu.Visible = DuLieuTaoSan.Q.TheoDoiHoanThemSua;
        }
Esempio n. 16
0
        void Xuli(List <O_GIAODICH> lstgd)
        {
            foreach (O_GIAODICH gd in lstgd)
            {
                if (_ListGiaoDichO.Where(w => (w.SoVeVN ?? string.Empty).Equals(gd.SoVeVN) && w.GiaHoan.Equals(gd.GiaThu)).Count() > 0)
                {
                    continue;
                }
                O_GIAODICH g1 = new O_GIAODICH(gd);
                g1.GiaHoan      = g1.GiaThu;
                g1.GiaNet       = g1.GiaHeThong = g1.GiaThu = 0;
                g1.LoiNhuan     = g1.GiaHeThong + g1.HangHoan - g1.GiaNet + g1.GiaHoan;
                g1.TenKhach    += "/Hoàn vé";
                g1.LoaiGiaoDich = 9;
                g1.NVHoTro      = g1.NVHoTro;
                _ListGiaoDichO.Add(g1);
            }

            if (lstgd.Count > 0)
            {
                DSGiaoDich.DataSource = null;
                DSGiaoDich.DataSource = _ListGiaoDichO;

                lstgd[0].NVHoTro    = _ListGiaoDichO[0].NVGiaoDich;
                lstgd[0].NVGiaoDich = DuLieuTaoSan.NV.ID;

                lstgd[0].NgayGD = DateTime.Now;
                XuLyDuLieu.ConvertClassToTable(this, lstgd[0]);

                iTinhCongNo.Checked = false;
                btnLuu.Visible      = true;
            }

            if (Owner.ActiveMdiChild is frmVe)
            {
                iTinhCongNo.Visible = true;
                iTinhCongNo.Checked = true;
            }
        }
Esempio n. 17
0
        private void frmNCCThem_Load(object sender, EventArgs e)
        {
            KhuVuc();
            _DataHangBay.Columns.Add("ID", typeof(int));
            _DataHangBay.Columns.Add("Ten", typeof(string));
            _lstHangBayO = new D_HANGBAY().DuLieu();
            hangBayOBindingSource.DataSource = _lstHangBayO;

            if ((_NCCO.HangBay ?? string.Empty).Length > 1)
            {
                string[] NCCA = _NCCO.HangBay.Split('|');
                for (int i = 0; i < NCCA.Length - 1; i++)
                {
                    _HangBayO = _lstHangBayO.Where(w => w.ID.Equals(int.Parse(NCCA[i]))).ToList()[0];
                    _DataHangBay.Rows.Add(_HangBayO.ID, _HangBayO.TenHang);
                }
                GCNCC.DataSource = _DataHangBay;
            }
            DSNH.DataSource = new D_NGANHANG().All();
            XuLyDuLieu.ConvertClassToTable(this, _NCCO);
            XuLyGiaoDien.OpenForm(this);
        }
Esempio n. 18
0
 private void frmSanBayThem_Load(object sender, EventArgs e)
 {
     XuLyDuLieu.ConvertClassToTable(this, _SanBayO);
     XuLyGiaoDien.OpenForm(this);
 }
Esempio n. 19
0
 private void frmHangBayThem_Load(object sender, EventArgs e)
 {
     XuLyDuLieu.ConvertClassToTable(this, _HangBay);
     XuLyGiaoDien.OpenForm(this);
     btnLuu.Visible = DuLieuTaoSan.Q.HangBayThemSua;
 }
Esempio n. 20
0
 private void frmKhachLeThem_Load(object sender, EventArgs e)
 {
     XuLyDuLieu.ConvertClassToTable(this, _DaiLyO);
     btnLuu.Visible = DuLieuTaoSan.Q.KhachLeThemSua;
     XuLyGiaoDien.OpenForm(this);
 }
Esempio n. 21
0
 private void frmThemNganHang_Load(object sender, EventArgs e)
 {
     DuLieuTaoSan.Adic = XuLyDuLieu.ConvertClassToTable(this, nho);
     XuLyGiaoDien.OpenForm(this);
 }
Esempio n. 22
0
        private void mText_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && mText.Text != string.Empty)
            {
                O_GIAODICH        giaoDichO  = new O_GIAODICH();
                List <O_GIAODICH> giaoDichOs = new List <O_GIAODICH>();
                mText.Text = mText.Text.Replace("  ", " ");
                lines      = mText.Lines;
                D_SANBAY sbB = new D_SANBAY();
                for (int i = 0; i < lines.Length; i++)
                {
                    string[] Az;
                    switch (i)
                    {
                    case 0:
                        giaoDichO.MaCho = lines[0].Split('/')[0];
                        break;

                    default:
                        if (lines[i].Length < 3)
                        {
                            break;
                        }

                        if (giaoDichO.SoLuongVe == 0)
                        {
                            if (lines[i].Substring(0, 5).Contains(" ."))
                            {
                                Az                     = lines[i].Split('.')[1].TrimStart().Replace("  ", " ").Split(' ');
                                giaoDichO.Hang         = Az[0];
                                giaoDichO.SoHieuDi     = Az[0] + Az[1];
                                giaoDichO.LoaiVeDi     = Az[2];
                                giaoDichO.SoLuongVe    = 1;
                                giaoDichO.GioBayDi     = DateTime.ParseExact(Az[3] + DateTime.Now.Year + Az[6].Replace("#", string.Empty), "ddMMMyyyyHHmm", CultureInfo.InvariantCulture);
                                giaoDichO.GioBayDi_Den = DateTime.ParseExact(Az[3] + DateTime.Now.Year + Az[7].Replace("#", string.Empty), "ddMMMyyyyHHmm", CultureInfo.InvariantCulture);
                                giaoDichO.TuyenBayDi   = new D_TUYENBAY().TuyenBay(sbB.SanBay(Az[4].Substring(0, 3)).ID, sbB.SanBay(Az[4].Substring(3, 3)).ID).ID;
                                if (giaoDichO.TuyenBayDi == 0)
                                {
                                    XtraMessageBox.Show("Tuyến bay không tồn tại", "Thông báo"); return;
                                }
                            }
                        }
                        else
                        {
                            if (lines[i].Substring(0, 5).Contains(" ."))
                            {
                                Az = lines[i].Split('.')[1].TrimStart().Replace("  ", " ").Split(' ');
                                giaoDichO.SoHieuVe     = Az[0] + Az[1];
                                giaoDichO.LoaiVeVe     = Az[2];
                                giaoDichO.SoLuongVe    = 2;
                                giaoDichO.GioBayVe     = DateTime.ParseExact(Az[3] + DateTime.Now.Year + Az[6].Replace("#", string.Empty), "ddMMMyyyyHHmm", CultureInfo.InvariantCulture);
                                giaoDichO.GioBayVe_Den = DateTime.ParseExact(Az[3] + DateTime.Now.Year + Az[7].Replace("#", string.Empty), "ddMMMyyyyHHmm", CultureInfo.InvariantCulture);
                                giaoDichO.TuyenBayVe   = new D_TUYENBAY().TuyenBay(sbB.SanBay(Az[4].Substring(0, 3)).ID, sbB.SanBay(Az[4].Substring(3, 3)).ID).ID;
                                if (giaoDichO.TuyenBayVe == 0)
                                {
                                    XtraMessageBox.Show("Tuyến bay không tồn tại", "Thông báo"); return;
                                }
                            }
                            else if (lines[i].Contains("/"))
                            {
                                Az = lines[i].Split('-');
                                if (Az.Length == 3)
                                {
                                    giaoDichOs.Add(new O_GIAODICH()
                                    {
                                        TenKhach   = Az[0].TrimStart(),
                                        SoVeVN     = Az[1].Replace("/", string.Empty),
                                        GiaNet     = long.Parse(Az[2].Split('/')[1]),
                                        GiaHeThong = long.Parse(Az[2].Split('/')[1]),
                                        GiaThu     = long.Parse(Az[2].Split('/')[1]),
                                    });
                                }
                                else
                                {
                                    giaoDichOs.Add(new O_GIAODICH()
                                    {
                                        TenKhach   = Az[0].TrimStart(),
                                        SoVeVN     = (Az[1] + "-" + Az[2]).Replace("/", string.Empty),
                                        GiaNet     = long.Parse(Az[3].Split('/')[1]),
                                        GiaHeThong = long.Parse(Az[3].Split('/')[1]),
                                        GiaThu     = long.Parse(Az[3].Split('/')[1]),
                                    });
                                }
                            }
                        }
                        break;
                    }
                }
                chkDen.Checked       = giaoDichO.SoLuongVe == 2;
                giaoDichO.NVGiaoDich = DuLieuTaoSan.NV.ID;
                XuLyDuLieu.ConvertClassToTable(this, giaoDichO);
                DSGiaoDich.DataSource = giaoDichOs;
            }
        }
Esempio n. 23
0
 private void frmKPIHangMucThem_Load(object sender, EventArgs e)
 {
     XuLyDuLieu.ConvertClassToTable(this, kpi);
     XuLyGiaoDien.OpenForm(this);
     btnLuu2.Visible = DuLieuTaoSan.Q.ChinhSachThemSua;
 }