Example #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            int n = lstDaiLyz.CheckedItems.Count;

            if (n == 0)
            {
                XuLyGiaoDien.Alert("Chưa chọn đại lý tìm!", Form_Alert.enmType.Info);
            }
            else
            {
                if (!XuLyGiaoDien.wait.IsSplashFormVisible)
                {
                    XuLyGiaoDien.wait.ShowWaitForm();
                }
                string daily = string.Format("{0}", lstDaiLyz.CheckedItems[0]);
                for (int i = 1; i < n; i++)
                {
                    daily += string.Format(",{0}", lstDaiLyz.CheckedItems[i]);
                }
                lst = new D_HOADON().DuLieu(string.Format("CONVERT(date, NgayThucHien) BETWEEN '{0}' AND '{1}' AND MaHD <> '0' AND ((GiaYeuCau - GiaHeThong) * PhanTram / 100) > 0 AND IDKhachHang in ({2}) ORDER BY IDKhachHang,MaHD,MaCho,GiaHeThong Desc", bdtpTu.DateTime.ToString("yyyyMMdd"), bdtpDen.DateTime.ToString("yyyyMMdd"), daily));
                hoaDonOBindingSource.DataSource = lst;
                if (XuLyGiaoDien.wait.IsSplashFormVisible)
                {
                    XuLyGiaoDien.wait.CloseWaitForm();
                }
            }
        }
Example #2
0
        private void btnAddServer_Click(object sender, EventArgs e)
        {
            List <Dictionary <string, object> > lstdic = new List <Dictionary <string, object> >();

            for (int i = 0; i < _lstSIChinh.Count; i++)
            {
                if (lstSI.Where(w => w.SignIn.Equals(_lstSIChinh[i].SignIn)).Count() == 0)
                {
                    Dictionary <string, object> keyValues = new Dictionary <string, object>();
                    keyValues.Add("DaiLy", _lstSIChinh[i].DaiLy);
                    keyValues.Add("SignIn", _lstSIChinh[i].SignIn);
                    keyValues.Add("HangBay", _lstSIChinh[i].HangBay);
                    keyValues.Add("Chinh", _lstSIChinh[i].Chinh);
                    keyValues.Add("Khoa", _lstSIChinh[i].Khoa);
                    keyValues.Add("MatKhau", _lstSIChinh[i].MatKhau);
                    lstdic.Add(keyValues);
                }
                else
                {
                    XuLyGiaoDien.Alert("Đã tồn tại " + _lstSIChinh[i].SignIn, Form_Alert.enmType.Warning);
                }
            }
            if (lstdic.Count > 0)
            {
                if (new D_SIGNIN().ThemNhieu1Ban(lstdic) > 0)
                {
                    XuLyGiaoDien.Alert("Thêm sign in thành công", Form_Alert.enmType.Success);
                }
            }
        }
Example #3
0
        private void groupControl1_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
        {
            if (new int[] { 0, 1, 2, 3, 8 }.Contains(int.Parse(iLoaiKhachHang.EditValue.ToString())))
            {
                if ((iMaDL.Text ?? "").ToString().Length < 1 && iLoaiKhachHang.EditValue.ToString() == "8")
                {
                    XuLyGiaoDien.ShowToolTip(iMaDL, "Chọn nhà cung cấp");
                    return;
                }

                switch (e.Button.Properties.Caption)
                {
                case "Hoàn":
                    new frmNHVH(int.Parse(iMaDL.EditValue.ToString()), iLoaiKhachHang.EditValue.ToString() == "8", CTM.ID).ShowDialog(this);
                    break;

                case "Vé":
                    new frmNHV(int.Parse(iMaDL.EditValue.ToString()), iLoaiKhachHang.EditValue.ToString() == "8", CTM.ID).ShowDialog(this);
                    break;

                case "Cấn trừ KS":
                    new frmNHKSCT(iLoaiKhachHang.EditValue.ToString() == "8", CTM.ID).ShowDialog(this);
                    break;

                default:
                    new frmNHKS(int.Parse(iMaDL.EditValue.ToString()), iLoaiKhachHang.EditValue.ToString() == "8", CTM.ID).ShowDialog(this);
                    break;
                }
            }
            else
            {
                XuLyGiaoDien.ShowToolTip(iLoaiKhachHang, "Chọn nguồn tới không được hỗ trợ");
            }
        }
