Пример #1
0
 public static List<cBenhanDO> Getdsbenhan2(string MABACSI, string MABENHNHAN, int MAXACNHAN)
 {
     List<cBenhanDO> dsbenhan = new List<cBenhanDO>();
     using (DB_HMS_Entities ds = new DB_HMS_Entities())
     {
         var query = from ads in ds.tbHOSOKHAMBENHs
                     join ads1 in ds.tbBENHNHANs on ads.MABENHNHAN equals ads1.MABENHNHAN
                     where ads.MAKHAMBENH == MABENHNHAN && ads.MAXACNHAN == MAXACNHAN && ads.MABACSY == MABACSI
                     select new { ads, ads1 };
         foreach (var row in query)
         {
             cBenhanDO dss = new cBenhanDO();
             dss.MABENHAN = row.ads.MAKHAMBENH;
             dss.MABENHNHAN = row.ads.MABENHNHAN;
             dss.MABACSY = row.ads.MABACSY;
             dss.HOTEN = row.ads1.HO + " " + row.ads1.TEN;
             dss.TUOI = row.ads.TUOI.ToString();
             dss.GIOITINH = row.ads.GIOITINH;
             dss.NGAYDK = row.ads.NGAYDK.Value;
             dss.GIODK = row.ads.GIODK.Value.ToString().Substring(9);
             dsbenhan.Add(dss);
         }
         return dsbenhan;
     }
 }
 public cBenhanDO Getthongtinbenh()
 {
     cBenhanDO ds = new cBenhanDO();
     return ds;
 }