public static TRINHDO GetTDByMaTD(string maTD) { if (Program.KetNoi() == 0) { return(null); } SqlDataReader myReader; myReader = Program.ExecSqlDataReader(string.Format(KeyConst.Lenh.GetTDByMaTD, maTD)); if (myReader == null) { return(null); } TRINHDO td = null; while (myReader.Read()) { td = new TRINHDO() { MATD = myReader.GetString(0), TENTD = myReader.GetString(1) }; } myReader.Close(); return(td); }
public static List <TRINHDO> GetAllTrinhDo() { if (Program.KetNoi() == 0) { return(null); } SqlDataReader myReader; myReader = Program.ExecSqlDataReader(KeyConst.Lenh.GetAllTrinhDo); if (myReader == null) { return(null); } List <TRINHDO> lstTrinhDo = new List <TRINHDO>(); while (myReader.Read()) { TRINHDO td = new TRINHDO() { MATD = myReader.GetString(0), TENTD = myReader.GetString(1) }; lstTrinhDo.Add(td); } myReader.Close(); return(lstTrinhDo); }
public void SetThongTinLop(string maLop) { lbMaLop.Text = "Mã lớp : " + maLop; LOP lp = Lop.GetLopByMaLop(maLop); if (lp != null) { MaTD = lp.TRINHDO; KHOA khRow = Khoa.GetKhoaByMaKhoa(lp.MAKH); TRINHDO tdRow = TrinhDo.GetTDByMaTD(lp.TRINHDO); if (khRow != null) { MaKhoa = khRow.MAKH; lbKhoa.Text = "Khoa : " + khRow.TENKH; } if (tdRow != null) { lbTrinhDo.Text = "Trình độ : " + tdRow.TENTD; } lbTenLop.Text = "Tên lớp : " + lp.TENLOP; mONHOCTableAdapter.Connection.ConnectionString = Program.connstr; dtsTTN.EnforceConstraints = false; mONHOCTableAdapter.Fill(dtsTTN.MONHOC); mONHOCBindingSource.Filter = "MAKH ='" + lp.MAKH + "'"; cbbMonHoc.DataSource = mONHOCBindingSource; cbbMonHoc.DisplayMember = "TENMH"; cbbMonHoc.ValueMember = "MAMH"; } lbSLSV.Text = "Số lượng sinh viên : " + Lop.CountSV(maLop).ToString().Trim(); }
public ActionResult DeleteConfirmed(string id) { TRINHDO tRINHDO = db.TRINHDOs.Find(id); db.TRINHDOs.Remove(tRINHDO); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "TenTrinhDo,MaTrinhDo")] TRINHDO tRINHDO) { if (ModelState.IsValid) { db.Entry(tRINHDO).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tRINHDO)); }
public ActionResult Create([Bind(Include = "TenTrinhDo,MaTrinhDo")] TRINHDO tRINHDO) { if (ModelState.IsValid) { db.TRINHDOs.Add(tRINHDO); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tRINHDO)); }
protected void them_Click(object sender, EventArgs e) { TRINHDO tdo = new TRINHDO(); tdo.matd = matrinhdo.Text; tdo.tentd = tentrinhdo.Text; TRINHDOBusiness td = new TRINHDOBusiness(); td.Insert(tdo); LoadTrinhdo("Q"); }
// GET: TRINHDOs/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TRINHDO tRINHDO = db.TRINHDOs.Find(id); if (tRINHDO == null) { return(HttpNotFound()); } return(View(tRINHDO)); }
public int Delete(TRINHDO ObjTRINHDO) { DataTRINHDO objData = new DataTRINHDO(); return(objData.DataDeleteTRINHDO(ObjTRINHDO)); }
public Thongtincanhan(int stt, string MaNV, string HoTen, DateTime NgaySinh, string GioiTinh, string PhongBan, string ChucVu, string NoiSinh, TRINHDO TD, string TenTrinhDo, CHUCVU CHUCVU) { this.STT = stt + ""; this.MaNV = MaNV; this.HoTen = HoTen; this.GioiTinh = GioiTinh; this.NgaySinh = NgaySinh; this.PhongBan = PhongBan; this.ChucVu = ChucVu; this.NoiSinh = NoiSinh; this.TD = TD; this.TenTrinhDo = TenTrinhDo; this.CHUCVU = CHUCVU; }
public int DataInsertTRINHDO(TRINHDO ObjTRINHDO) { return(PDInsertTRINHDO(ObjTRINHDO.tdid, ObjTRINHDO.matd, ObjTRINHDO.tentd)); }
public int DataUpdateTRINHDO(TRINHDO ObjTRINHDO) { return(PDUpdateTRINHDO(ObjTRINHDO.tdid, ObjTRINHDO.matd, ObjTRINHDO.tentd)); }
public DataTable DataDetailsTRINHDO(TRINHDO ObjTRINHDO) { return(PDDetailsTRINHDO(ObjTRINHDO.tdid)); }
public int DataDeleteTRINHDO(TRINHDO ObjTRINHDO) { return(PDDeleteTRINHDO(ObjTRINHDO.tdid)); }
public int Insert(TRINHDO ObjTRINHDO) { DataTRINHDO objData = new DataTRINHDO(); return(objData.DataInsertTRINHDO(ObjTRINHDO)); }
public DataTable Details(TRINHDO ObjTRINHDO) { DataTRINHDO objData = new DataTRINHDO(); return(objData.DataDetailsTRINHDO(ObjTRINHDO)); }
public int Update(TRINHDO ObjTRINHDO) { DataTRINHDO objData = new DataTRINHDO(); return(objData.DataUpdateTRINHDO(ObjTRINHDO)); }