protected void btnSave_Click(object sender, EventArgs e) { string Createdate = ""; string ID = ""; if (btnSave.Text == "Save") { if (validate() == false) { return; } IPatientTransfer PatientTransferMgr = (IPatientTransfer)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientTransfer, BusinessProcess.Clinical"); DataTable theDT = PatientTransferMgr.GetSatelliteID(PatientId); string FromLocationID = theDT.Rows[0]["LocationID"].ToString(); int Transfer = (int)PatientTransferMgr.SaveUpdate(ID, PatientId, FromLocationID, ddSatellite.SelectedValue, txtTransferDate.Value, Convert.ToInt32(Session["AppUserId"]), Createdate, 0); ViewState["Save"] = ""; SaveUpdateMsg(); } else if (btnSave.Text == "Update") { if (validateEdit() == false) { return; } IPatientTransfer PatientTransferMgr = (IPatientTransfer)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientTransfer, BusinessProcess.Clinical"); int Transfer = (int)PatientTransferMgr.SaveUpdate(TransferId, PatientId, ViewState["FromID"].ToString(), ddSatelliteEdit.SelectedValue, TxtTransDateEdit.Text, Convert.ToInt32(Session["AppUserId"]), Createdate, 1); SaveUpdateMsg(); } GrdTransfer.Columns.Clear(); BindGrid(); }
public static bool PatientToFacility(string patientId, string oldLocationId, string newLocationId, int AppUserId) { IPatientTransfer PatientTransferMgr = (IPatientTransfer)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientTransfer, BusinessProcess.Clinical"); DataTable theDT = PatientTransferMgr.GetSatelliteID(patientId); string FromLocationID = theDT.Rows[0]["LocationID"].ToString(); int Transfer = (int)PatientTransferMgr.SaveUpdate("", patientId, oldLocationId, newLocationId, DateTime.Now.ToString("dd-MMM-yyyy"), AppUserId, "", 0); return(Transfer > 0 ? true: false); }