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); } } }
//public void HienThiComboboxTheoMaKheuoc(NumericUpDown numSoTienLaiTH,NumericUpDown numSoTienLaiQH, String MaSoKU) //{ // DataTable tbl = new HoSoKheUocLayer().LayHoSoKheUocTheoMa(MaSoKU); // //DataTable tbl1 = new LaiSuatPlayer().LayLaiSuat(MaLaiSuat); // if (tbl.Rows.Count > 0) // { // //cmbSoTaiKhoan.Text = tbl.Rows[0]["TKChoVay"].ToString(); // dtpNgayTinhLai.Text = tbl.Rows[0]["NgayTinhLai"].ToString(); // numSoTienGoc.Text = tbl.Rows[0]["SoTienHienTai"].ToString(); // cmbTaiKhoanNo.Text = tbl.Rows[0]["ThuLai"].ToString(); // cmbTaiKhoanCo.Text = tbl.Rows[0]["ThuLai"].ToString(); // } // //catch { } //} public void HienThiComboboxTheoMaKheuocTL(TextBox txtSoTienLaiQH, TextBox txtSoTienLaiTH, DateTimePicker dtpNgayTinhLai, NumericUpDown numSoTienGoc, ComboBox cmbTaiKhoanNo, ComboBox cmbTaiKhoanCo, String MaSoKU) { DataTable tbl = new HoSoKheUocLayer().LayHoSoKheUocTheoMa(MaSoKU); if (tbl.Rows.Count > 0) { //cmbSoTaiKhoan.Text = tbl.Rows[0]["TKChoVay"].ToString(); dtpNgayTinhLai.Text = tbl.Rows[0]["NgayTinhLai"].ToString(); numSoTienGoc.Text = tbl.Rows[0]["SoTienHienTai"].ToString(); cmbTaiKhoanNo.SelectedValue = tbl.Rows[0]["ThuLai"].ToString(); cmbTaiKhoanCo.SelectedValue = tbl.Rows[0]["ThuLai"].ToString(); //ThuLaiController tl = new ThuLaiController(); //String tinhlai = Convert.ToString(tl.TinhLai(MaSoKU)); //numSoTienLaiTH.Value = Convert.ToInt64(tinhlai); ThuLaiController tlctrol = new ThuLaiController(); //String s_MaSoKU = Convert.ToString(cm).Trim(); txtSoTienLaiTH.Text = Convert.ToString(tlctrol.TinhLai(MaSoKU)); txtSoTienLaiQH.Text = Convert.ToString(tlctrol.TinhLaiQH(MaSoKU)); } //catch { } }
public frmThuLai(ThuLaiController ctrltl) : this() { this.TLctrl = ctrltl; status = ThamSo.Controll.Normal; }