Example #4
0
 private void btnXuatExcel_Click(object sender, EventArgs e)
 {
     colDaiLyTT.GroupIndex = -1;
     XuLyGiaoDien.ExportExcel(GCSI, GVSI, "Cấp Sign-" + DateTime.Now.ToString("dd-MM-yyy"));
     colDaiLyTT.GroupIndex = 0;
     GVSI.ExpandAllGroups();
 }
Example #5
0
        private void btnFILE_Click(object sender, EventArgs e)
        {
            using (XtraOpenFileDialog xtraOpenFileDialog = new XtraOpenFileDialog())
            {
                xtraOpenFileDialog.Multiselect      = true;
                xtraOpenFileDialog.RestoreDirectory = true;
                if (xtraOpenFileDialog.ShowDialog() == DialogResult.OK)
                {
                    txtFileDinhKem.Properties.Tokens.Clear();
                    var filenames = xtraOpenFileDialog.FileNames;

                    foreach (var item in filenames)
                    {
                        string filename   = Path.GetFileName(item);
                        var    token_item = new TokenEditToken(filename + $" [{GetFileSizeFromFileNameURL(item)}]", item);
                        txtFileDinhKem.Properties.Tokens.Add(token_item);
                    }
                    try
                    {
                        txtFileDinhKem.EditValue             = string.Join(",", filenames);
                        txtFileDinhKem.Properties.PopupPanel = flyEmail;
                    }
                    catch (Exception ex)
                    {
                        XuLyGiaoDien.Alert(ex.Message, Form_Alert.enmType.Warning);
                    }
                }
            }
        }
Example #6
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;
 }
Example #7
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            string CoDe = string.Empty;

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    CoDe += row[0].ToString() + ", ";
                }
                CoDe = CoDe.Substring(0, CoDe.Length - 2);
            }

            D_KHOANGAY bus = new D_KHOANGAY();
            Dictionary <string, object> dic = new Dictionary <string, object>()
            {
                { "HoatDong", chkGD.Checked },
                { "Them", chkThem.Checked },
                { "Sua", chkSua.Checked },
                { "Xoa", chkXoa.Checked },
                { "NganHang", chkNH.Checked },
                { "Code", CoDe },
                { "ThemNH", chkThemNH.Checked },
                { "SuaNH", chkSuaNH.Checked },
                { "XoaNH", chkXoaNH.Checked },
            };

            if (XuLyGiaoDien.ThongBao(Text + " sửa", bus.CapNhat(dic, _KhoaNgayO.MaNgay, "WHERE MaNgay = {0}") > 0))
            {
                chkGD.Checked = chkNH.Checked = chkSua.Checked = chkThem.Checked = chkXoa.Checked = chkSuaNH.Checked = chkThemNH.Checked = chkXoaNH.Checked = false;
                dt.Clear();
                GM.Enabled = false;
                DuLieu();
            }
        }
