public EntityPatientAlloc GetPatientType(int Val) { try { EntityPatientAlloc objPat = (from tbl in objData.tblPatientMasters join tblAdmit in objData.tblPatientAdmitDetails on tbl.PKId equals tblAdmit.PatientId where tblAdmit.AdmitId.Equals(Val) select new EntityPatientAlloc { PatType = tblAdmit.IsIPD.Value ? "IPD" : "OPD", AdmitDate = Convert.ToDateTime(tblAdmit.AdmitDate) }).FirstOrDefault(); return(objPat); } catch (Exception ex) { throw ex; } }
public int InsertAllocPat(EntityPatientAlloc entPat) { try { tblPatientAllocToDoc obj = new tblPatientAllocToDoc() { PatientId = entPat.PatientId, DocId = entPat.DocId, AppDate = entPat.AppDate, Charges = entPat.Charges }; objData.tblPatientAllocToDocs.InsertOnSubmit(obj); objData.SubmitChanges(); return(1); } catch (Exception ex) { throw ex; } }