示例#1
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);
         }
     }
 }
示例#2
0
 private void gridCtNganHang_Click(object sender, EventArgs e)
 {
     if (GVCTTM.RowCount > 0)
     {
         cTNgan = (GVCTTM.GetRow(GVCTTM.GetSelectedRows()[0]) as O_CTNGANHANG);
     }
 }
示例#3
0
 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();
     }
 }
示例#4
0
        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 = (GVCTTM.GetRow(GVCTTM.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);
                }
                new D_NGANHANG().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();
            }
        }