コード例 #1
0
        void ThemMoi()
        {
            DataRow row = TLctrl.NewRow();

            row["MaTL"]          = "";
            row["NgayTL"]        = dtpNgayTL.Value.Date;
            row["NgayTinhLai"]   = "01/01/1900";
            row["MaSoKU"]        = "";
            row["SoTienLaiTH"]   = 0;
            row["SoTienGoc"]     = 0;
            row["SoTienLaiQH"]   = 0;
            row["MaLoaiChungTu"] = "";
            row["TaiKhoanNo"]    = cmbTaiKhoanNo.SelectedValue;
            row["TaiKhoanCo"]    = cmbTaiKhoanNo.SelectedValue;


            TLctrl.Add(row);
            ThuLaiController ctrlThuLai = new ThuLaiController();

            if (ctrlThuLai.LayThuLai(txtSoButToan.Text) != null)
            {
                MessageBox.Show("Mã thu lãi này đã tồn tại !", "Thu Lai", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (ThamSo.LaSoNguyen(txtSoButToan.Text))
            {
                long so = Convert.ToInt64(txtSoButToan.Text);
                if (so >= ThamSo.LayMaTL())
                {
                    ThamSo.GanMaTNTL(so + 1);
                }
            }
        }
コード例 #2
0
        void ThemMoi()
        {
            DataRow row = TVctrl.NewRow();

            row["MaTV"]          = "";
            row["NgayTV"]        = dtpNgayTV.Value.Date;
            row["MaSoKU"]        = "";
            row["SoTienThu"]     = 0;
            row["SoTienGoc"]     = 0;
            row["SoTienConLai"]  = 0;
            row["MaLoaiChungTu"] = "LCT02";
            row["TaiKhoanNo"]    = null;
            row["TaiKhoanCo"]    = null;


            TVctrl.Add(row);
            ThuVonController ctrlthuvon = new ThuVonController();

            if (ctrlthuvon.LayThuVon(txtSoButToan.Text) != null)
            {
                MessageBox.Show("Mã thu vốn này đã tồn tại !", "Thu Von", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (ThamSo.LaSoNguyen(txtSoButToan.Text))
            {
                long so = Convert.ToInt64(txtSoButToan.Text);
                if (so >= ThamSo.LayMaTV())
                {
                    ThamSo.GanMaTNTL(so + 1);
                }
            }
        }