public void SaveUpdateTreatmentPreparation(TreatmentPreparation obj) { CLogger.WriteLog(ELogLevel.INFO, "DBTreatmentPreparation.SaveUpdateTreatmentPreparation() method called"); bool flag = true; ClsObject clsObjTP = new ClsObject(); try { ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@Id", SqlDbType.Int, obj.Id.ToString()); ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, obj.Ptn_pk.ToString()); ClsUtility.AddParameters("@HIVIT", SqlDbType.DateTime, obj.HIVIT.ToString()); ClsUtility.AddParameters("@HIVR", SqlDbType.DateTime, obj.HIVR.ToString()); ClsUtility.AddParameters("@ViralLoadIT", SqlDbType.DateTime, obj.ViralLoadIT.ToString()); ClsUtility.AddParameters("@ViralLoadR", SqlDbType.DateTime, obj.ViralLoadR.ToString()); ClsUtility.AddParameters("@CD4IT", SqlDbType.DateTime, obj.CD4IT.ToString()); ClsUtility.AddParameters("@CD4R", SqlDbType.DateTime, obj.CD4R.ToString()); ClsUtility.AddParameters("@AntiretroviralIT", SqlDbType.DateTime, obj.AntiretroviralIT.ToString()); ClsUtility.AddParameters("@AntiretroviralR", SqlDbType.DateTime, obj.AntiretroviralR.ToString()); ClsUtility.AddParameters("@TreatmentFailureIT", SqlDbType.DateTime, obj.TreatmentFailureIT.ToString()); ClsUtility.AddParameters("@TreatmentFailureR", SqlDbType.DateTime, obj.TreatmentFailureR.ToString()); ClsUtility.AddParameters("@ARTSEIT", SqlDbType.DateTime, obj.ARTSEIT.ToString()); ClsUtility.AddParameters("@ARTSER", SqlDbType.DateTime, obj.ARTSER.ToString()); ClsUtility.AddParameters("@AdherenceIT", SqlDbType.DateTime, obj.AdherenceIT.ToString()); ClsUtility.AddParameters("@AdherenceR", SqlDbType.DateTime, obj.AdherenceR.ToString()); ClsUtility.AddParameters("@OtherMedicationsIT", SqlDbType.DateTime, obj.OtherMedicationsIT.ToString()); ClsUtility.AddParameters("@OtherMedicationsR", SqlDbType.DateTime, obj.OtherMedicationsR.ToString()); ClsUtility.AddParameters("@NutritionIT", SqlDbType.DateTime, obj.NutritionIT.ToString()); ClsUtility.AddParameters("@NutritionR", SqlDbType.DateTime, obj.NutritionR.ToString()); ClsUtility.AddParameters("@FollowUpIT", SqlDbType.DateTime, obj.FollowUpIT.ToString()); ClsUtility.AddParameters("@FollowUpR", SqlDbType.DateTime, obj.FollowUpR.ToString()); ClsUtility.AddParameters("@ARTReadinessAssessment", SqlDbType.Int, obj.ARTReadinessAssessment.ToString()); ClsUtility.AddParameters("@ManagementPlanIT", SqlDbType.DateTime, obj.ManagementPlanIT.ToString()); ClsUtility.AddParameters("@ManagementPlanR", SqlDbType.DateTime, obj.ManagementPlanR.ToString()); ClsUtility.AddParameters("@Notes", SqlDbType.VarChar, obj.Notes.ToString()); DataTable dt = (DataTable)clsObjTP.ReturnObject(ClsUtility.theParams, "Pr_HIVCE_UpdateTreatmentPreparation", ClsDBUtility.ObjectEnum.DataTable); } catch (Exception ex) { flag = false; throw ex; } finally { clsObjTP = null; if (this.Connection != null) { DataMgr.ReleaseConnection(this.Connection); } } }
public TreatmentPreparation GetTreatmentPreparation(int ptn_pk) { CLogger.WriteLog(ELogLevel.INFO, "BLTreatmentPreparation.GetTreatmentPreparation() method called"); TreatmentPreparation tp = new TreatmentPreparation(); try { dbTP = new DBTreatmentPreparation(); DataTable dtTP = dbTP.GetTreatmentPreparation(ptn_pk); if (dtTP.Rows.Count > 0) { tp = (from dt in dtTP.AsEnumerable() select new TreatmentPreparation() { Id = dt.Field <int>("Id"), Ptn_pk = dt.Field <int>("Ptn_pk"), HIVIT = dt.Field <DateTime?>("HIVIT"), HIVR = dt.Field <DateTime?>("HIVR"), ViralLoadIT = dt.Field <DateTime?>("ViralLoadIT"), ViralLoadR = dt.Field <DateTime?>("ViralLoadR"), CD4IT = dt.Field <DateTime?>("CD4IT"), CD4R = dt.Field <DateTime?>("CD4R"), AntiretroviralIT = dt.Field <DateTime?>("AntiretroviralIT"), AntiretroviralR = dt.Field <DateTime?>("AntiretroviralR"), TreatmentFailureIT = dt.Field <DateTime?>("TreatmentFailureIT"), TreatmentFailureR = dt.Field <DateTime?>("TreatmentFailureR"), ARTSEIT = dt.Field <DateTime?>("ARTSEIT"), ARTSER = dt.Field <DateTime?>("ARTSER"), AdherenceIT = dt.Field <DateTime?>("AdherenceIT"), AdherenceR = dt.Field <DateTime?>("AdherenceR"), OtherMedicationsIT = dt.Field <DateTime?>("OtherMedicationsIT"), OtherMedicationsR = dt.Field <DateTime?>("OtherMedicationsR"), NutritionIT = dt.Field <DateTime?>("NutritionIT"), NutritionR = dt.Field <DateTime?>("NutritionR"), FollowUpIT = dt.Field <DateTime?>("FollowUpIT"), FollowUpR = dt.Field <DateTime?>("FollowUpR"), ARTReadinessAssessment = dt.Field <int?>("ARTReadinessAssessment"), ManagementPlanIT = dt.Field <DateTime?>("ManagementPlanIT"), ManagementPlanR = dt.Field <DateTime?>("ManagementPlanR"), Notes = dt.Field <string>("Notes") }).FirstOrDefault(); } } catch (Exception ex) { CLogger.WriteLog(ELogLevel.ERROR, "BLTreatmentPreparation.GetTreatmentPreparation() Method:" + ex.ToString()); } return(tp); }
public bool SaveUpdateTreatmentPreparation(TreatmentPreparation obj) { CLogger.WriteLog(ELogLevel.INFO, "BLTreatmentPreparation.SaveUpdateTreatmentPreparation() method called"); bool flag = true; TreatmentPreparation tp = new TreatmentPreparation(); try { dbTP = new DBTreatmentPreparation(); dbTP.SaveUpdateTreatmentPreparation(obj); } catch (Exception ex) { flag = false; CLogger.WriteLog(ELogLevel.ERROR, "BLTreatmentPreparation.SaveUpdateTreatmentPreparation() Method:" + ex.ToString()); } return(flag); }