public Boolean readData() { StreamReader rd; if (!File.Exists(fileName)) { FileStream fs = File.Create(fileName); rd = new StreamReader(fs, Encoding.UTF8); } else { rd = new StreamReader(this.fileName); } //String idMH, ma_HK, tenMH; //int soTC, lyThuyet, thucHanh; String idMN; idMN = rd.ReadLine(); while (idMN != null) { ChiTietDT ct = new ChiTietDT(); ct.SetIdMN(idMN); ct.SetMaNganh(rd.ReadLine()); chitetdt.Add(ct); idMN = rd.ReadLine(); } return(true); }
public Boolean updateMaNganh(String IDMN, String MaNganh) { ChiTietDT ct = chitetdt.Find(x => x.getIDMN().Equals(IDMN)); if (ct != null) { return(false); } ct.SetIdMN(IDMN); ct.SetMaNganh(MaNganh); return(true); }
public Boolean insertMaNganh(String IDMN, String MaNganh) { ChiTietDT ct = chitetdt.Find(x => x.getIDMN().Equals(IDMN)); if (ct != null) { return(false); } ct = new ChiTietDT(IDMN, MaNganh); chitetdt.Add(ct); return(true); }
//SỬA dl public bool UpdateData(ChiTietDT dt) { cmd.CommandText = "UPDATE chitietphieumuon SET '" + dt.Sophieu + "','" + dt.Masach + "',CONVERT(DATE,'" + dt.Hentra + "',103) WHERE Sophieu ='" + dt.Sophieu + "'"; cmd.CommandType = CommandType.Text; cmd.Connection = conn.Connection; try { conn.OpenConn(); cmd.ExecuteNonQuery(); conn.CloseConn(); return(true); } catch (Exception ex) { string mex = ex.Message; cmd.Dispose(); conn.CloseConn(); } return(false); }
internal bool UpdateData(ChiTietDT dtKhoa) { throw new NotImplementedException(); }
void ganDL(ChiTietDT dt) { dt.Sophieu = txtSoPhieu.Text.Trim(); dt.Masach = txtMaSach.Text.Trim(); dt.Hentra = dateTra.Text.Trim(); }