Ejemplo n.º 1
0
 public bool DelDiem(string idSV, string idLopHP)
 {
     try
     {
         Diem x = db.Diems.Where(t => t.ID_LopHocPhan == idLopHP && t.ID_SinhVien == idSV).FirstOrDefault();
         if (x != null)
         {
             db.Diems.Remove(x);
             db.SaveChanges();
             return(true);
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
        public List <Diem> dsdiem()
        {
            List <Diem> ds = new List <Diem>();

            Open();
            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from Diem";
            cmd.Connection  = conn;
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                Diem a = new Diem();
                a.MaHocSinh = reader.GetString(0);
                a.MaMonHoc  = reader.GetString(1);
                // if (reader.GetDouble(2) == null)
                try
                {
                    a.DiemKy1 = reader.GetDouble(2);
                    // a.DiemKy2 = reader.GetDouble(3);
                }
                catch (Exception ex)
                {
                    a.DiemKy1 = -1;
                }
                try
                {
                    a.DiemKy2 = reader.GetDouble(3);
                    // a.DiemKy2 = reader.GetDouble(3);
                }
                catch (Exception ex)
                {
                    a.DiemKy2 = -1;
                }
                ds.Add(a);
            }
            Close();
            conn.Close();
            return(ds);
        }
 partial void DeleteDiem(Diem instance);
 partial void UpdateDiem(Diem instance);
 partial void InsertDiem(Diem instance);
		private void detach_Diems(Diem entity)
		{
			this.SendPropertyChanging();
			entity.MonHoc = null;
		}
		private void attach_Diems(Diem entity)
		{
			this.SendPropertyChanging();
			entity.MonHoc = this;
		}
Ejemplo n.º 8
0
 private void detach_Diems(Diem entity)
 {
     this.SendPropertyChanging();
     entity.MonHoc = null;
 }
Ejemplo n.º 9
0
 private void attach_Diems(Diem entity)
 {
     this.SendPropertyChanging();
     entity.MonHoc = this;
 }
Ejemplo n.º 10
0
 partial void DeleteDiem(Diem instance);
Ejemplo n.º 11
0
 partial void UpdateDiem(Diem instance);
Ejemplo n.º 12
0
 partial void InsertDiem(Diem instance);
Ejemplo n.º 13
0
 private void detach_Diems(Diem entity)
 {
     this.SendPropertyChanging();
     entity.SinhVien = null;
 }
Ejemplo n.º 14
0
 private void attach_Diems(Diem entity)
 {
     this.SendPropertyChanging();
     entity.SinhVien = this;
 }