Example #8
0
        private void groupControl3_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
        {
            D_GIAODICH giaoDichD = new D_GIAODICH();
            List <Dictionary <string, object> > lstDicS = new List <Dictionary <string, object> >();
            List <string> lstTb   = new List <string>();
            List <string> lstCTV  = new List <string>();
            List <string> lstThem = new List <string>();

            lstThem.Add("S");
            lstThem.Add("S");
            lstThem.Add("T");
            lstTb.Add("GIAODICH");
            lstTb.Add("GIAODICH");
            lstTb.Add("LS_GIAODICH");
            if (!XuLyGiaoDien.wait.IsSplashFormVisible)
            {
                XuLyGiaoDien.wait.ShowWaitForm();
            }
            List <O_GIAODICH> sss = lstGDR4.Where(w => w.GhiChu.Contains("Khác kì") || w.GhiChu.Contains("Khác ngày")).ToList();

            for (int i = 0; i < sss.Count(); i += 2)
            {
                XuLyGiaoDien.wait.SetWaitFormDescription(string.Format("Đang chỉnh ngày GD {0}/{1}", i, sss.Count()));
                Thread.Sleep(10);
                O_GIAODICH gd  = sss[i];
                O_GIAODICH gd2 = sss[i + 1];
                Dictionary <string, object> dicS  = new Dictionary <string, object>();
                Dictionary <string, object> dicS3 = new Dictionary <string, object>();
                dicS3.Add("NgayGD", gd2.NgayGD);
                lstCTV.Add(string.Format("WHERE ID = {0}", gd2.ID));
                lstDicS.Add(dicS3);

                dicS.Add("NgayGD", gd.NgayGD);
                lstCTV.Add(string.Format("WHERE ID = {0}", gd.ID));
                lstDicS.Add(dicS);

                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("FormName", "Tự động");
                dic.Add("MaCho", gd.SoVeVN);
                dic.Add("NoiDung", "[Vé hoàn]: Chỉnh ngày bằng so sánh VN");
                dic.Add("NVGiaoDich", DuLieuTaoSan.NV.ID);
                dic.Add("LoaiKhachHang", 0);
                dic.Add("Ma", 0);
                lstCTV.Add(string.Empty);
                lstDicS.Add(dic);

                if (lstDicS.Count == 3)
                {
                    giaoDichD.CapNhat_ThemNhieu(lstDicS, lstTb, lstCTV, lstThem);
                    lstDicS.Clear();
                    lstCTV.Clear();
                }
            }

            XuLyGiaoDien.ExportExcel(gridControl4, gridView8, "ExHoan-" + DateTime.Now.ToString("dd-MM-yyy"));
            if (XuLyGiaoDien.wait.IsSplashFormVisible)
            {
                XuLyGiaoDien.wait.CloseWaitForm();
            }
        }
Example #9
0
 private void frmKhachLeNo_Load(object sender, EventArgs e)
 {
     XuLyGiaoDien.OpenForm(this);
     nganHangOBindingSource.DataSource = new D_NGANHANG().All();
     DSNhanVien.DataSource             = new D_DAILY().All();
     LayDLCTNganHang();
 }
Example #10
0
        private void btnDongY_Click(object sender, EventArgs e)
        {
            List <KiemTra> kiemTras = new List <KiemTra>()
            {
                new KiemTra()
                {
                    _Control = txtMatKhauCu, _ChoQuaThang = TMD5.TMd5Hash(txtMatKhauCu.Text) == DuLieuTaoSan.NV.MatKhauCty, _ThongBao2 = "Mật khẩu sai"
                },
                new KiemTra()
                {
                    _Control = txtMatKhauMoi
                },
                new KiemTra()
                {
                    _Control = iMatKhauCty, _ChoQuaThang = iMatKhauCty.Text == txtMatKhauMoi.Text, _ThongBao2 = "Mật khẩu mới không khớp"
                }
            };

            XuLyGiaoDien.KiemTra(kiemTras, dxValidationProvider1);
            if (!dxValidationProvider1.Validate())
            {
                XuLyGiaoDien.Alert("Thông tin không hợp lệ", Form_Alert.enmType.Warning);
                return;
            }

            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("MatKhauCty", TMD5.TMd5Hash(iMatKhauCty.Text));

            if (XuLyGiaoDien.ThongBao(Text, new D_DAILY().CapNhat(dic, DuLieuTaoSan.NV.ID) > 0))
            {
                Close();
            }
        }
        private void btnLuu2_Click(object sender, EventArgs e)
        {
            if (!checkEdit2.Checked && _TinhTrangO.ID < 1)
            {
                XtraMessageBox.Show("Nếu muốn thêm mới vui lòng chọn vào [Thêm]", "Thông báo");
                return;
            }

            List <KiemTra> kiemTras = new List <KiemTra>();

            kiemTras.Add(new KiemTra()
            {
                _Control = iTenTrangThai, _Tu = 3, _Den = 30, _ChoQua = !(_ListTinhTrangO.Where(w => w.TenTrangThai.Equals(iTenTrangThai.Text) && !w.ID.Equals(checkEdit2.Checked ? 0 : _TinhTrangO.ID)).Count() > 0), _ThongBao2 = "Giá trị này đã tồn tại"
            });

            XuLyGiaoDien.KiemTra(kiemTras, dxValidationProvider1);
            if (!dxValidationProvider1.Validate())
            {
                XuLyGiaoDien.Alert("Thông tin không hợp lệ", Form_Alert.enmType.Warning);
                return;
            }

            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("TenTrangThai", iTenTrangThai.Text);
            dic.Add("LoaiKhachHang", _LoaiKhachHang);
            long a = !checkEdit2.Checked ? _TinhTrangD.CapNhat(dic, _TinhTrangO.ID) : _TinhTrangD.ThemMoi(dic, true);

            if (XuLyGiaoDien.ThongBao("Tình trạng " + (checkEdit1.Checked ? "thêm" : "sửa"), a > 0))
            {
                _ListTinhTrangO = _TinhTrangD.DuLieu(_LoaiKhachHang, false);
                trangThaiOBindingSource.DataSource = _ListTinhTrangO;
                (Owner.ActiveMdiChild as frmDaiLy).DuLieu();
            }
        }
