Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 //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);
 }
Пример #5
0
 internal bool UpdateData(ChiTietDT dtKhoa)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 void ganDL(ChiTietDT dt)
 {
     dt.Sophieu = txtSoPhieu.Text.Trim();
     dt.Masach  = txtMaSach.Text.Trim();
     dt.Hentra  = dateTra.Text.Trim();
 }