private void gridCtNganHang_Click(object sender, EventArgs e) { if (GVCTNH.RowCount > 0) { cTNgan = (GVCTNH.GetRow(GVCTNH.GetSelectedRows()[0]) as O_CTNGANHANG); } }
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); } } }
private void grvCtNganHang_RowCellStyle(object sender, RowCellStyleEventArgs e) { try { GridView View = sender as GridView; if (e.RowHandle >= 0) { O_CTNGANHANG dl = View.GetRow(e.RowHandle) as O_CTNGANHANG; if (e.Column.FieldName == "TrangThaiID") { if (dl.TrangThaiID) { e.Appearance.BackColor = Color.Green; } else { e.Appearance.BackColor = Color.Crimson; } } if (e.Column.FieldName == "LoaiGiaoDich") { if (dl.LoaiGiaoDich == 8) { e.Appearance.BackColor = Color.Silver; } else if (dl.LoaiGiaoDich == 12) { e.Appearance.BackColor = Color.Gold; } } } } catch { } }
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); } } }
public frmInVe(O_CTNGANHANG dr) { InitializeComponent(); if (dr == null) { return; } nhanVienOBindingSource.DataSource = new D_DAILY().NhanVien(); if (dr.LoaiKhachHang < 3) { O_DAILY dl = new D_DAILY().LayDaiLy(true, dr.MaDL.ToString()); txtHoTen.Text = dl.Ten; if (dl.DiaChiHD != string.Empty) { txtDiaChi.Text = dl.DiaChiHD; } txtLyDo.Text = new D_LOAIGIAODICH().DuLieu_NganHang_TheoLoai(dr.LoaiKhachHang, false).Where(w => w.ID.Equals(dr.LoaiGiaoDich)).ToList()[0].Name + " ngày " + dr.NgayGD.ToString("dd/MM/yyyy"); } else { txtLyDo.Text = dr.GhiChu; } txtID.Value = dr.ID; dtpNgayLap.EditValue = DateTime.Now; txtSoTien.EditValue = dr.SoTien > 0 ? dr.SoTien : 0 - dr.SoTien; txtNguoiLap.EditValue = dr.NVGiaoDich; }
private void btnPri_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (GVCTTM.RowCount > 0) { cTNgan = (GVCTTM.GetRow(GVCTTM.GetSelectedRows()[0]) as O_CTNGANHANG); new frmInVe(cTNgan).ShowDialog(); } }
public frmNHCTThem(bool isTienMat) { InitializeComponent(); CTM = new O_CTNGANHANG(); CTM.NgayGD = CTM.NgayHT = CTM.NgayTT = DateTime.Now; CTM.NganHangID = isTienMat ? 1 : 0; iNganHangID.Enabled = !isTienMat; groupControl1.Enabled = false; }
public frmNHCTThem(O_CTNGANHANG ct, int MaLienKet) { InitializeComponent(); CTM = ct; iMaDL.Enabled = iLoaiGiaoDich.Enabled = iLoaiKhachHang.Enabled = ct.LoaiKhachHang != 7; iNganHangID.Enabled = false; ID = MaLienKet; List <O_BAOCAOCTNH> g = new D_BAOCAOCTNH().DuLieu(CTM.ID); foreach (O_BAOCAOCTNH gz in g) { O_BAOCAOCTNH gza = gz; _GiaoDich.Add(gza); _GiaoDichOLD.Add(gza); } baoCaoCTNHOBindingSource.DataSource = _GiaoDich; }
private void btnDel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (XtraMessageBox.Show("Bạn có chắc xóa", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel) { return; } cTNgan = (GVCTNH.GetRow(GVCTNH.GetSelectedRows()[0]) as O_CTNGANHANG); D_CTNGANHANG nh = new D_CTNGANHANG(); List <object> lstCtv = new List <object>(); if (cTNgan.LoaiKhachHang == 7) { List <O_CTNGANHANG> cTNganHangOs = new D_CTNGANHANG().Dem($"WHERE MaLienKet = '{cTNgan.MaLienKet}'"); if (cTNganHangOs.Count == 2) { lstCtv.Add(cTNganHangOs[0].ID); lstCtv.Add(cTNganHangOs[1].ID); } else { XuLyGiaoDien.Alert("Sai định dạng", Form_Alert.enmType.Info); return; } } else { lstCtv.Add(cTNgan.ID); new D_BAOCAOCTNH().Xoa(cTNgan.ID, "WHERE IDCTNganHang = {0}"); } if (XuLyGiaoDien.ThongBao(Text, nh.XoaNhieu1Ban(lstCtv, "CTNGANHANG") > 0, true)) { if (cTNgan.LoaiKhachHang == 1 || cTNgan.LoaiKhachHang == 2) { new D_DAILY().ChayLaiPhi(cTNgan.NgayHT); } else if (cTNgan.LoaiKhachHang == 4 || cTNgan.LoaiKhachHang == 30) { List <O_GIAODICH> _GiaoDich = new D_GIAODICH().DuLieuNganHang(cTNgan.IDGiaoDich); List <Dictionary <string, object> > lstdic2 = new List <Dictionary <string, object> >(); List <string> CTV = new List <string>(); Dictionary <string, object> dic2 = new Dictionary <string, object>(); for (int i = 0; i < _GiaoDich.Count; i++) { O_GIAODICH gd = _GiaoDich[i]; dic2 = new Dictionary <string, object>(); CTV.Add(string.Format("WHERE ID = {0}", gd.ID)); dic2.Add("Khoa", false); lstdic2.Add(dic2); } new D_GIAODICH().SuaNhieu1Ban(lstdic2, CTV); } nhD.ChayLaiSD(); string NoiDung = string.Format("Xóa GD Ngân Hàng : {0} VNĐ [{1}]", cTNgan.SoTien.ToString("#,###"), cTNgan.GhiChu); Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("FormName", Text); dic.Add("MaCho", cTNgan.MaLienKet); dic.Add("NoiDung", NoiDung); dic.Add("NVGiaoDich", DuLieuTaoSan.NV.ID); dic.Add("LoaiKhachHang", cTNgan.LoaiKhachHang); dic.Add("Ma", cTNgan.MaDL); if (NoiDung.Length > 10) { new D_LS_GIAODICH().ThemMoi(dic); } TaiLaiDuLieu(); } }