Example #12
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);
 }
        private void btnLuu_Click(object sender, EventArgs e)
        {
            List <KiemTra> kiemTras = new List <KiemTra>();

            kiemTras.Add(new KiemTra()
            {
                _Control = iKhachSan, _Tu = 1, _Den = 50
            });
            kiemTras.Add(new KiemTra()
            {
                _Control = iMaCho, _Tu = 1, _Den = 50
            });
            kiemTras.Add(new KiemTra()
            {
                _Control = iIDKhachHang, _Tu = 1, _Den = 50
            });
            XuLyGiaoDien.KiemTra(kiemTras, dxValidationProvider1);
            if (!dxValidationProvider1.Validate())
            {
                XuLyGiaoDien.Alert("Thông tin không hợp lệ", Form_Alert.enmType.Warning);
                return;
            }
            Dictionary <string, object> dic = new Dictionary <string, object>();


            dic = XuLyDuLieu.FormToDictionary(this, dic);
            XulyDuLieuTruocKhiThem(dic);
        }
        void XulyDuLieuTruocKhiThem(Dictionary <string, object> Dic)
        {
            long a = 0;
            List <Dictionary <string, object> > lstDicS = new List <Dictionary <string, object> >();
            List <string> lstCTV = new List <string>();

            for (int i = 0; i < GaVGD.RowCount; i++)
            {
                Dictionary <string, object> dicS = new Dictionary <string, object>(Dic);
                for (int y = 0; y < GaVGD.Columns.Count; y++) //Dòng
                {
                    if (GaVGD.Columns[y].Visible)             //Cột
                    {
                        object G = GaVGD.GetRowCellValue(i, GaVGD.Columns[y]);
                        dicS.Add(GaVGD.Columns[y].FieldName, G);
                    }
                    else if (y == GaVGD.Columns.Count - 1)
                    {
                        object G = GaVGD.GetRowCellValue(i, GaVGD.Columns[y]);
                        lstCTV.Add(string.Format("WHERE ID = {0}", G));
                        lstDicS.Add(dicS);
                    }
                }
            }

            a = (_ks.ID > 0) ? _ksD.SuaNhieu1Ban(lstDicS, lstCTV) : _ksD.ThemNhieu1Ban(lstDicS);
            if (XuLyGiaoDien.ThongBao(Text, a == lstDicS.Count))
            {
                GhiChuCmt(_ks.ID);
                (Owner.ActiveMdiChild as frmKhachSan).DuLieu();
                Close();
            }
        }
