public bool Delete(Subject bm) { SqlParameter[] sqlParams = new SqlParameter[]{ new SqlParameter("@MaBoMon", bm.MaBoMon) }; return DBConnection.Instance.ExecuteQuery("BoMon_Delete", sqlParams, CommandType.StoredProcedure); }
public bool Edit(Subject bm) { SqlParameter[] sqlParams = new SqlParameter[]{ new SqlParameter("@MaBoMon", bm.MaBoMon), new SqlParameter("@TenBoMon", bm.TenBoMon), new SqlParameter("@MaTruongBoMon", bm.MaTruongBoMon), new SqlParameter("@MaKhoa", bm.MaKhoa)}; return DBConnection.Instance.ExecuteQuery("BoMon_Update", sqlParams, CommandType.StoredProcedure); }
private Subject BoMon() { Subject bm = new Subject(); bm.MaBoMon = txtMaBoMon.Text; bm.TenBoMon = txtTenBoMon.Text; bm.MaTruongBoMon = string.IsNullOrEmpty(cboTruongBoMon.Text) ? " " : cboTruongBoMon.SelectedValue.ToString(); bm.MaKhoa = string.IsNullOrEmpty(cboMaKhoa.Text) ? " " : cboMaKhoa.SelectedValue.ToString(); return bm; }