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 EntityBedAllocToPatient GetICUAllocatedBed(int BedAllocId) { EntityBedAllocToPatient obj = null; try { obj = (from tbl in objData.tblBedAllocationToPatients join tblbed in objData.tblBedMasters on tbl.BedId equals tblbed.BedId join tblRoomtype in objData.tblRoomCategories on tblbed.CategoryId equals tblRoomtype.PKId where tbl.IsDelete == false && tbl.DischargeDate == null select new EntityBedAllocToPatient { BedId = tbl.BedId, BedNo = tblbed.BedNo }).FirstOrDefault(); } catch (Exception ex) { throw ex; } return(obj); }
protected void BtnEdit_Click(object sender, EventArgs e) { int lintCnt = 0; try { EntityBedAllocToPatient entDept = new EntityBedAllocToPatient(); entDept.BedId = Convert.ToInt32(Session["Bed_Id"]); entDept.FloorId = Convert.ToInt32(Session["Floor_Id"]); entDept.RoomId = Convert.ToInt32(Session["Room_Id"]); entDept.PatientId = Convert.ToInt32(Session["Pat_Id"]); if (!string.IsNullOrEmpty(txtAllocDate.Text)) { entDept.AllocationDate = Convert.ToDateTime(txtAllocDate.Text); } else { entDept.AllocationDate = null; } PatientMasterBLL mobjPatient = new PatientMasterBLL(); EntityPatientAdmit entAdmit = new EntityPatientAdmit() { PatientId = Convert.ToInt32(ddlPatientName.SelectedValue) }; bool Status = mobjPatient.CheckPatientAlreadyAllocated(entAdmit); if (!Status) { lintCnt = mobjDeptBLL.InsertAllocBed(entDept); if (lintCnt > 0) { lblMessage.Text = "Record Updated Successfully"; } else { lblMessage.Text = "Record Not Updated"; } } else { lblMessage.Text = "This Patient Already Allocated to Another Bed"; } } catch (Exception ex) { lblMessage.Text = ex.Message; } GetBedAlloc(); MultiView1.SetActiveView(View1); }
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; } }