public bool SaveUpdateARTReadinessAssessment(ARTReadinessAssessment obj) { CLogger.WriteLog(ELogLevel.INFO, "BLARTReadinessAssessment.SaveUpdateARTReadinessAssessment() method called"); bool flag = true; ARTReadinessAssessment tp = new ARTReadinessAssessment(); try { if (obj.Ptn_pk != 0) { dbLayer = new DBARTReadinessAssessment(); dbLayer.SaveUpdateARTReadinessAssessment(obj); } else { throw new Exception("Patient id can not be 0"); } } catch (Exception ex) { flag = false; CLogger.WriteLog(ELogLevel.ERROR, "BLARTReadinessAssessment.SaveUpdateARTReadinessAssessment() Method:" + ex.ToString()); throw ex; } return(flag); }
public void SaveUpdateARTReadinessAssessment(ARTReadinessAssessment obj) { CLogger.WriteLog(ELogLevel.INFO, "DBARTReadinessAssessment.SaveUpdateARTReadinessAssessment() 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("@Visit_Id", SqlDbType.Int, obj.Visit_Id.ToString()); ClsUtility.AddParameters("@PsychosocialQ1", SqlDbType.Int, obj.PsychosocialQ1.ToString()); ClsUtility.AddParameters("@PsychosocialQ2", SqlDbType.Int, obj.PsychosocialQ2.ToString()); ClsUtility.AddParameters("@PsychosocialQ3", SqlDbType.Int, obj.PsychosocialQ3.ToString()); ClsUtility.AddParameters("@PsychosocialQ4", SqlDbType.Int, obj.PsychosocialQ4.ToString()); ClsUtility.AddParameters("@PsychosocialQ5", SqlDbType.Int, obj.PsychosocialQ5.ToString()); ClsUtility.AddParameters("@PsychosocialQ6", SqlDbType.Int, obj.PsychosocialQ6.ToString()); ClsUtility.AddParameters("@PsychosocialQ7", SqlDbType.Int, obj.PsychosocialQ7.ToString()); ClsUtility.AddParameters("@PsychosocialQ8", SqlDbType.Int, obj.PsychosocialQ8.ToString()); ClsUtility.AddParameters("@PsychosocialQ9", SqlDbType.Int, obj.PsychosocialQ9.ToString()); ClsUtility.AddParameters("@PsychosocialQ10", SqlDbType.Int, obj.PsychosocialQ10.ToString()); ClsUtility.AddParameters("@SupportQ1", SqlDbType.Int, obj.SupportQ1.ToString()); ClsUtility.AddParameters("@SupportQ2", SqlDbType.Int, obj.SupportQ2.ToString()); ClsUtility.AddParameters("@SupportQ3", SqlDbType.Int, obj.SupportQ3.ToString()); ClsUtility.AddParameters("@SupportQ4", SqlDbType.Int, obj.SupportQ4.ToString()); ClsUtility.AddParameters("@SupportQ5", SqlDbType.Int, obj.SupportQ5.ToString()); DataTable dt = (DataTable)clsObjTP.ReturnObject(ClsUtility.theParams, "Pr_HIVCE_UpdateARTReadinessAssessment", ClsDBUtility.ObjectEnum.DataTable); } catch (Exception ex) { flag = false; throw ex; } finally { clsObjTP = null; if (this.Connection != null) { DataMgr.ReleaseConnection(this.Connection); } } }
public ARTReadinessAssessment GetARTReadinessAssessment(int ptn_pk, int visitPK) { CLogger.WriteLog(ELogLevel.INFO, "BLARTReadinessAssessment.GetARTReadinessAssessment() method called"); ARTReadinessAssessment tp = new ARTReadinessAssessment(); try { dbLayer = new DBARTReadinessAssessment(); DataTable dtARA = dbLayer.GetARTReadinessAssessment(ptn_pk, visitPK); if (dtARA.Rows.Count > 0) { tp = (from dt in dtARA.AsEnumerable() select new ARTReadinessAssessment() { Id = dt.Field <int>("Id"), Ptn_pk = dt.Field <int>("Ptn_pk"), Visit_Id = dt.Field <int>("Visit_Id"), PsychosocialQ1 = dt.Field <int?>("PsychosocialQ1"), PsychosocialQ2 = dt.Field <int?>("PsychosocialQ2"), PsychosocialQ3 = dt.Field <int?>("PsychosocialQ3"), PsychosocialQ4 = dt.Field <int?>("PsychosocialQ4"), PsychosocialQ5 = dt.Field <int?>("PsychosocialQ5"), PsychosocialQ6 = dt.Field <int?>("PsychosocialQ6"), PsychosocialQ7 = dt.Field <int?>("PsychosocialQ7"), PsychosocialQ8 = dt.Field <int?>("PsychosocialQ8"), PsychosocialQ9 = dt.Field <int?>("PsychosocialQ9"), PsychosocialQ10 = dt.Field <int?>("PsychosocialQ10"), SupportQ1 = dt.Field <int?>("SupportQ1"), SupportQ2 = dt.Field <int?>("SupportQ2"), SupportQ3 = dt.Field <int?>("SupportQ3"), SupportQ4 = dt.Field <int?>("SupportQ4"), SupportQ5 = dt.Field <int?>("SupportQ5") }).FirstOrDefault(); } } catch (Exception ex) { CLogger.WriteLog(ELogLevel.ERROR, "BLARTReadinessAssessment.GetARTReadinessAssessment() Method:" + ex.ToString()); } return(tp); }