public static Int32?UpdateAssociatedCostToTemp(AssociatedCost assCost, string User511, int JourneyId) { Patient_Journey_Transactions_AssociatedCosts_Temp associatedCost = new Patient_Journey_Transactions_AssociatedCosts_Temp(); associatedCost.Patient_Journey_Transactions_AssociatedCosts_Temp_Id = assCost.AssociatedCostId; associatedCost.AssociatedCosts = assCost.AssociatedCosts; associatedCost.Description = assCost.Description; associatedCost.Evidence = assCost.Evidence; associatedCost.Modified_By = User511; associatedCost.Modified_Date = DateTime.Now; var response = dbPatientJourney.UpdateAssociatedCostToTemp(associatedCost); if (response != null) { var toBeApproved = dbPatientAdministration.ToBeApprovedJourney(JourneyId); Patient_Journey_VersionDetails_Temp versionDetails = new Patient_Journey_VersionDetails_Temp(); versionDetails.Patient_Journey_Temp_Id = Convert.ToInt32(JourneyId); versionDetails.Version_Comments = GlobalConstants.VersionCommentsConstants.AssociatedUpdated; versionDetails.Version_Title = GlobalConstants.VersionTitleConstants.AssociatedUpdated; versionDetails.Created_By = User511; versionDetails.Created_Date = DateTime.Now; versionDetails.Modified_By = User511; versionDetails.Modified_Date = DateTime.Now; versionDetails.IsApproved = false; var version = dbPatientAdministration.AddVersionDetailsToTemp(versionDetails); } return(response); }
public static Patient_Journey_Transactions_AssociatedCosts_Temp GetAssociatedCostFromTemp(int TransactionId) { Patient_Journey_Transactions_AssociatedCosts_Temp assCost = new Patient_Journey_Transactions_AssociatedCosts_Temp(); using (PJEntities entity = new PJEntities()) { assCost = entity.Patient_Journey_Transactions_AssociatedCosts_Temp.Where(x => x.Patient_Journey_Transactions_Temp_Id == TransactionId).FirstOrDefault(); return(assCost); } }
public static Int32?AddAssociatedCostToTemp(Patient_Journey_Transactions_AssociatedCosts_Temp associatedCost) { try { using (PJEntities entity = new PJEntities()) { entity.Patient_Journey_Transactions_AssociatedCosts_Temp.Add(associatedCost); entity.SaveChanges(); return(associatedCost.Patient_Journey_Transactions_AssociatedCosts_Temp_Id); } } catch (Exception) { return(0); } }
public static Int32?UpdateAssociatedCostToTemp(Patient_Journey_Transactions_AssociatedCosts_Temp associatedCost) { try { using (PJEntities entity = new PJEntities()) { var currentassociated = entity.Patient_Journey_Transactions_AssociatedCosts_Temp.Where(s => s.Patient_Journey_Transactions_AssociatedCosts_Temp_Id == associatedCost.Patient_Journey_Transactions_AssociatedCosts_Temp_Id).FirstOrDefault(); if (currentassociated != null) { currentassociated.AssociatedCosts = associatedCost.AssociatedCosts; currentassociated.Description = associatedCost.Description; currentassociated.Evidence = associatedCost.Evidence; currentassociated.Modified_By = associatedCost.Modified_By; currentassociated.Modified_Date = associatedCost.Modified_Date; } entity.SaveChanges(); return(currentassociated.Patient_Journey_Transactions_AssociatedCosts_Temp_Id); } } catch (Exception) { return(0); } }