Example #15
0
 private void grvGiaoDich_DoubleClick(object sender, EventArgs e)
 {
     if (DuLieuTaoSan.Q.TienMatThemSua)
     {
         cTNgan = (GVCTTM.GetRow(GVCTTM.GetSelectedRows()[0]) as O_CTNGANHANG);
         int Ma = cTNgan.ID;
         if (cTNgan.LoaiGiaoDich == 23 || cTNgan.LoaiGiaoDich == 24)
         {
             List <O_CTNGANHANG> cTNganHangOs = _listCTNganHangO.Where(w => w.MaLienKet.Equals(cTNgan.MaLienKet)).ToList();
             if (cTNganHangOs.Count == 2)
             {
                 Ma = cTNgan.ID == cTNganHangOs[0].ID ? Ma : cTNganHangOs[0].ID;
                 Ma = cTNgan.ID == cTNganHangOs[1].ID ? Ma : cTNganHangOs[1].ID;
                 new frmNHCTThem(cTNgan, Ma).ShowDialog(ParentForm);
             }
             else
             {
                 XuLyGiaoDien.Alert("Sai định dạng!", Form_Alert.enmType.Warning);
             }
         }
         else
         {
             new frmNHCTThem(cTNgan, 0).ShowDialog(ParentForm);
         }
     }
 }
Example #16
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            List <KiemTra> kiemTras = new List <KiemTra>();

            kiemTras.Add(new KiemTra()
            {
                _Control = iTenHang, _Tu = 5, _Den = 30,
            });
            kiemTras.Add(new KiemTra()
            {
                _Control = iTenTat, _Tu = 2, _Den = 5, _ChoQua = !_HangBayD.DaTonTai("TenTat", iTenTat.Text, _HangBay.ID), _ThongBao2 = "Đã tồn tại"
            });

            XuLyGiaoDien.KiemTra(kiemTras, dxValidationProvider1);
            if (!dxValidationProvider1.Validate())
            {
                XuLyGiaoDien.Alert("Thông tin không hợp lệ", Form_Alert.enmType.Warning);
                return;
            }

            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic = XuLyDuLieu.FormToDictionary(this, dic);
            long a = (_HangBay.ID > 0) ? _HangBayD.CapNhat(dic, _HangBay.ID) : _HangBayD.ThemMoi(dic, true);

            if (XuLyGiaoDien.ThongBao(Text, a > 0))
            {
                (Owner.ActiveMdiChild as frmHangBay).DuLieu();
                Close();
            }
        }
Example #17
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;
        }
Example #18
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            List <KiemTra> kiemTras = new List <KiemTra>()
            {
                new KiemTra()
                {
                    _Control = iSignIn, _Tu = 2, _Den = 20, _ChoQua = !new D_SIGNIN().DaTonTai(string.Format("WHERE SignIn='{0}' AND ID <> {1}", iSignIn.Text, _SignInO.ID)), _ThongBao2 = "Đã tồn tại"
                }
            };

            XuLyGiaoDien.KiemTra(kiemTras, dxValidationProvider1);
            if (!dxValidationProvider1.Validate())
            {
                XuLyGiaoDien.Alert("Thông tin không hợp lệ", Form_Alert.enmType.Warning);
                return;
            }
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic = XuLyDuLieu.FormToDictionary(this, dic);
            long CapNhatNum = (_SignInO.ID > 0) ? (_SignInD.CapNhat(dic, _SignInO.ID) > 0 ? _SignInO.ID : 0) : _SignInD.ThemMoi(dic, true);

            if (XuLyGiaoDien.ThongBao(Text, CapNhatNum > 0))
            {
                if (Owner is frmSignIn)
                {
                    (Owner as frmSignIn).TaiLaiSignIn();
                }
                Close();
            }
        }
Example #19
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (lstDaiLy.CheckedItems.Count == 0)
     {
         XuLyGiaoDien.Alert("Vui lòng nhập đầy đủ thông tin", Form_Alert.enmType.Info);
     }
     else
     {
         if (!XuLyGiaoDien.wait.IsSplashFormVisible)
         {
             XuLyGiaoDien.wait.ShowWaitForm();
         }
         //simpleButton1.Text = "Cần chạy lại: " + daiLyD.DemNgayPhiSai().ToString();
         D_GIAODICH gdb   = new D_GIAODICH();
         string     daily = string.Format("{0}", lstDaiLy.CheckedItems[0]);
         int        n     = lstDaiLy.CheckedItems.Count;
         for (int i = 1; i < n; i++)
         {
             daily += string.Format(",{0}", lstDaiLy.CheckedItems[i]);
         }
         giaoDichOBindingSource.DataSource = gdb.LayDanhSachCN((DateTime)dtpTuNgay.EditValue, (DateTime)dtpDenNgay.EditValue, daily);
         if (giaoDichOBindingSource.DataSource != null)
         {
             btnGuiMail.Enabled = true;
             btnExcel.Enabled   = true;
         }
         if (XuLyGiaoDien.wait.IsSplashFormVisible)
         {
             XuLyGiaoDien.wait.CloseWaitForm();
         }
     }
 }
