public DataTable GetTransition(int ptn_pk, int visitPK) { CLogger.WriteLog(ELogLevel.INFO, "DBTransition.GetTransition() Method Called."); DataTable dt = new DataTable(); ClsObject clsObjTP = new ClsObject(); try { ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, ptn_pk.ToString()); ClsUtility.AddParameters("@Visit_Id", SqlDbType.Int, visitPK.ToString()); dt = (DataTable)clsObjTP.ReturnObject(ClsUtility.theParams, "Pr_HIVCE_GetPatientTransition", ClsDBUtility.ObjectEnum.DataTable); } catch (Exception ex) { throw ex; } finally { clsObjTP = null; if (this.Connection != null) { DataMgr.ReleaseConnection(this.Connection); } } return(dt); }
public int SaveBudgetConfigDetails(DataTable BudgetConfigDataSet, DataTable CostAllocationDataSet, int UserId, Hashtable SelectedValues) { ClsObject ItemList = new ClsObject(); int theRowAffected = 0; DataRow drBudgetConfig; string BudgetConfigId = SelectedValues["BudgetConfigureID"].ToString(); foreach (DataRow cadDR in CostAllocationDataSet.Rows) { foreach (DataRow theDR in BudgetConfigDataSet.Rows) { if (theDR[0].ToString() != "13") { for (int i = 2; i <= BudgetConfigDataSet.Columns.Count - 2; i++) { ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@BudgetConfigID", SqlDbType.Int, BudgetConfigId); ClsUtility.AddParameters("@DonorID", SqlDbType.Int, SelectedValues["DonorID"].ToString()); ClsUtility.AddParameters("@ProgramID", SqlDbType.Int, SelectedValues["ProgramID"].ToString()); ClsUtility.AddParameters("@ProgramStartYear", SqlDbType.Int, SelectedValues["ProgramYear"].ToString()); ClsUtility.AddParameters("@CostAllocationID", SqlDbType.Int, cadDR[i].ToString()); ClsUtility.AddParameters("@BudgetMonthID", SqlDbType.Int, theDR[0].ToString()); ClsUtility.AddParameters("@BudgetAmt", SqlDbType.Float, theDR[i].ToString()); ClsUtility.AddParameters("@DeleteFlag", SqlDbType.Int, "0"); ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString()); ClsUtility.AddParameters("@CurrYear", SqlDbType.Int, theDR[1].ToString().Split(' ').Last()); drBudgetConfig = (DataRow)ItemList.ReturnObject(ClsUtility.theParams, "pr_SCM_SaveBudgetConfigDetail", ClsDBUtility.ObjectEnum.DataRow); BudgetConfigId = drBudgetConfig[0].ToString(); } } } } return(theRowAffected); }
private void btnOK_Click(object sender, EventArgs e) { ClsUtility.Init_Hashtable(); string ParamValue = ""; string ParamName = ""; try { for (int i = 0; i < dgvQryParams.Rows.Count; i++) { ParamName = dgvQryParams.Rows[i].Cells[0].Value.ToString(); ParamValue = dgvQryParams.Rows[i].Cells[2].Value.ToString(); ClsUtility.AddParameters(ParamName, SqlDbType.Text, ParamValue); this.Close(); } } catch (Exception ex) { if (ex.GetType().ToString() == "System.NullReferenceException") { if (MessageBox.Show("One Or More Parameters Was Not Provided", "Query Parameters" , MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error) != DialogResult.Retry) { this.Close(); } } else { MessageBox.Show(ex.Message); } } }
public DataTable GetPharmacyRegimenClassification() { ClsUtility.Init_Hashtable(); ClsObject theManager = new ClsObject(); return((DataTable)theManager.ReturnObject(ClsUtility.theParams, "sp_getRegimenClassification", ClsUtility.ObjectEnum.DataTable)); }
public DataTable GetCustomList(string TableName, int Category, int SystemId) { if ((TableName == "PreDefinedDruglist") || (TableName == "PreDefinedLablist")) { TableName = "lnk_" + TableName; } else if (TableName.ToUpper().StartsWith("VW_")) { //TableName = TableName; } else { TableName = "mst_" + TableName; } ClsObject CustomManager = new ClsObject(); lock (this) { ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@TableName", SqlDbType.VarChar, TableName); ClsUtility.AddParameters("@CategoryType", SqlDbType.Int, Category.ToString()); ClsUtility.AddParameters("@SystemId", SqlDbType.Int, SystemId.ToString()); return((DataTable)CustomManager.ReturnObject(ClsUtility.theParams, "Pr_Admin_GetCustomListMasters_Constella", ClsDBUtility.ObjectEnum.DataTable)); } }
public List <PatientVital> GetAllPatientVitals(int patientId) { lock (this) { ClsObject PatientEncounter = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@PatientId", SqlDbType.Int, patientId.ToString()); DataTable theDT = (DataTable)PatientEncounter.ReturnObject(ClsUtility.theParams, "sp_getAllPatientVitals", ClsUtility.ObjectEnum.DataTable); List <PatientVital> list = new List <PatientVital>(); for (int i = 0; i < theDT.Rows.Count; i++) { PatientVital pv = new PatientVital(); pv.PatientId = Convert.ToInt32(theDT.Rows[i]["patientid"]); pv.Height = Convert.ToDecimal(theDT.Rows[i]["height"]); pv.Weight = Convert.ToDecimal(theDT.Rows[i]["weight"]); pv.BMI = Convert.ToDecimal(theDT.Rows[i]["bmi"]); pv.CreateDate = Convert.ToDateTime(theDT.Rows[i]["createdate"]); list.Add(pv); } return(list); } }
public DataSet GetVisitForms() { ClsObject VisitManager = new ClsObject(); ClsUtility.Init_Hashtable(); return((DataSet)VisitManager.ReturnObject(ClsUtility.theParams, "pr_Admin_SelectVisitType", ClsDBUtility.ObjectEnum.DataSet)); }
//private readonly UnitOfWork _unitOfWork = new UnitOfWork(new GreencardContext()); // internal int Result; public int AddPatient(PatientEntity patient) { int patientId = 0; ClsObject obj = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddExtendedParameters("@PersonId", SqlDbType.Int, patient.PersonId); ClsUtility.AddExtendedParameters("@ptn_pk", SqlDbType.Int, patient.ptn_pk); ClsUtility.AddExtendedParameters("@PatientIndex", SqlDbType.VarChar, patient.PatientIndex); ClsUtility.AddExtendedParameters("@DateOfBirth", SqlDbType.DateTime, patient.DateOfBirth); ClsUtility.AddExtendedParameters("@NationalId", SqlDbType.VarChar, patient.NationalId); ClsUtility.AddExtendedParameters("@FacilityId", SqlDbType.Int, patient.FacilityId); ClsUtility.AddExtendedParameters("@UserId", SqlDbType.Int, patient.CreatedBy); ClsUtility.AddExtendedParameters("@Active", SqlDbType.Bit, patient.Active); ClsUtility.AddExtendedParameters("@PatientType", SqlDbType.Int, patient.PatientType); ClsUtility.AddExtendedParameters("@DobPrecision", SqlDbType.Bit, patient.DobPrecision); DataTable dt = (DataTable)obj.ReturnObject(ClsUtility.theParams, "Patient_Insert", ClsUtility.ObjectEnum.DataTable); if (dt != null && dt.Rows.Count > 0) { patientId = Convert.ToInt32(dt.Rows[0]["Id"]); } return(patientId); /*_unitOfWork.PatientRepository.Add(patient); * Result = _unitOfWork.Complete(); * return patient.Id;*/ }
private void LogMessage(string PatientPK, string Phone, string Msg, int MsgStatus) { ClsUtility.Init_Hashtable(); string sSQl = string.Empty; string CurrentDate = DateTime.Now.ToShortDateString(); if (MsgStatus == MSG_SENT) { sSQl = "INSERT INTO aa_SMSLogs ( PatientPK , Phone , Message , MsgSent , MsgFailed , MsgReceived , LogDate , UserID)" + "VALUES('" + PatientPK + "', '" + Phone + "', '" + Msg + "','1','0','0'," + CurrentDate + ",'0')"; } else if (MsgStatus == MSG_FAILED) { sSQl = "INSERT INTO aa_SMSLogs ( PatientPK , Phone , Message , MsgSent , MsgFailed , MsgReceived , LogDate , UserID)" + "VALUES('" + PatientPK + "', '" + Phone + "', '" + Msg + "','0','1','0'," + CurrentDate + ",'0')"; } else if (MsgStatus == MSG_RECEIVED) { sSQl = "INSERT INTO aa_SMSLogs ( PatientPK , Phone , Message , MsgSent , MsgFailed , MsgReceived , LogDate , UserID)" + "VALUES('" + PatientPK + "', '" + Phone + "', '" + Msg + "','0','0','1'," + CurrentDate + ",'0')"; } //Log SMS try { theObject.ReturnObject(Entity.getconnString(xmlPath), ClsUtility.theParams, sSQl, ClsUtility.ObjectEnum.ExecuteNonQuery, ServerType); } catch (Exception ex) { WriteToEventLogs("Error while logging SMS: " + ex.Message, EventLogEntryType.Error); } }
public DataSet GetMySQLAuditTrailData() { ClsObject MySQLManager = new ClsObject(); ClsUtility.Init_Hashtable(); return((DataSet)MySQLManager.ReturnMySQLObject(ClsUtility.theParams, "GetAuditTrails", ClsDBUtility.ObjectEnum.DataSet)); }
/// <summary> /// Gets the business rule. /// </summary> /// <param name="moduleId">The module identifier.</param> /// <returns></returns> public List <ServiceRule> GetBusinessRule(int?moduleId = null) { ClsObject BusinessRule = new ClsObject(); ClsUtility.Init_Hashtable(); if (moduleId.HasValue) { ClsUtility.AddExtendedParameters("@ModuleId", SqlDbType.Int, moduleId.Value); } DataTable dt = (DataTable)BusinessRule.ReturnObject(ClsUtility.theParams, "ServiceArea_GetBusinessRule", ClsUtility.ObjectEnum.DataTable); var result = (from row in dt.AsEnumerable() select new ServiceRule() { Id = Convert.ToInt32(row["Id"]), MinValue = Convert.ToString(row["MinValue"]), MaxValue = Convert.ToString(row["MaxValue"]), RuleSet = Convert.ToInt32(row["RuleSet"]), ServiceAreaId = Convert.ToInt32(row["ModuleId"]), BusinessRule = new BusinessRule() { RuleId = Convert.ToInt32(row["BusRuleId"]), RuleName = Convert.ToString(row["BusRuleName"]), ReferenceId = Convert.ToString(row["BusRuleReferenceId"]), DeleteFlag = Convert.ToBoolean(row["BusRuleDeleteFlag"]) } } ).ToList <ServiceRule>(); return(result); }
public DataTable SaveLPTF(String LPTFID, String LPTFName, String Answer, String Status, String theUserID, String SystemID, String Flag) { DataTable Rowaffected = new DataTable(); ClsObject CustomManager = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@LPTFID", SqlDbType.VarChar, LPTFID); ClsUtility.AddParameters("@LPTFName", SqlDbType.VarChar, LPTFName); ClsUtility.AddParameters("@Answer", SqlDbType.VarChar, Answer); ClsUtility.AddParameters("@Status", SqlDbType.VarChar, Status); ClsUtility.AddParameters("@UserID", SqlDbType.VarChar, theUserID); ClsUtility.AddParameters("@SystemID", SqlDbType.VarChar, SystemID); ClsUtility.AddParameters("@Flag", SqlDbType.VarChar, Flag); if (Flag == "0") { Rowaffected = (DataTable)CustomManager.ReturnObject(ClsUtility.theParams, "Pr_Admin_SaveLPTFPatientTransfer_Constella", ClsDBUtility.ObjectEnum.DataTable); } else if (Flag == "1") { Rowaffected = (DataTable)CustomManager.ReturnObject(ClsUtility.theParams, "Pr_Admin_SaveLPTFPatientTransfer_Constella", ClsDBUtility.ObjectEnum.DataTable); } else if (Flag == "2") { Rowaffected = (DataTable)CustomManager.ReturnObject(ClsUtility.theParams, "Pr_Admin_SaveLPTFPatientTransfer_Constella", ClsDBUtility.ObjectEnum.DataTable); } return(Rowaffected); }
public void SavePatientWaitList(DataTable WaitingList, int ModuleID, int UserID, int PatientID) { System.Text.StringBuilder sbItems = new System.Text.StringBuilder("<root>"); foreach (DataRow row in WaitingList.Rows) { sbItems.Append("<row>"); sbItems.Append(String.Format("<WaitingListID>{0}</WaitingListID>", row["WaitingListID"])); sbItems.Append(String.Format("<ListID>{0}</ListID>", row["ListID"])); sbItems.Append(String.Format("<Priority>{0}</Priority>", row["Priority"])); sbItems.Append(String.Format("<RowStatus>{0}</RowStatus>", row["RowStatus"])); sbItems.Append(String.Format("<WaitingFor>{0}</WaitingFor>", row["WaitingFor"])); sbItems.Append("</row>"); } sbItems.Append("</root>"); lock (this) { ClsUtility.Init_Hashtable(); ClsUtility.AddExtendedParameters("@ItemsList", SqlDbType.Xml, sbItems.ToString()); ClsUtility.AddParameters("@PatientID", SqlDbType.Int, PatientID.ToString()); ClsUtility.AddParameters("@ModuleID", SqlDbType.Int, ModuleID.ToString()); ClsUtility.AddParameters("@UserID", SqlDbType.Int, UserID.ToString()); ClsObject BillManager = new ClsObject(); BillManager.ReturnObject(ClsUtility.theParams, "pr_WaitingList_SavePatientsWaitingList", ClsDBUtility.ObjectEnum.ExecuteNonQuery); } }
public int SaveUpdateVillageChairperson(int RegionID, int DistrictID, int WardID, int VillageId, string CPersonName, int UserId, int flag) { ClsObject CustomManager = new ClsObject(); try { this.Connection = DataMgr.GetConnection(); CustomManager.Connection = this.Connection; this.Transaction = DataMgr.BeginTransaction(this.Connection); CustomManager.Transaction = this.Transaction; ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@RegionId", SqlDbType.Int, RegionID.ToString()); ClsUtility.AddParameters("@DistrictID", SqlDbType.Int, DistrictID.ToString()); ClsUtility.AddParameters("@WardID", SqlDbType.Int, WardID.ToString()); ClsUtility.AddParameters("@VillageId", SqlDbType.Int, VillageId.ToString()); ClsUtility.AddParameters("@CPersonName", SqlDbType.Int, CPersonName.ToString()); ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString()); ClsUtility.AddParameters("@FlagID", SqlDbType.Int, flag.ToString()); Int32 RowsAffected = (Int32)CustomManager.ReturnObject(ClsUtility.theParams, "Pr_Admin_SaveUpdateVillageChairperson_Constella", ClsDBUtility.ObjectEnum.ExecuteNonQuery); DataMgr.CommitTransaction(this.Transaction); return(RowsAffected); } catch { DataMgr.RollBackTransation(this.Transaction); throw; } finally { DataMgr.ReleaseConnection(this.Connection); } }
public int AddPerson(Person person) { int personId = -1; ClsObject obj = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddExtendedParameters("@FirstName", SqlDbType.VarChar, person.FirstName); ClsUtility.AddExtendedParameters("@MidName", SqlDbType.VarChar, person.MidName); ClsUtility.AddExtendedParameters("@LastName", SqlDbType.VarChar, person.LastName); ClsUtility.AddExtendedParameters("@Sex", SqlDbType.Int, person.Sex); if (person.DateOfBirth.HasValue) { ClsUtility.AddExtendedParameters("@DateOfBirth", SqlDbType.DateTime, person.DateOfBirth); } if (person.DobPrecision.HasValue) { ClsUtility.AddExtendedParameters("@DobPrecision", SqlDbType.Bit, person.DobPrecision); } //ClsUtility.AddExtendedParameters("@NationalId", SqlDbType.VarChar, person.NationalId); ClsUtility.AddExtendedParameters("@UserId", SqlDbType.Int, person.CreatedBy); DataTable dt = (DataTable)obj.ReturnObject(ClsUtility.theParams, "Person_Insert", ClsUtility.ObjectEnum.DataTable); if (dt != null && dt.Rows.Count > 0) { personId = Convert.ToInt32(dt.Rows[0]["PersonId"]); } // p.Add(person); obj = null; return(personId); }
public int UpdatePerson(Person person, int id) { int personId = -1; ClsObject obj = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddExtendedParameters("@FirstName", SqlDbType.VarChar, person.FirstName); ClsUtility.AddExtendedParameters("@MidName", SqlDbType.VarChar, person.MidName); ClsUtility.AddExtendedParameters("@LastName", SqlDbType.VarChar, person.LastName); ClsUtility.AddExtendedParameters("@Sex", SqlDbType.Int, person.Sex); //ClsUtility.AddExtendedParameters("@NationalId", SqlDbType.VarChar, person.NationalId); if (person.DateOfBirth.HasValue) { ClsUtility.AddExtendedParameters("@DateOfBirth", SqlDbType.DateTime, person.DateOfBirth); } ClsUtility.AddExtendedParameters("@Id", SqlDbType.Int, id); DataTable dt = (DataTable)obj.ReturnObject(ClsUtility.theParams, "Person_Update", ClsUtility.ObjectEnum.DataTable); if (dt != null && dt.Rows.Count > 0) { personId = Convert.ToInt32(dt.Rows[0]["PersonId"]); } obj = null; return(personId); }
public int ProcessMotherNames(string firstName, string middleName, string lastName, string cccNumber, int ptnpk) { try { int Id = -1; ClsObject obj = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddExtendedParameters("@firstName", SqlDbType.VarChar, firstName); ClsUtility.AddExtendedParameters("@middleName", SqlDbType.VarChar, middleName); ClsUtility.AddExtendedParameters("@lastName", SqlDbType.VarChar, lastName); ClsUtility.AddExtendedParameters("@cccNumber", SqlDbType.VarChar, cccNumber); ClsUtility.AddExtendedParameters("@ptnpk", SqlDbType.VarChar, ptnpk); DataTable dt = (DataTable)obj.ReturnObject(ClsUtility.theParams, "Psmart_ProcessMotherDetails", ClsUtility.ObjectEnum.DataTable); if (dt != null && dt.Rows.Count > 0) { Id = Convert.ToInt32(dt.Rows[0]["Id"]); } // p.Add(person); obj = null; return(Id); } catch (Exception e) { Console.WriteLine(e); throw; } }
private void getReports() { string sp = "pr_GetReports_IQTools"; Entity en = new Entity(); ClsUtility.Init_Hashtable(); try { reportsDS = (DataSet)en.ReturnObject(iqtoolsConnString , ClsUtility.theParams, sp, ClsUtility.ObjectEnum.DataSet, server); //cboSelectReport.DataSource = new BindingSource(reportsDS.Tables[0], null); //cboSelectReport.DisplayMember = "ReportDisplayName"; //cboSelectReport.ValueMember = "ReportID"; } catch (Exception ex) { MessageBox.Show(ex.Message); } // try { //tlPSelectReport.RowCount += 1; //DataTableReader dr = reportsDS.Tables[0].CreateDataReader(); DataTableReader groups = reportsDS.Tables[7].CreateDataReader(); while (groups.Read()) { Label partition = new Label(); //Partition? tlPSelectReport.RowCount = tlPSelectReport.RowCount + 1; partition.Text = groups["GroupName"].ToString(); partition.ForeColor = Color.DarkGreen; partition.Anchor = AnchorStyles.Left; partition.AutoSize = true; tlPSelectReport.Controls.Add(partition, 1, tlPSelectReport.RowCount); DataTable currentGroup = reportsDS.Tables[0].DefaultView.ToTable(); currentGroup.DefaultView.RowFilter = "GroupName = '" + groups["GroupName"].ToString() + "'"; currentGroup = currentGroup.DefaultView.ToTable(); DataTableReader dr = currentGroup.CreateDataReader(); while (dr.Read()) { tlPSelectReport.RowCount = tlPSelectReport.RowCount + 1; RadioButton rd = new RadioButton(); rd.CheckedChanged += new EventHandler(Rd_CheckedChanged); rd.Name = dr["ReportName"].ToString(); rd.Text = dr["ReportDisplayName"].ToString(); rd.TabIndex = Convert.ToInt16(dr["ReportID"].ToString()); rd.AutoSize = true; rd.ForeColor = Color.SteelBlue; tlPSelectReport.Controls.Add(rd, 1, tlPSelectReport.RowCount); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } // }
public void DeleteModule(Int32 ModuleId) { try { this.Connection = DataMgr.GetConnection(); this.Transaction = DataMgr.BeginTransaction(this.Connection); ClsObject ModuleMgr = new ClsObject(); ModuleMgr.Connection = this.Connection; ModuleMgr.Transaction = this.Transaction; ClsObject BusinessRule = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@ModuleId", SqlDbType.VarChar, ModuleId.ToString()); Int32 NoRowsEffected = (Int32)BusinessRule.ReturnObject(ClsUtility.theParams, "pr_FormBuilder_DeleteModule_Future", ClsUtility.ObjectEnum.ExecuteNonQuery); DataMgr.CommitTransaction(this.Transaction); DataMgr.ReleaseConnection(this.Connection); } catch { DataMgr.RollBackTransation(this.Transaction); throw; } finally { if (this.Connection != null) { DataMgr.ReleaseConnection(this.Connection); } } }
////public int SaveConditionalFields(DataTable dtconditionalFields) ////{ //// ClsObject conditionalfields = new ClsObject(); //// int theRowAffected = 0; //// for (int i = 0; i <= dtconditionalFields.Rows.Count - 1; i++) //// { //// ClsUtility.Init_Hashtable(); //// if(dtconditionalFields.Rows[i]["id"].ToString()=="0") //// { //// ClsUtility.AddParameters("@Id", SqlDbType.Int, dtconditionalFields.Rows[i]["id"].ToString()); //// ClsUtility.AddParameters("@ConfieldId", SqlDbType.Int, dtconditionalFields.Rows[i]["ConfieldId"].ToString()); //// ClsUtility.AddParameters("@SectionId", SqlDbType.Int, dtconditionalFields.Rows[i]["SectionId"].ToString()); //// ClsUtility.AddParameters("@FieldId", SqlDbType.Int, dtconditionalFields.Rows[i]["FieldId"].ToString()); //// ClsUtility.AddParameters("@FieldLabel", SqlDbType.VarChar, dtconditionalFields.Rows[i]["FieldLabel"].ToString()); //// ClsUtility.AddParameters("@Predefined", SqlDbType.Int, dtconditionalFields.Rows[i]["Predefined"].ToString()); //// ClsUtility.AddParameters("@Seq", SqlDbType.Int, (i + 1).ToString()); //// ClsUtility.AddParameters("@UserId", SqlDbType.Int, dtconditionalFields.Rows[i]["UserId"].ToString()); //// theRowAffected = (int)conditionalfields.ReturnObject(ClsUtility.theParams, "Pr_FormBuilder_SavelnkConditionalForm_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery); //// } //// else //// { //// ClsUtility.AddParameters("@Id", SqlDbType.Int, dtconditionalFields.Rows[i]["id"].ToString()); //// ClsUtility.AddParameters("@ConfieldId", SqlDbType.Int, dtconditionalFields.Rows[i]["ConfieldId"].ToString()); //// ClsUtility.AddParameters("@SectionId", SqlDbType.Int, dtconditionalFields.Rows[i]["SectionId"].ToString()); //// ClsUtility.AddParameters("@FieldId", SqlDbType.Int, dtconditionalFields.Rows[i]["FieldId"].ToString()); //// ClsUtility.AddParameters("@FieldLabel", SqlDbType.VarChar, dtconditionalFields.Rows[i]["FieldLabel"].ToString()); //// ClsUtility.AddParameters("@Predefined", SqlDbType.Int, dtconditionalFields.Rows[i]["Predefined"].ToString()); //// ClsUtility.AddParameters("@Seq", SqlDbType.Int, (i + 1).ToString()); //// ClsUtility.AddParameters("@UserId", SqlDbType.Int, dtconditionalFields.Rows[i]["UserId"].ToString()); //// theRowAffected = (int)conditionalfields.ReturnObject(ClsUtility.theParams, "Pr_FormBuilder_SavelnkConditionalForm_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery); //// } //// } //// //if (theRowAffected == 0) //// //{ //// // MsgBuilder theMsg = new MsgBuilder(); //// // theMsg.DataElements["MessageText"] = "Error in Saving ConditionalFields. Try Again.."; //// // AppException.Create("#C1", theMsg); //// //} //// return theRowAffected; ////} public int SaveModDeCode(DataTable dtModDeCode) { lock (this) { ClsObject conditionalfields = new ClsObject(); int theRowAffected = 0; for (int i = 0; i <= dtModDeCode.Rows.Count - 1; i++) { ClsUtility.Init_Hashtable(); if (dtModDeCode.Rows[i]["FieldID"].ToString() != "0") { ClsUtility.AddParameters("@FieldID", SqlDbType.Int, dtModDeCode.Rows[i]["FieldID"].ToString()); ClsUtility.AddParameters("@CodeName", SqlDbType.VarChar, dtModDeCode.Rows[i]["CodeName"].ToString()); ClsUtility.AddParameters("@Predefined", SqlDbType.Int, dtModDeCode.Rows[i]["Predefined"].ToString()); ClsUtility.AddParameters("@Index", SqlDbType.Int, (i + 1).ToString()); ClsUtility.AddParameters("@UserID", SqlDbType.Int, dtModDeCode.Rows[i]["UserID"].ToString()); ClsUtility.AddParameters("@SystemID", SqlDbType.Int, dtModDeCode.Rows[i]["SystemID"].ToString()); theRowAffected = (int)conditionalfields.ReturnObject(ClsUtility.theParams, "Pr_PMTCT_SaveModDeCode_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery); } } //if (theRowAffected == 0) //{ // MsgBuilder theMsg = new MsgBuilder(); // theMsg.DataElements["MessageText"] = "Error in Saving ConditionalFields. Try Again.."; // AppException.Create("#C1", theMsg); //} return(theRowAffected); } }
public DataTable GetPMTCTPeriodDrugTaken() { ClsUtility.Init_Hashtable(); ClsObject theManager = new ClsObject(); return((DataTable)theManager.ReturnObject(ClsUtility.theParams, "sp_getPMTCTPeriodDrugTaken", ClsUtility.ObjectEnum.DataTable)); }
public List <PharmacyFields> getPharmacyFields(string patientMasterVisitID) { lock (this) { ClsObject PatientEncounter = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@PatientMasterVisitID", SqlDbType.Int, patientMasterVisitID); DataTable theDT = (DataTable)PatientEncounter.ReturnObject(ClsUtility.theParams, "sp_getPharmacyFields", ClsUtility.ObjectEnum.DataTable); List <PharmacyFields> list = new List <PharmacyFields>(); for (int i = 0; i < theDT.Rows.Count; i++) { PharmacyFields drg = new PharmacyFields(); drg.TreatmentProgram = theDT.Rows[i]["ProgID"].ToString(); drg.PeriodTaken = theDT.Rows[i]["pharmacyPeriodTaken"].ToString(); drg.TreatmentPlan = theDT.Rows[i]["TreatmentStatusId"].ToString(); drg.TreatmentPlanReason = theDT.Rows[i]["TreatmentStatusReasonId"].ToString(); drg.RegimenLine = theDT.Rows[i]["RegimenLineId"].ToString(); drg.Regimen = theDT.Rows[i]["RegimenId"].ToString(); drg.prescriptionDate = theDT.Rows[i]["OrderedByDate"].ToString(); drg.dispenseDate = theDT.Rows[i]["DispensedByDate"].ToString(); list.Add(drg); } return(list); } }
public DataSet PatientPrevProgram(int Ptn_Pk) { ClsObject CareManager = new ClsObject(); int RowsAffected; try { ClsUtility.Init_Hashtable(); this.Connection = DataMgr.GetConnection(); this.Transaction = DataMgr.BeginTransaction(this.Connection); CareManager.Connection = this.Connection; CareManager.Transaction = this.Transaction; DataSet theDs = new DataSet(); ClsUtility.AddParameters("@Ptn_Pk", SqlDbType.Int, Ptn_Pk.ToString()); return((DataSet)CareManager.ReturnObject(ClsUtility.theParams, "pr_Scheduler_PatientPrevProgram_Constella", ClsDBUtility.ObjectEnum.DataSet)); DataMgr.CommitTransaction(this.Transaction); DataMgr.ReleaseConnection(this.Connection); } catch { DataMgr.RollBackTransation(this.Transaction); throw; } finally { CareManager = null; if (this.Connection != null) { DataMgr.ReleaseConnection(this.Connection); } } }
public int SaveUpdateCustomMasterLinkRecord(string TableName, int CodeId1, int CodeId2, int UserId) { TableName = "lnk_" + TableName; ClsObject CustomManager = new ClsObject(); try { this.Connection = DataMgr.GetConnection(); CustomManager.Connection = this.Connection; this.Transaction = DataMgr.BeginTransaction(this.Connection); CustomManager.Transaction = this.Transaction; ClsUtility.Init_Hashtable(); ClsUtility.AddParameters("@TableName", SqlDbType.VarChar, TableName); ClsUtility.AddParameters("@CodeId1", SqlDbType.Int, CodeId1.ToString()); ClsUtility.AddParameters("@CodeId2", SqlDbType.Int, CodeId2.ToString()); ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString()); Int32 RowsAffected = (Int32)CustomManager.ReturnObject(ClsUtility.theParams, "Pr_Admin_SaveUpdateCustomMastersLink_Constella", ClsDBUtility.ObjectEnum.ExecuteNonQuery); DataMgr.CommitTransaction(this.Transaction); return(RowsAffected); } catch { DataMgr.RollBackTransation(this.Transaction); throw; } finally { DataMgr.ReleaseConnection(this.Connection); } }
/// <summary> /// Gets the x rays orders. /// </summary> /// <param name="LocationID">The location identifier.</param> /// <param name="PatientID">The patient identifier.</param> /// <param name="DateFrom">The date from.</param> /// <param name="DateTo">The date to.</param> /// <param name="Status">The status.</param> /// <returns></returns> public DataTable GetXRaysOrders(int LocationID, int?OrderID = null, int?PatientID = null, DateTime?DateFrom = null, DateTime?DateTo = null, string Status = "All") { lock (this) { try { ClsObject theON = new ClsObject(); ClsUtility.Init_Hashtable(); ClsUtility.AddExtendedParameters("@LocationID", SqlDbType.Int, LocationID); if (OrderID.HasValue) { ClsUtility.AddExtendedParameters("@OrderID", SqlDbType.Int, OrderID.Value); } if (PatientID.HasValue) { ClsUtility.AddExtendedParameters("@PatientID", SqlDbType.Int, PatientID.Value); } if (DateFrom.HasValue) { ClsUtility.AddExtendedParameters("@DateFrom", SqlDbType.Int, DateFrom.Value); } if (DateTo.HasValue) { ClsUtility.AddExtendedParameters("@DateTo", SqlDbType.DateTime, DateTo.Value); } ClsUtility.AddParameters("@password", SqlDbType.VarChar, ApplicationAccess.DBSecurity); ClsUtility.AddParameters("@ProcessStatus", SqlDbType.VarChar, Status); return((DataTable)theON.ReturnObject(ClsUtility.theParams, "pr_Radiology_GetRequest", ClsUtility.ObjectEnum.DataTable)); } catch { throw; } } }