public KinhNghiemDuLichViewModel GetDetail(int id) { var result = new KinhNghiemDuLichViewModel(); using (var conn = new SqlConnection(this._db.Database.GetDbConnection().ConnectionString)) { conn.Open(); result = conn.Query <KinhNghiemDuLichViewModel>(@"select * from KinhNghiemDuLich where ID = " + id).FirstOrDefault(); conn.Close(); } return(result); }
public KinhNghiemDuLich(KinhNghiemDuLichViewModel kndl) { this.ID = kndl.ID; this.Tieude = kndl.Tieude; this.HinhAnh = kndl.Hinhanh; this.Noidung = kndl.Noidung; this.Tieude1 = kndl.Tieude1; this.Noidung1 = kndl.Noidung1; this.Tieude2 = kndl.Tieude2; this.Noidung2 = kndl.Noidung2; this.Tieude3 = kndl.Tieude3; this.Noidung3 = kndl.Noidung3; this.Tieude4 = kndl.Tieude4; this.Noidung4 = kndl.Noidung4; this.Tieude5 = kndl.Tieude5; this.Noidung5 = kndl.Noidung5; this.Tieude6 = kndl.Tieude6; this.Noidung6 = kndl.Noidung6; }