Example #20
0
        private void LinkClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                string Chinh = e.Item.Name.ToString();
                if (ModifierKeys == Keys.Control && Chinh == "DaiLy")
                {
                }
                else
                {
                    foreach (var form in MdiChildren.Where(frm => frm.GetType().Name == "frm" + Chinh))
                    {
                        form.Activate();
                        return;
                    }
                }

                XuLyGiaoDien.wait.ShowWaitForm();
                var f = Activator.CreateInstance(Type.GetType(string.Format("CRM.frm{0}", Chinh), true)) as XtraForm;
                f.MdiParent = this;
                f.Text      = e.Item.Caption;
                f.Show();
                GridViewHelper.SetFromGrid(f);
                XuLyGiaoDien.FlushMemory();
            }
            catch
            {
                XtraMessageBox.Show("Chức năng chưa được tích hợp hoặc đang bảo trì");
            }
            if (XuLyGiaoDien.wait.IsSplashFormVisible)
            {
                XuLyGiaoDien.wait.CloseWaitForm();
            }
        }
Example #21
0
 void ChinhSua()
 {
     if (DuLieuTaoSan.Q.NganHangThemSua)
     {
         cTNgan = (GVCTNH.GetRow(GVCTNH.GetSelectedRows()[0]) as O_CTNGANHANG);
         int Ma = cTNgan.ID;
         if (cTNgan.LoaiGiaoDich == 23 || cTNgan.LoaiGiaoDich == 24)
         {
             List <O_CTNGANHANG> cTNganHangOs = _listCTNganHangO.Where(w => (w.MaLienKet ?? string.Empty).Equals(cTNgan.MaLienKet)).ToList();
             if (cTNganHangOs.Count == 2)
             {
                 Ma = cTNgan.ID == cTNganHangOs[0].ID ? Ma : cTNganHangOs[0].ID;
                 Ma = cTNgan.ID == cTNganHangOs[1].ID ? Ma : cTNganHangOs[1].ID;
                 new frmNHCTThem(cTNgan, Ma).ShowDialog(ParentForm);
             }
             else
             {
                 XuLyGiaoDien.Alert("Sai định dạng", Form_Alert.enmType.Info);
             }
         }
         else
         {
             new frmNHCTThem(cTNgan, 0).ShowDialog(ParentForm);
         }
     }
 }
Example #22
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;
 }
