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; } } }
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); }
void NguoiThanKhach(bool IsIn = true) { if (IsIn) { if (!String.IsNullOrEmpty(_HoHang)) { string[] rows = _HoHang.Replace("\r\n", ",").Split(','); foreach (string row in rows) { if (!String.IsNullOrEmpty(row)) { string[] columns = row.Replace("\t", "|").Split('|'); DataRow dataRow = dt.NewRow(); dataRow["col1"] = columns[0]; dataRow["col2"] = columns[1]; dataRow["col3"] = columns[2]; dt.Rows.Add(dataRow); } } } GCNT.DataSource = dt; } else { _HoHang = ""; Regex digitsOnly = new Regex(@"[^\w\d\s]"); foreach (DataRow row in dt.Rows) { _HoHang += row[0] + "\t" + digitsOnly.Replace(XuLyDuLieu.NotVietKey(row[1].ToString()), "") + "\t" + row[2] + "\r\n"; } } }
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; }
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; }
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(); } }
string RanDomTen() { string[] Ho = new string[] { "NGUYEN", "TRAN", "LE", "PHAM", "HUYNH", "HOANG", "PHAN", "VU", "VO", "DANG", "BUI", "DO", "HO", "NGO", "DUONG", "LY" }; string[] Ten = new string[] { "Anh", "Bá", "Bách", "Bàng", "Bảo", "Bích", "Bổn", "Chi", "Cương", "Cường", "Dũng", "Duy", "Gia", "Giang", "Hà", "Hải", "Hòa", "Hoài", "Hoàng" }; return(Ho[new Random().Next(Ho.Count())] + " " + XuLyDuLieu.NotVietKey(Ten[new Random().Next(Ten.Count())].ToUpper()) + " VIET"); }
private void iMaSoThue_TextChanged(object sender, EventArgs e) { if (!XuLyDuLieu.IsNumeric(iMaSoThue.Text)) { iMaSoThue.Text = string.Empty; } }
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; }
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(); } }
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); }
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 btnLuu_Click(object sender, EventArgs e) { string NCC = string.Empty; if (_DataHangBay.Rows.Count > 0) { foreach (DataRow row in _DataHangBay.Rows) { NCC += row["ID"].ToString() + "|"; } } List <KiemTra> kiemTras = new List <KiemTra>(); kiemTras.Add(new KiemTra() { _Control = iTenDayDu, _Tu = 2, _Den = 50 }); kiemTras.Add(new KiemTra() { _Control = iTen, _Tu = 2, _Den = 50, _ChoQua = !_NCCD.DaTonTai("Ten", iTen.Text, _NCCO.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); dic.Add("HangBay", NCC); long CapNhatNum = (_NCCO.ID > 0) ? _NCCD.CapNhat(dic, _NCCO.ID) : _NCCD.ThemMoi(dic, true); if (XuLyGiaoDien.ThongBao(Text, CapNhatNum > 0)) { if (_NCCO.ID < 1) { List <Dictionary <string, object> > lstDicS = new List <Dictionary <string, object> >(); for (int i = 0; i < 180; i++) { dic = new Dictionary <string, object>(); dic.Add("NCCID", CapNhatNum); dic.Add("SoDuCuoi", 0); dic.Add("SoDuThucTe", 0); dic.Add("Ngay", "getdate() - " + i); lstDicS.Add(dic); } new D_SODU_HANG().ThemNhieu1Ban(lstDicS); } (Owner.ActiveMdiChild as frmHangBay).DuLieu(); Close(); } }
public static void KiemTra(List <KiemTra> lstThongBao, DXValidationProvider dx) { foreach (KiemTra ctl in lstThongBao) { if (ctl._ChoQuaThang) { dx.SetValidationRule(ctl._Control, new TextValidationRule(string.Empty, true)); } else if (ctl._Mail) { ctl._Control.Text = ctl._Control.Text ?? string.Empty; string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"; Regex re = new Regex(strRegex); if (ctl._Control.Text.Length > 9 && re.IsMatch(ctl._Control.Text.TrimEnd().TrimStart())) { dx.SetValidationRule(ctl._Control, new TextValidationRule(ctl._ThongBao2, ctl._ChoQua)); } else { dx.SetValidationRule(ctl._Control, new TextValidationRule("Mail không hợp lệ", false)); } } else if (ctl._SDT) { if (ctl._Control.Text.Length > 9) { if (XuLyDuLieu.IsNumeric(ctl._Control.Text.Replace("+", string.Empty))) { dx.SetValidationRule(ctl._Control, new TextValidationRule(ctl._ThongBao2, ctl._ChoQua)); } else { dx.SetValidationRule(ctl._Control, new TextValidationRule("Số điện thoại không hợp lệ", false)); } } else { dx.SetValidationRule(ctl._Control, new TextValidationRule("Ít nhất 10 kí tự", false)); } } else if (ctl._KiemTraChuoi) { int Te = ctl._Control.Text.Replace(" ", string.Empty).Replace("\r\n", "").Length; if (Te > ctl._Tu - 1 && ctl._Den + 1 > Te) { dx.SetValidationRule(ctl._Control, new TextValidationRule(ctl._ThongBao2, ctl._ChoQua)); } else { dx.SetValidationRule(ctl._Control, new TextValidationRule(string.Format("Nhập từ {0} đến {1}", ctl._Tu, ctl._Den), false)); } } } }
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); }
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(); }
private void simpleButton3_Click(object sender, EventArgs e) { List <KiemTra> kiemTras = new List <KiemTra>(); kiemTras.Add(new KiemTra() { _Control = iTenDangNhapCty, _Tu = 5, _Den = 30, _ChoQua = !_DaiLyD.DaTonTai("TenDangNhapCty", iTenDangNhapCty.Text, _KhachHangO.ID), _ThongBao2 = "Đã tồn tại" }); kiemTras.Add(new KiemTra() { _Control = txtMatKhauCty, _Tu = 5, _Den = 30, _ChoQuaThang = !txtMatKhauCty.Enabled }); 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); dic.Add("Ten", iTenDangNhapCty.Text); if (txtMatKhauCty.Enabled) { dic.Add("MatKhauCty", TMD5.TMd5Hash(txtMatKhauCty.Text)); } dic.Add("LoaiKhachHang", 0); NguoiThanKhach(false); dic.Add("ThongTinLienLac", _HoHang); long a = (_KhachHangO.ID > 0) ? _DaiLyD.CapNhat(dic, _KhachHangO.ID) : _DaiLyD.ThemMoi(dic, true); if (XuLyGiaoDien.ThongBao(Text, a > 0)) { if (_KhachHangO.ID < 1) { List <Dictionary <string, object> > lstDicS = new List <Dictionary <string, object> >(); for (int i = 0; i < 90; i++) { dic = new Dictionary <string, object>(); dic.Add("LoaiKhachHangSD", _KhachHangO.LoaiKhachHang); dic.Add("ChinhSachID", iChinhSach.EditValue); dic.Add("DaiLyID", a); dic.Add("Ngay", "getdate() - " + i); lstDicS.Add(dic); } new D_SODU_DAILY().ThemNhieu1Ban(lstDicS); } (Owner.ActiveMdiChild as frmNhanVien).DuLieu(); Close(); } }
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"; } } }
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(); }
private void btnLuu2_Click(object sender, EventArgs e) { Dictionary <string, object> dic = new Dictionary <string, object>(); dic = XuLyDuLieu.FormToDictionary(this, dic); dic.Add("NoiDung", txtMauEmail.Text); long CapNhatNum = (kpi.ID > 0) ? (kpid.CapNhat(dic, kpi.ID) > 0 ? kpi.ID : 0) : kpid.ThemMoi(dic, true); if (XuLyGiaoDien.ThongBao(Text, CapNhatNum > 0)) { (Owner.ActiveMdiChild as frmKPIHangMuc).TaiLaiKPI(); Close(); } }
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(); }
private void rDaBaoGia_KeyDown(object sender, KeyEventArgs e) { TextEdit z = (sender as TextEdit); string a = z.Text; if ((e.KeyCode == Keys.Enter) && Text.Length > 4) { if (XuLyDuLieu.IsNumeric(a)) { z.Text = string.Empty; hoaDonD.CapNhatTrangThai(z.Properties.Name.Substring(1), a.Replace(" ", string.Empty)); DuLieu(); } } }
private void btnLuu_Click(object sender, EventArgs e) { List <KiemTra> kiemTras = new List <KiemTra>(); kiemTras.Add(new KiemTra() { _Control = iTen, _Tu = 3, _Den = 30, }); kiemTras.Add(new KiemTra() { _Control = iNguoiDaiDienHD, _Tu = 3, _Den = 30, }); kiemTras.Add(new KiemTra() { _Control = iDiDong, _SDT = true, _ChoQua = !_DaiLyD.DaTonTai("DiDong", iDiDong.Text, _DaiLyO.ID, "AND LoaiKhachHang = 3"), _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); dic.Add("LoaiKhachHang", 3); long a = (_DaiLyO.ID > 0) ? _DaiLyD.CapNhat(dic, _DaiLyO.ID) : _DaiLyD.ThemMoi(dic, true); if (XuLyGiaoDien.ThongBao(Text, a > 0)) { if (Owner.ActiveMdiChild is frmKhachLe) { (Owner.ActiveMdiChild as frmKhachLe).DuLieu(); } else if (Owner is frmVeThem) { (Owner as frmVeThem).DuLieuKhachLe(a); } else { (Owner as frmKhachSanThem).DuLieuKhachLe(a); } Close(); } }
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; } }
void GhiChuCmt(object f) { if (long.Parse(f.ToString()) > 0) { string NoiDung = string.Format("{0}: {1}", f, XuLyDuLieu.GhiChuCMT(this)); Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("FormName", Text); dic.Add("MaCho", string.Empty); dic.Add("NoiDung", NoiDung); dic.Add("NVGiaoDich", DuLieuTaoSan.NV.ID); dic.Add("LoaiKhachHang", 0); dic.Add("Ma", 0); if (NoiDung.Length > 10) { new D_LS_GIAODICH().ThemMoi(dic); } } }
private void btnLuu2_Click(object sender, EventArgs e) { if (iDiem.Value == 0) { XuLyGiaoDien.ShowToolTip(iDiem, "Vui lòng cho điểm"); return; } Dictionary <string, object> dic = new Dictionary <string, object>(); dic = XuLyDuLieu.FormToDictionary(this, dic); dic.Add("NhanVien", _NhanVien); long CapNhatNum = (kpi.ID > 0) ? (kpid.CapNhat(dic, kpi.ID) > 0 ? kpi.ID : 0) : kpid.ThemMoi(dic, true); if (XuLyGiaoDien.ThongBao(Text, CapNhatNum > 0)) { (Owner as frmNhanVienThem).TaiLaiKPI(); Close(); } }
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(); }
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; } }
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; }
private void btnLuu_Click(object sender, EventArgs e) { List <KiemTra> kiemTras = new List <KiemTra>() { new KiemTra() { _Control = iNCC, _Tu = 2, _Den = 50 }, new KiemTra() { _Control = iLoaiGiaoDich, _Tu = 2, _Den = 50 }, new KiemTra() { _Control = iGhiChu, _Tu = 2, _Den = 50 }, new KiemTra() { _Control = iSoTien, _Tu = 2, _Den = 5000 } }; 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); if (XuLyGiaoDien.ThongBao(Text, _nCCGDO.ID != 0 ? (_nCCGDD.CapNhat(dic, _nCCGDO.ID) > 0) : (_nCCGDD.ThemMoi(dic) > 0))) { (Owner.ActiveMdiChild as frmHangBay).DuLieu(); Close(); } }