private void btnXoaBienLai_Click(object sender, EventArgs e) { pTC_BienLaiThuTienInfo = new TC_BienLaiThuTienInfo(); oBTC_BienLaiThuTien = new cBTC_BienLaiThuTien(); if (grvSinhVien.FocusedRowHandle >= 0) { if ((bool)grvSinhVien.GetDataRow(grvSinhVien.FocusedRowHandle)["DaThuTien"]) { if (ThongBaoChon("Bạn chắc chắn muốn xóa?") == DialogResult.Yes) { try { pTC_BienLaiThuTienInfo.TC_BienLaiThuTienID = int.Parse(grvSinhVien.GetDataRow(grvSinhVien.FocusedRowHandle)["TC_BienLaiThuTienID"].ToString()); oBTC_BienLaiThuTien.Delete(pTC_BienLaiThuTienInfo); drSinhVien["DaThuTien"] = false; drSinhVien["SoTien"] = 0; } catch { XoaThatBai(); } } } else { ThongBao("Sinh viên chưa nộp tiền!"); } } else { ThongBao("Chưa chọn sinh viên!"); } }
public void Update(TC_BienLaiThuTienInfo pTC_BienLaiThuTienInfo) { ArrayList colParam = new ArrayList(); colParam.Add(CreateParam("@IDSV_SinhVien", SqlDbType.Int, pTC_BienLaiThuTienInfo.IDSV_SinhVien)); colParam.Add(CreateParam("@IDDM_Lop", SqlDbType.Int, pTC_BienLaiThuTienInfo.IDDM_Lop)); colParam.Add(CreateParam("@IDDM_NamHoc", SqlDbType.Int, pTC_BienLaiThuTienInfo.IDDM_NamHoc)); colParam.Add(CreateParam("@HocKy", SqlDbType.Int, pTC_BienLaiThuTienInfo.HocKy)); colParam.Add(CreateParam("@PhieuThu", SqlDbType.Bit, pTC_BienLaiThuTienInfo.PhieuThu)); colParam.Add(CreateParam("@SoPhieu", SqlDbType.NVarChar, pTC_BienLaiThuTienInfo.SoPhieu)); colParam.Add(CreateParam("@NgayThu", SqlDbType.DateTime, pTC_BienLaiThuTienInfo.NgayThu)); colParam.Add(CreateParam("@NoiDung", SqlDbType.NVarChar, pTC_BienLaiThuTienInfo.NoiDung)); colParam.Add(CreateParam("@SoTien", SqlDbType.Money, pTC_BienLaiThuTienInfo.SoTien)); colParam.Add(CreateParam("@SoTienBangChu", SqlDbType.NVarChar, pTC_BienLaiThuTienInfo.SoTienBangChu)); colParam.Add(CreateParam("@GhiChu", SqlDbType.NVarChar, pTC_BienLaiThuTienInfo.GhiChu)); colParam.Add(CreateParam("@PhieuHuy", SqlDbType.Bit, pTC_BienLaiThuTienInfo.PhieuHuy)); colParam.Add(CreateParam("@NgayHuy", SqlDbType.DateTime, pTC_BienLaiThuTienInfo.NgayHuy)); colParam.Add(CreateParam("@IDHT_NguoiHuy", SqlDbType.Int, pTC_BienLaiThuTienInfo.IDHT_NguoiHuy)); colParam.Add(CreateParam("@IDHT_NguoiThu", SqlDbType.Int, pTC_BienLaiThuTienInfo.IDHT_NguoiThu)); colParam.Add(CreateParam("@Printed", SqlDbType.Bit, pTC_BienLaiThuTienInfo.Printed)); colParam.Add(CreateParam("@IDSV_SinhVienNhapTruong", SqlDbType.Int, pTC_BienLaiThuTienInfo.IDSV_SinhVienNhapTruong)); colParam.Add(CreateParam("@TC_BienLaiThuTienID", SqlDbType.Int, pTC_BienLaiThuTienInfo.TC_BienLaiThuTienID)); RunProcedure("sp_TC_BienLaiThuTien_Update", colParam); }
public List <TC_BienLaiThuTienInfo> GetList(TC_BienLaiThuTienInfo pTC_BienLaiThuTienInfo) { List <TC_BienLaiThuTienInfo> oTC_BienLaiThuTienInfoList = new List <TC_BienLaiThuTienInfo>(); DataTable dtb = Get(pTC_BienLaiThuTienInfo); if (dtb != null) { for (int i = 0; i < dtb.Rows.Count; i++) { oTC_BienLaiThuTienInfo = new TC_BienLaiThuTienInfo(); oTC_BienLaiThuTienInfo.TC_BienLaiThuTienID = int.Parse(dtb.Rows[i]["TC_BienLaiThuTienID"].ToString()); oTC_BienLaiThuTienInfo.IDSV_SinhVien = int.Parse(dtb.Rows[i]["IDSV_SinhVien"].ToString()); oTC_BienLaiThuTienInfo.IDDM_NamHoc = int.Parse(dtb.Rows[i]["IDDM_NamHoc"].ToString()); oTC_BienLaiThuTienInfo.HocKy = int.Parse(dtb.Rows[i]["HocKy"].ToString()); oTC_BienLaiThuTienInfo.PhieuThu = bool.Parse(dtb.Rows[i]["PhieuThu"].ToString()); oTC_BienLaiThuTienInfo.SoPhieu = dtb.Rows[i]["SoPhieu"].ToString(); oTC_BienLaiThuTienInfo.NgayThu = DateTime.Parse(dtb.Rows[i]["NgayThu"].ToString()); oTC_BienLaiThuTienInfo.NoiDung = dtb.Rows[i]["NoiDung"].ToString(); oTC_BienLaiThuTienInfo.SoTien = double.Parse(dtb.Rows[i]["SoTien"].ToString()); oTC_BienLaiThuTienInfo.SoTienBangChu = dtb.Rows[i]["SoTienBangChu"].ToString(); oTC_BienLaiThuTienInfo.GhiChu = dtb.Rows[i]["GhiChu"].ToString(); oTC_BienLaiThuTienInfo.PhieuHuy = bool.Parse(dtb.Rows[i]["PhieuHuy"].ToString()); oTC_BienLaiThuTienInfo.NgayHuy = DateTime.Parse(dtb.Rows[i]["NgayHuy"].ToString()); oTC_BienLaiThuTienInfo.IDHT_NguoiHuy = int.Parse(dtb.Rows[i]["IDHT_NguoiHuy"].ToString()); oTC_BienLaiThuTienInfo.IDHT_NguoiThu = int.Parse(dtb.Rows[i]["IDHT_NguoiThu"].ToString()); oTC_BienLaiThuTienInfo.Printed = bool.Parse(dtb.Rows[i]["Printed"].ToString()); oTC_BienLaiThuTienInfoList.Add(oTC_BienLaiThuTienInfo); } } return(oTC_BienLaiThuTienInfoList); }
public void Delete(TC_BienLaiThuTienInfo pTC_BienLaiThuTienInfo) { ArrayList colParam = new ArrayList(); colParam.Add(CreateParam("@TC_BienLaiThuTienID", SqlDbType.Int, pTC_BienLaiThuTienInfo.TC_BienLaiThuTienID)); RunProcedure("sp_TC_BienLaiThuTien_Delete", colParam); }
public DataTable Get(TC_BienLaiThuTienInfo pTC_BienLaiThuTienInfo) { ArrayList colParam = new ArrayList(); colParam.Add(CreateParam("@TC_BienLaiThuTienID", SqlDbType.Int, pTC_BienLaiThuTienInfo.TC_BienLaiThuTienID)); return(RunProcedureGet("sp_TC_BienLaiThuTien_Get", colParam)); }
public int Add(TC_BienLaiThuTienInfo pTC_BienLaiThuTienInfo) { int ID = 0; ID = oDTC_BienLaiThuTien.Add(pTC_BienLaiThuTienInfo); mErrorMessage = oDTC_BienLaiThuTien.ErrorMessages; mErrorNumber = oDTC_BienLaiThuTien.ErrorNumber; return(ID); }
public frmBienLaiThuTien() { InitializeComponent(); pTC_BienLaiThuTienInfo = new TC_BienLaiThuTienInfo(); oBTC_BienLaiThuTien = new cBTC_BienLaiThuTien(); oBNamHoc = new cBDM_NamHoc(); pNamHocInfo = new DM_NamHocInfo(); oBDM_Lop = new cBDM_Lop(); }
public frmBienLaiThuTien_Tree() { InitializeComponent(); oBTC_BienLaiThuTien = new cBTC_BienLaiThuTien(); pTC_BienLaiThuTienInfo = new TC_BienLaiThuTienInfo(); oBTC_BienLaiThuTien_ChiTiet = new cBTC_BienLaiThuTien_ChiTiet(); oBSV_SinhVien_Lop = new cBSV_SinhVien_Lop(); oBTC_DinhMuc = new cBTC_DinhMucThuSinhVien(); clsStrHelper = new Lib.clsStringHelper(); oBNamHoc = new cBDM_NamHoc(); pNamHocInfo = new DM_NamHocInfo(); oBDM_Lop = new cBDM_Lop(); }
public dlgBienLaiThuTienNhapHoc(DataRow mdr, bool mSua) { InitializeComponent(); oBSV_SinhVienNhapTruong = new cBSV_SinhVienNhapTruong(); pTC_BienLaiThuTienInfo = new TC_BienLaiThuTienInfo(); oBTC_BienLaiThuTien = new cBTC_BienLaiThuTien(); pTC_BienLaiThuTien_ChiTietInfo = new TC_BienLaiThuTien_ChiTietInfo(); oBTC_BienLaiThuTien_ChiTiet = new cBTC_BienLaiThuTien_ChiTiet(); oBTC_DinhMucThuSinhVien = new cBTC_DinhMucThuSinhVien(); pSV_SinhVienNhapTruongInfo = new SV_SinhVienNhapTruongInfo(); dtpNgay.EditValue = DateTime.Now; Sua = mSua; dr = mdr; }
public dlgBienLaiThuTienChiTiet(int _IDTC_BienLaiThuTien, bool mSua, string _MaSinhVien) { InitializeComponent(); oBSV_SinhVien = new cBSV_SinhVien(); pTC_BienLaiThuTienInfo = new TC_BienLaiThuTienInfo(); oBTC_BienLaiThuTien = new cBTC_BienLaiThuTien(); pTC_BienLaiThuTien_ChiTietInfo = new TC_BienLaiThuTien_ChiTietInfo(); oBTC_BienLaiThuTien_ChiTiet = new cBTC_BienLaiThuTien_ChiTiet(); oBTC_DinhMucThuSinhVien = new cBTC_DinhMucThuSinhVien(); pSV_SinhVienInfo = new SV_SinhVienInfo(); dtpNgay.EditValue = DateTime.Now; Sua = mSua; IDTC_BienLaiThuTien = _IDTC_BienLaiThuTien; MaSinhVien = _MaSinhVien; chkInKhiLuu.Checked = Properties.Settings.Default.TC_InKhiLuu; }
public void ToInfo(ref TC_BienLaiThuTienInfo pTC_BienLaiThuTienInfo, DataRow dr) { pTC_BienLaiThuTienInfo.TC_BienLaiThuTienID = int.Parse(dr[pTC_BienLaiThuTienInfo.strTC_BienLaiThuTienID].ToString()); pTC_BienLaiThuTienInfo.IDSV_SinhVien = int.Parse(dr[pTC_BienLaiThuTienInfo.strIDSV_SinhVien].ToString()); pTC_BienLaiThuTienInfo.IDDM_NamHoc = int.Parse(dr[pTC_BienLaiThuTienInfo.strIDDM_NamHoc].ToString()); pTC_BienLaiThuTienInfo.HocKy = int.Parse(dr[pTC_BienLaiThuTienInfo.strHocKy].ToString()); pTC_BienLaiThuTienInfo.PhieuThu = bool.Parse(dr[pTC_BienLaiThuTienInfo.strPhieuThu].ToString()); pTC_BienLaiThuTienInfo.SoPhieu = dr[pTC_BienLaiThuTienInfo.strSoPhieu].ToString(); pTC_BienLaiThuTienInfo.NgayThu = DateTime.Parse(dr[pTC_BienLaiThuTienInfo.strNgayThu].ToString()); pTC_BienLaiThuTienInfo.NoiDung = dr[pTC_BienLaiThuTienInfo.strNoiDung].ToString(); pTC_BienLaiThuTienInfo.SoTien = double.Parse(dr[pTC_BienLaiThuTienInfo.strSoTien].ToString()); pTC_BienLaiThuTienInfo.SoTienBangChu = dr[pTC_BienLaiThuTienInfo.strSoTienBangChu].ToString(); pTC_BienLaiThuTienInfo.GhiChu = dr[pTC_BienLaiThuTienInfo.strGhiChu].ToString(); pTC_BienLaiThuTienInfo.PhieuHuy = bool.Parse(dr[pTC_BienLaiThuTienInfo.strPhieuHuy].ToString()); pTC_BienLaiThuTienInfo.NgayHuy = DateTime.Parse(dr[pTC_BienLaiThuTienInfo.strNgayHuy].ToString()); pTC_BienLaiThuTienInfo.IDHT_NguoiHuy = int.Parse(dr[pTC_BienLaiThuTienInfo.strIDHT_NguoiHuy].ToString()); pTC_BienLaiThuTienInfo.IDHT_NguoiThu = int.Parse(dr[pTC_BienLaiThuTienInfo.strIDHT_NguoiThu].ToString()); pTC_BienLaiThuTienInfo.Printed = bool.Parse(dr[pTC_BienLaiThuTienInfo.strPrinted].ToString()); }
public void ToDataRow(TC_BienLaiThuTienInfo pTC_BienLaiThuTienInfo, ref DataRow dr) { dr[pTC_BienLaiThuTienInfo.strTC_BienLaiThuTienID] = pTC_BienLaiThuTienInfo.TC_BienLaiThuTienID; dr[pTC_BienLaiThuTienInfo.strIDSV_SinhVien] = pTC_BienLaiThuTienInfo.IDSV_SinhVien; dr[pTC_BienLaiThuTienInfo.strIDDM_NamHoc] = pTC_BienLaiThuTienInfo.IDDM_NamHoc; dr[pTC_BienLaiThuTienInfo.strHocKy] = pTC_BienLaiThuTienInfo.HocKy; dr[pTC_BienLaiThuTienInfo.strPhieuThu] = pTC_BienLaiThuTienInfo.PhieuThu; dr[pTC_BienLaiThuTienInfo.strSoPhieu] = pTC_BienLaiThuTienInfo.SoPhieu; dr[pTC_BienLaiThuTienInfo.strNgayThu] = pTC_BienLaiThuTienInfo.NgayThu; dr[pTC_BienLaiThuTienInfo.strNoiDung] = pTC_BienLaiThuTienInfo.NoiDung; dr[pTC_BienLaiThuTienInfo.strSoTien] = pTC_BienLaiThuTienInfo.SoTien; dr[pTC_BienLaiThuTienInfo.strSoTienBangChu] = pTC_BienLaiThuTienInfo.SoTienBangChu; dr[pTC_BienLaiThuTienInfo.strGhiChu] = pTC_BienLaiThuTienInfo.GhiChu; dr[pTC_BienLaiThuTienInfo.strPhieuHuy] = pTC_BienLaiThuTienInfo.PhieuHuy; dr[pTC_BienLaiThuTienInfo.strNgayHuy] = pTC_BienLaiThuTienInfo.NgayHuy; dr[pTC_BienLaiThuTienInfo.strIDHT_NguoiHuy] = pTC_BienLaiThuTienInfo.IDHT_NguoiHuy; dr[pTC_BienLaiThuTienInfo.strIDHT_NguoiThu] = pTC_BienLaiThuTienInfo.IDHT_NguoiThu; dr[pTC_BienLaiThuTienInfo.strPrinted] = pTC_BienLaiThuTienInfo.Printed; }
private void LapBienLaiThuTien(DataTable dtDinhMuc, int IDSV_SinhVien) { // Them bien lai thu tien pTC_BienLaiThuTienInfo = new TC_BienLaiThuTienInfo(); pTC_BienLaiThuTienInfo.GhiChu = ""; pTC_BienLaiThuTienInfo.HocKy = Program.HocKy; pTC_BienLaiThuTienInfo.IDDM_NamHoc = Program.IDNamHoc; pTC_BienLaiThuTienInfo.IDHT_NguoiThu = Program.objUserCurrent.HT_UserID; pTC_BienLaiThuTienInfo.IDSV_SinhVien = IDSV_SinhVien; pTC_BienLaiThuTienInfo.IDDM_Lop = pDM_LopInfo.DM_LopID; pTC_BienLaiThuTienInfo.NgayThu = DateTime.Now; pTC_BienLaiThuTienInfo.NoiDung = "THU TIỀN HỌC KỲ " + Program.HocKy.ToString() + " NĂM HỌC " + Program.NamHoc; pTC_BienLaiThuTienInfo.PhieuThu = true; pTC_BienLaiThuTienInfo.Printed = false; pTC_BienLaiThuTienInfo.SoPhieu = GetSoPhieu(Program.HocKy, Program.IDNamHoc, IDSV_SinhVien, pDM_LopInfo.IDDM_DiaDiem); //dtDinhMuc.Columns[3]. pTC_BienLaiThuTienInfo.SoTien = SumColumnValue(dtDinhMuc, "SoTien"); pTC_BienLaiThuTienInfo.SoTienBangChu = clsStrHelper.ReadMoney(pTC_BienLaiThuTienInfo.SoTien) + " đồng"; pTC_BienLaiThuTienInfo.PhieuHuy = false; pTC_BienLaiThuTienInfo.NgayHuy = DateTime.Parse("1/1/1900"); int intTC_BienLaiThuTienID = oBTC_BienLaiThuTien.Add(pTC_BienLaiThuTienInfo); // them bien lai thu tien chi tiet foreach (DataRow mdr in dtDinhMuc.Rows) { if (float.Parse("0" + mdr["SoTien"].ToString()) > 0 && mdr["TC_LoaiThuChiID"].ToString() != "") { pTC_BienLaiThuTien_ChiTietInfo = new TC_BienLaiThuTien_ChiTietInfo(); pTC_BienLaiThuTien_ChiTietInfo.IDTC_BienLaiThuTien = intTC_BienLaiThuTienID; pTC_BienLaiThuTien_ChiTietInfo.IDTC_DinhMucThuSinhVien = int.Parse("0" + mdr["IDTC_DinhMucThuSinhVien"].ToString()); pTC_BienLaiThuTien_ChiTietInfo.IDTC_LoaiThuChi = int.Parse(mdr["TC_LoaiThuChiID"].ToString()); pTC_BienLaiThuTien_ChiTietInfo.LanThu = int.Parse("0" + mdr["LanThu"].ToString()); pTC_BienLaiThuTien_ChiTietInfo.NoiDung = mdr["NoiDung"].ToString(); pTC_BienLaiThuTien_ChiTietInfo.SoTien = float.Parse("0" + mdr["SoTien"].ToString()); oBTC_BienLaiThuTien_ChiTiet.Add(pTC_BienLaiThuTien_ChiTietInfo); } } }
public void Delete(TC_BienLaiThuTienInfo pTC_BienLaiThuTienInfo) { oDTC_BienLaiThuTien.Delete(pTC_BienLaiThuTienInfo); mErrorMessage = oDTC_BienLaiThuTien.ErrorMessages; mErrorNumber = oDTC_BienLaiThuTien.ErrorNumber; }
public DataTable Get(TC_BienLaiThuTienInfo pTC_BienLaiThuTienInfo) { return(oDTC_BienLaiThuTien.Get(pTC_BienLaiThuTienInfo)); }