public int InsertAllocBed(EntityBedAllocToPatient entDept) { int cnt = 0; try { tblBedAllocationToPatient objDaySch = new tblBedAllocationToPatient() { BedId = entDept.BedId, FloorId = entDept.FloorId, RoomId = entDept.RoomId, PatientId = entDept.PatientId, AllocationDate = Convert.ToDateTime(entDept.AllocationDate), IsDelete = false }; objData.tblBedAllocationToPatients.InsertOnSubmit(objDaySch); objData.SubmitChanges(); cnt = 1; } catch (Exception ex) { throw ex; } return(cnt); }
public int DischargePatient(int PatientID, DateTime BillDate) { try { List <EntityBedAllocToPatient> lst = new ICUDischargeBilling().GetICUAllocatedBedDetails(PatientID); foreach (var item in lst) { tblBedAllocationToPatient obj = (from tbl in objData.tblBedAllocationToPatients where tbl.BedAllocId.Equals(item.BedAllocId) select tbl).FirstOrDefault(); if (obj != null) { obj.DischargeDate = BillDate; } } objData.SubmitChanges(); return(1); } catch (Exception ex) { throw ex; } }
public int GetPatientId(int Bed_ID) { int ID; tblBedAllocationToPatient tblBed = null; tblBed = (from tbl in objData.tblBedAllocationToPatients where tbl.DischargeDate == null && tbl.BedId.Equals(Bed_ID) select tbl).FirstOrDefault(); return(ID = Convert.ToInt32(tblBed.PatientId)); }
public int UpdateShiftBed(EntityBedAllocToPatient entBedAlloc) { try { tblBedAllocationToPatient objDaySch = new tblBedAllocationToPatient() { BedId = entBedAlloc.BedId, FloorId = entBedAlloc.FloorId, RoomId = entBedAlloc.RoomId, PatientId = entBedAlloc.PatientId, AllocationDate = Convert.ToDateTime(entBedAlloc.AllocationDate), IsDelete = false }; objData.tblBedAllocationToPatients.InsertOnSubmit(objDaySch); tblBedAllocationToPatient obj = (from tbl in objData.tblBedAllocationToPatients where tbl.BedId.Equals(entBedAlloc.ShiftBedId) && tbl.PatientId.Equals(entBedAlloc.PatientId) && tbl.DischargeDate == null && tbl.IsDelete == false orderby tbl.BedAllocId descending select tbl).FirstOrDefault(); if (obj != null) { obj.ShiftDate = entBedAlloc.ShiftDate; obj.IsShiftTo_ICU = entBedAlloc.Is_ShiftTo_ICU; obj.IsShiftTo_IPD = entBedAlloc.Is_ShiftTo_IPD; objData.SubmitChanges(); return(1); } else { return(0); } } catch (Exception ex) { throw ex; } }
public int Update(EntityBedAllocToPatient entDept) { try { tblBedAllocationToPatient obj = (from tbl in objData.tblBedAllocationToPatients where tbl.BedId.Equals(entDept.BedId) && tbl.IsDelete == false select new tblBedAllocationToPatient { RoomId = entDept.RoomId, FloorId = entDept.FloorId, PatientId = entDept.PatientId, AllocationDate = entDept.AllocationDate }).FirstOrDefault(); objData.SubmitChanges(); return(1); } catch (Exception ex) { throw ex; } }