Example #23
0
        private void btnXoa_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            _KhachSanO = GVGD.GetRow(GVGD.GetSelectedRows()[0]) as O_KHACHSAN;
            List <object>     lstCtv = new List <object>();
            List <O_KHACHSAN> lst    = __ListKhachSanO.Where(w => w.MaCho.Equals(_KhachSanO.MaCho) && w.IDKhachHang.Equals(_KhachSanO.IDKhachHang) && w.NgayGD.ToString("ddMMyyy").Equals(_KhachSanO.NgayGD.ToString("ddMMyyy"))).ToList();

            bool ThanhCong = false;

            if (lst.Count == 1)
            {
                DialogResult dc = XtraMessageBox.Show("Bạn muốn xóa giao dịch ?", "Câu hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                switch (dc)
                {
                case DialogResult.Yes:
                    ThanhCong = _KhachSanD.Xoa(_KhachSanO.ID) > 0;
                    break;

                default:
                    return;
                }
            }
            else
            {
                DialogResult dc = XtraMessageBox.Show("Bạn muốn xóa tất cả giao dịch cùng Mã Chỗ ?", "Câu hỏi", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                switch (dc)
                {
                case DialogResult.Yes:
                    foreach (O_KHACHSAN gdoz in lst)
                    {
                        lstCtv.Add(gdoz.ID);
                    }
                    ThanhCong = _KhachSanD.XoaNhieu1Ban(lstCtv) > 0;
                    break;

                case DialogResult.No:
                    ThanhCong = _KhachSanD.Xoa(_KhachSanO.ID) > 0;
                    break;

                default:
                    return;
                }
            }

            if (XuLyGiaoDien.ThongBao(Text, ThanhCong, true))
            {
                string NoiDung = string.Empty;
                NoiDung = string.Format("Xóa {0} GD với tổng giá hệ thống là {1} \r\n", lst.Count(), lst.Sum(w => w.GiaHeThong).ToString("#,###"));
                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("FormName", Text);
                dic.Add("MaCho", _KhachSanO.MaCho);
                dic.Add("NoiDung", NoiDung);
                dic.Add("NVGiaoDich", DuLieuTaoSan.NV.ID);
                dic.Add("LoaiKhachHang", 1);
                dic.Add("Ma", _KhachSanO.IDKhachHang);
                new D_LS_GIAODICH().ThemMoi(dic);
                new D_DAILY().ChayLaiPhi(_KhachSanO.NgayGD);
                DuLieu();
            }
        }
Example #24
0
 private void frmNHKSCT_Load(object sender, EventArgs e)
 {
     XuLyGiaoDien.OpenForm(this);
     khachSanOBindingSource.DataSource = new D_KHACHSAN().DuLieuKSBL(_nCC);
     nCCOBindingSource.DataSource      = new D_NHACUNGCAP().DuLieu(true);
     daiLyOBindingSource.DataSource    = new D_DAILY().All();
     GVDSC.BestFitColumns();
 }
 private void frmNhomKhachHang_Load(object sender, EventArgs e)
 {
     _ListNhomDaiLyO = _NhomDaiLyD.DuLieu(_LoaiKhachHang);
     nhomKhachHangOBindingSource.DataSource = _ListNhomDaiLyO;
     _ListTinhTrangO = _TinhTrangD.DuLieu(_LoaiKhachHang, false);
     trangThaiOBindingSource.DataSource = _ListTinhTrangO;
     XuLyGiaoDien.OpenForm(this);
 }
Example #26
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;
 }
Example #27
0
        private void frmQuyAGS_Load(object sender, EventArgs e)
        {
            RegistryKey RegKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main", true);

            RegKey.SetValue("Display Inline Images", "yes");

            XuLyGiaoDien.OpenForm(this);
        }
Example #28
0
 private void frmSoDuHang_Load(object sender, EventArgs e)
 {
     iTN.Properties.MinValue            = iTN.DateTime = DateTime.Now.AddDays(-30);
     iDN.DateTime                       = DateTime.Now;
     soDuDaiLyOBindingSource.DataSource = _SODU_DAILYD.DuLieu(IDDaiLy, new DateTime(2019, 01, 01), DateTime.Now);
     XuLyGiaoDien.OpenForm(this);
     btn.Visible = DuLieuTaoSan.Q.ChinhSachThemSua;
 }
Example #29
0
 private void frmNHKS_Load(object sender, EventArgs e)
 {
     XuLyGiaoDien.OpenForm(this);
     colGiaThu.FieldName = _nCC ? "GiaNet" : "GiaHeThong";
     khachSanOBindingSource.DataSource = new D_KHACHSAN().DuLieuKS(_nCC, _NCC);
     nCCOBindingSource.DataSource      = new D_NHACUNGCAP().DuLieu(true);
     daiLyOBindingSource.DataSource    = new D_DAILY().All();
     GVDSC.BestFitColumns();
 }
Example #30
0
 private void frmNHVH_Load(object sender, EventArgs e)
 {
     XuLyGiaoDien.OpenForm(this);
     colGiaHoan.FieldName = _nCC ? "HangHoan" : "GiaHoan";
     giaoDichOBindingSource.DataSource = new D_GIAODICH().DuLieuVeHoan(_nCC, _NCC);
     nCCOBindingSource.DataSource      = new D_NHACUNGCAP().DuLieu(true);
     daiLyOBindingSource.DataSource    = new D_DAILY().All();
     GVDSC.BestFitColumns();
 }