예제 #1
0
        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", ClsUtility.ObjectEnum.ExecuteNonQuery);
                DataMgr.CommitTransaction(this.Transaction);
                return(RowsAffected);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                DataMgr.ReleaseConnection(this.Connection);
            }
        }
예제 #2
0
        public DataSet Validate(string FormName, string Date, string PatientId)
        {
            DataSet theDS = new DataSet();

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);
                ClsObject MgrValidate = new ClsObject();
                MgrValidate.Connection  = this.Connection;
                MgrValidate.Transaction = this.Transaction;

                oUtility.Init_Hashtable();
                oUtility.AddParameters("@PatientId", SqlDbType.Int, PatientId.ToString());
                oUtility.AddParameters("@FormName", SqlDbType.VarChar, FormName.ToString());
                oUtility.AddParameters("@VisitDate", SqlDbType.VarChar, Date.ToString());
                return(theDS = (DataSet)MgrValidate.ReturnObject(oUtility.theParams, "pr_Clinical_ValidateCustomForm_Futures", ClsUtility.ObjectEnum.DataSet));
            }


            catch {
                throw;
            }

            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #3
0
        public DataTable GetAllSatellite()
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject SatelliteGetMgr = new ClsObject();
                SatelliteGetMgr.Connection  = this.Connection;
                SatelliteGetMgr.Transaction = this.Transaction;

                oUtility.Init_Hashtable();
                return((DataTable)SatelliteGetMgr.ReturnObject(oUtility.theParams, "pr_Admin_SelectSatellite_Constella", ClsUtility.ObjectEnum.DataTable));
            }
            catch
            {
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #4
0
        public int DeleteFamilyInfo(int Id, int @UserId)
        {
            try
            {
                int theAffectedRows = 0;
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject DeleteFamilyInfo = new ClsObject();
                DeleteFamilyInfo.Connection  = this.Connection;
                DeleteFamilyInfo.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@Id", SqlDbType.Int, Id.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());

                theAffectedRows = (int)DeleteFamilyInfo.ReturnObject(ClsUtility.theParams, "Pr_Clinical_DeleteFamilyInfo_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(theAffectedRows);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #5
0
파일: BModule.cs 프로젝트: wamathaga/IQCare
        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);
                }
            }
        }
예제 #6
0
        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);
                }
            }
        }
예제 #7
0
        //public DataTable GetPatientDetailsByEnrollment(string theEnrollID)
        //{
        //    ClsObject GetPatientDetails = new ClsObject();
        //    ClsUtility.Init_Hashtable();
        //    ClsUtility.AddParameters("@PatientEnrollmentID", SqlDbType.VarChar, theEnrollID);
        //    return (DataTable)GetPatientDetails.ReturnObject(ClsUtility.theParams, "pr_Admin_GetPatientDetailByEnrollment_Constella", ClsDBUtility.ObjectEnum.DataTable);
        //}

        public int DeletePatient(int PatientId, int UserID)
        {
            try
            {
                int theAffectedRows = 0;
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject DeletePatientDetails = new ClsObject();
                DeletePatientDetails.Connection  = this.Connection;
                DeletePatientDetails.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@PatientId", SqlDbType.Int, PatientId.ToString());
                ClsUtility.AddParameters("@UserID", SqlDbType.Int, UserID.ToString());
                theAffectedRows = (int)DeletePatientDetails.ReturnObject(ClsUtility.theParams, "pr_Admin_DeletePatient_Constella", ClsDBUtility.ObjectEnum.ExecuteNonQuery);

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(theAffectedRows);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #8
0
 public DataTable GetSatelliteByID_Name(string SatID, string SatName)
 {
     try
     {
         this.Connection  = DataMgr.GetConnection();
         this.Transaction = DataMgr.BeginTransaction(this.Connection);
         ClsObject SatelliteEditMgr = new ClsObject();
         SatelliteEditMgr.Connection  = this.Connection;
         SatelliteEditMgr.Transaction = this.Transaction;
         oUtility.Init_Hashtable();
         oUtility.AddParameters("@SatID", SqlDbType.VarChar, SatID.ToString());
         oUtility.AddParameters("@SatName", SqlDbType.VarChar, SatName.ToString());
         return((DataTable)SatelliteEditMgr.ReturnObject(oUtility.theParams, "pr_Admin_GetSatellitebyID_Name_Constella", ClsUtility.ObjectEnum.DataTable));
     }
     catch
     {
         throw;
     }
     finally
     {
         if (this.Connection != null)
         {
             DataMgr.ReleaseConnection(this.Connection);
         }
     }
 }
예제 #9
0
        public DataSet Common_GetSaveUpdate(string Insert)
        {
            DataSet theDS = new DataSet();

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);
                ClsObject CustomMgrSave = new ClsObject();
                CustomMgrSave.Connection  = this.Connection;
                CustomMgrSave.Transaction = this.Transaction;
                oUtility.Init_Hashtable();
                oUtility.AddParameters("@Insert", SqlDbType.VarChar, Insert.ToString());
                theDS = (DataSet)CustomMgrSave.ReturnObject(oUtility.theParams, "pr_Clinical_SaveCustomForm_Constella", ClsUtility.ObjectEnum.DataSet);
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(theDS);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }

            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #10
0
        public int SaveUpdateARTReadinessForm(int patientID, int VisitID, int LocationID, Hashtable ht, int userID)
        {
            DataSet   theDS;
            int       retval = 0;
            ClsObject KNHART = new ClsObject();

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                KNHART.Connection  = this.Connection;
                KNHART.Transaction = this.Transaction;

                oUtility.Init_Hashtable();
                oUtility.AddParameters("@patientid", SqlDbType.Int, patientID.ToString());
                oUtility.AddParameters("@locationid", SqlDbType.Int, LocationID.ToString());
                oUtility.AddParameters("@Visit_ID", SqlDbType.Int, VisitID.ToString());
                oUtility.AddParameters("@UserId", SqlDbType.Int, userID.ToString());

                /*** ART Parameters ***/
                oUtility.AddParameters("@UnderstandHiv", SqlDbType.VarChar, ht["UnderstandHiv"].ToString());
                oUtility.AddParameters("@ScreenDrug", SqlDbType.VarChar, ht["ScreenDrug"].ToString());
                oUtility.AddParameters("@ScreenDepression", SqlDbType.VarChar, ht["ScreenDepression"].ToString());
                oUtility.AddParameters("@DiscloseStatus", SqlDbType.VarChar, ht["DiscloseStatus"].ToString());
                oUtility.AddParameters("@ArtDemonstration", SqlDbType.VarChar, ht["ArtDemonstration"].ToString());
                oUtility.AddParameters("@ReceivedInformation", SqlDbType.VarChar, ht["ReceivedInformation"].ToString());
                oUtility.AddParameters("@CaregiverDependant", SqlDbType.VarChar, ht["CaregiverDependant"].ToString());
                oUtility.AddParameters("@IdentifiedBarrier", SqlDbType.VarChar, ht["IdentifiedBarrier"].ToString());
                oUtility.AddParameters("@CaregiverLocator", SqlDbType.VarChar, ht["CaregiverLocator"].ToString());
                oUtility.AddParameters("@CaregiverReady", SqlDbType.VarChar, ht["CaregiverReady"].ToString());
                oUtility.AddParameters("@TimeIdentified", SqlDbType.VarChar, ht["TimeIdentified"].ToString());
                oUtility.AddParameters("@IdentifiedTreatmentSupporter", SqlDbType.VarChar, ht["IdentifiedTreatmentSupporter"].ToString());
                oUtility.AddParameters("@GroupMeeting", SqlDbType.VarChar, ht["GroupMeeting"].ToString());
                oUtility.AddParameters("@SmsReminder", SqlDbType.VarChar, ht["SmsReminder"].ToString());
                oUtility.AddParameters("@PlannedSupport", SqlDbType.VarChar, ht["PlannedSupport"].ToString());
                oUtility.AddParameters("@DeferArt", SqlDbType.VarChar, ht["DeferArt"].ToString());
                oUtility.AddParameters("@MeningitisDiagnosed", SqlDbType.VarChar, ht["MeningitisDiagnosed"].ToString());
                oUtility.AddParameters("@visitdate", SqlDbType.Date, ht["visitDate"].ToString());
                oUtility.AddParameters("@DataQlty", SqlDbType.Date, "1");

                theDS = (DataSet)KNHART.ReturnObject(oUtility.theParams, "pr_KNHPMTCTART_SaveData", ClsUtility.ObjectEnum.DataSet);
                int VisitId = Convert.ToInt32(theDS.Tables[0].Rows[0]["Visit_Id"]);
                retval = VisitId;
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);

                //Former
                //int temp = (int)KNHART.ReturnObject(oUtility.theParams, "pr_KNHPMTCTART_SaveData", ClsUtility.ObjectEnum.ExecuteNonQuery);
                //DataMgr.CommitTransaction(this.Transaction);
                //DataMgr.ReleaseConnection(this.Connection);
                //retval = VisitID;
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            return(retval);
        }
예제 #11
0
        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", ClsUtility.ObjectEnum.ExecuteNonQuery);
                DataMgr.CommitTransaction(this.Transaction);
                return(RowsAffected);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                DataMgr.ReleaseConnection(this.Connection);
            }
        }
예제 #12
0
        public DataTable SaveNewEmployee(string FirstName, string LastName, int DesignationID, int EmployeeID, int DeleteFlag, int UserID)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);
                DataTable theAffectedDT;
                ClsObject EmployeeManager = new ClsObject();
                EmployeeManager.Connection  = this.Connection;
                EmployeeManager.Transaction = this.Transaction;


                oUtility.Init_Hashtable();
                oUtility.AddParameters("@FirstName", SqlDbType.VarChar, FirstName);
                oUtility.AddParameters("@LastName", SqlDbType.VarChar, LastName);
                oUtility.AddParameters("@DesignationID", SqlDbType.Int, DesignationID.ToString());
                oUtility.AddParameters("@UserId", SqlDbType.Int, UserID.ToString());

                if (EmployeeID == 0)
                {
                    theAffectedDT = (DataTable)EmployeeManager.ReturnObject(oUtility.theParams, "Pr_Admin_InsertEmployee_Constella", ClsUtility.ObjectEnum.DataTable);
                    if (theAffectedDT.Rows[0][0].ToString() == "-1")
                    {
                        MsgBuilder theBL = new MsgBuilder();
                        theBL.DataElements["MessageText"] = "Error in Saving Employee record. Try Again..";
                        Exception ex = AppException.Create("#C1", theBL);
                        throw ex;
                    }
                }
                else
                {
                    oUtility.AddParameters("@DeleteFlag", SqlDbType.Int, DeleteFlag.ToString());
                    oUtility.AddParameters("@EmployeeID", SqlDbType.Int, EmployeeID.ToString());
                    theAffectedDT = (DataTable)EmployeeManager.ReturnObject(oUtility.theParams, "Pr_Admin_UpdateEmployee_Constella", ClsUtility.ObjectEnum.DataTable);

                    if (theAffectedDT.Rows[0][0].ToString() == "-1")
                    {
                        MsgBuilder theBL = new MsgBuilder();
                        theBL.DataElements["MessageText"] = "Error in Saving Employee record. Try Again..";
                        Exception ex = AppException.Create("#C1", theBL);
                        throw ex;
                    }
                }

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(theAffectedDT);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #13
0
        public DataSet GetSatelliteByID_Edit(string ID)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject SatelliteEditMgr = new ClsObject();
                SatelliteEditMgr.Connection  = this.Connection;
                SatelliteEditMgr.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@ID", SqlDbType.VarChar, ID);
                return((DataSet)SatelliteEditMgr.ReturnObject(ClsUtility.theParams, "pr_Admin_GetSatelliteEdit_Constella", ClsDBUtility.ObjectEnum.DataSet));
            }
            catch
            {
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #14
0
        public int DeleteARTCareSummaryForm(string FormName, int OrderNo, int PatientId, int UserID)
        {
            try
            {
                int theAffectedRows = 0;
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject DeleteForm = new ClsObject();
                DeleteForm.Connection  = this.Connection;
                DeleteForm.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@OrderNo", SqlDbType.Int, OrderNo.ToString());
                ClsUtility.AddParameters("@FormName", SqlDbType.VarChar, FormName);
                ClsUtility.AddParameters("@PatientId", SqlDbType.Int, PatientId.ToString());
                ClsUtility.AddParameters("@UserID", SqlDbType.Int, UserID.ToString());
                theAffectedRows = (int)DeleteForm.ReturnObject(ClsUtility.theParams, "pr_Clinical_DeletePatientForms_Constella", ClsDBUtility.ObjectEnum.ExecuteNonQuery);
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(theAffectedRows);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #15
0
        /// <summary>
        /// Saves the update stock adjustment.
        /// </summary>
        /// <param name="theDTAdjustStock">The dt adjust stock.</param>
        /// <param name="LocationId">The location identifier.</param>
        /// <param name="StoreId">The store identifier.</param>
        /// <param name="AdjustmentDate">The adjustment date.</param>
        /// <param name="AdjustmentPreparedBy">The adjustment prepared by.</param>
        /// <param name="AdjustmentAuthorisedBy">The adjustment authorised by.</param>
        /// <param name="Updatestock">The updatestock.</param>
        /// <param name="UserID">The user identifier.</param>
        /// <returns></returns>
        public int SaveUpdateStockAdjustment(DataTable theDTAdjustStock, int LocationId, int StoreId,
                                             string AdjustmentDate, int AdjustmentPreparedBy, int AdjustmentAuthorisedBy,
                                             int Updatestock, int UserID)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject ObjStoreAdjust = new ClsObject();
                int       theRowAffected = 0;
                ClsUtility.Init_Hashtable();

                ClsUtility.AddParameters("@LocationId", SqlDbType.Int, LocationId.ToString());
                ClsUtility.AddParameters("@StoreId", SqlDbType.Int, StoreId.ToString());
                ClsUtility.AddParameters("@Updatestock", SqlDbType.Int, Updatestock.ToString());
                ClsUtility.AddParameters("@AdjustmentDate", SqlDbType.VarChar, AdjustmentDate.ToString());
                ClsUtility.AddParameters("@AdjustmentPreparedBy", SqlDbType.Int, AdjustmentPreparedBy.ToString());
                ClsUtility.AddParameters("@AdjustmentAuthorisedBy", SqlDbType.Int, AdjustmentAuthorisedBy.ToString());
                ClsUtility.AddParameters("@UserId ", SqlDbType.Int, UserID.ToString());
                DataRow theDR = (DataRow)ObjStoreAdjust.ReturnObject(ClsUtility.theParams, "Pr_SCM_SaveStockOrdAdjust_Futures", ClsUtility.ObjectEnum.DataRow);


                for (int i = 0; i < theDTAdjustStock.Rows.Count; i++)
                {
                    if (Convert.ToInt32(theDTAdjustStock.Rows[i]["AdjQty"]) > 0 || Convert.ToInt32(theDTAdjustStock.Rows[i]["AdjQty"]) < 0)
                    {
                        ClsUtility.Init_Hashtable();
                        ClsUtility.AddParameters("@Updatestock", SqlDbType.Int, Updatestock.ToString());
                        ClsUtility.AddParameters("@AdjustmentId", SqlDbType.Int, theDR["AdjustId"].ToString());
                        ClsUtility.AddParameters("@ItemId", SqlDbType.Int, theDTAdjustStock.Rows[i]["ItemId"].ToString());
                        ClsUtility.AddParameters("@BatchId", SqlDbType.Int, theDTAdjustStock.Rows[i]["BatchId"].ToString());
                        ClsUtility.AddExtendedParameters("@ExpiryDate", SqlDbType.DateTime, Convert.ToDateTime(theDTAdjustStock.Rows[i]["ExpiryDate"].ToString()));
                        ClsUtility.AddParameters("@StoreId", SqlDbType.Int, theDTAdjustStock.Rows[i]["StoreId"].ToString());
                        ClsUtility.AddParameters("@AdjustmentQuantity", SqlDbType.Int, theDTAdjustStock.Rows[i]["AdjQty"].ToString());
                        ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserID.ToString());
                        ClsUtility.AddParameters("@PurchaseUnit", SqlDbType.Int, theDTAdjustStock.Rows[i]["UnitId"].ToString());
                        ClsUtility.AddParameters("@AdjustReasonId ", SqlDbType.VarChar, theDTAdjustStock.Rows[i]["AdjustReasonId"].ToString());
                        theRowAffected =
                            (int)
                            ObjStoreAdjust.ReturnObject(ClsUtility.theParams, "Pr_SCM_SaveStockTransAdjust_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);
                    }
                }

                return(theRowAffected);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #16
0
        public DataSet SaveLabOrderTests(int Ptn_pk, int LocationID, DataTable ParameterID, int UserId, int OrderedByName, string OrderedByDate, string LabID, int FlagExist, string PreClinicLabDate)
        {
            ClsObject LabManagerTest = new ClsObject();

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                LabManagerTest.Connection  = this.Connection;
                LabManagerTest.Transaction = this.Transaction;
                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, Ptn_pk.ToString());
                ClsUtility.AddParameters("@LocationID", SqlDbType.Int, LocationID.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());
                ClsUtility.AddParameters("@LabTestId", SqlDbType.Int, "0");
                ClsUtility.AddParameters("@OrderedByName", SqlDbType.Int, OrderedByName.ToString());
                ClsUtility.AddParameters("@OrderedByDate", SqlDbType.DateTime, OrderedByDate.ToString());
                ClsUtility.AddParameters("@Flag", SqlDbType.Int, "0");
                ClsUtility.AddParameters("@LabID", SqlDbType.VarChar, LabID.ToString());
                ClsUtility.AddParameters("@FlagExist", SqlDbType.Int, FlagExist.ToString());

                ClsUtility.AddParameters("@PreClinicLabDate", SqlDbType.DateTime, PreClinicLabDate.ToString());
                DataSet dsLabTests = (DataSet)LabManagerTest.ReturnObject(ClsUtility.theParams, "Pr_Laboratory_SaveLabOrderTests_Constella", ClsUtility.ObjectEnum.DataSet);

                for (int i = 0; i < ParameterID.Rows.Count; i++)
                {
                    ClsUtility.Init_Hashtable();
                    ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, Ptn_pk.ToString());
                    ClsUtility.AddParameters("@LocationID", SqlDbType.Int, LocationID.ToString());
                    ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());
                    ClsUtility.AddParameters("@LabTestId", SqlDbType.Int, ParameterID.Rows[i][0].ToString());
                    ClsUtility.AddParameters("@OrderedByName", SqlDbType.Int, OrderedByName.ToString());
                    ClsUtility.AddParameters("@OrderedByDate", SqlDbType.DateTime, OrderedByDate.ToString());
                    ClsUtility.AddParameters("@Flag", SqlDbType.Int, "1");
                    ClsUtility.AddParameters("@LabID", SqlDbType.VarChar, LabID.ToString());
                    ClsUtility.AddParameters("@FlagExist", SqlDbType.Int, FlagExist.ToString());
                    ClsUtility.AddParameters("@PreClinicLabDate", SqlDbType.DateTime, PreClinicLabDate.ToString());
                    dsLabTests = (DataSet)LabManagerTest.ReturnObject(ClsUtility.theParams, "Pr_Laboratory_SaveLabOrderTests_Constella", ClsUtility.ObjectEnum.DataSet);
                }

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(dsLabTests);
            }

            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #17
0
        public int SaveUpdateImmunisationDetail(List <BIQTouchmmunisationFields> immnisationFields)
        {
            ClsObject immunisation   = new ClsObject();
            int       theRowAffected = 0;

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                immunisation.Connection  = this.Connection;
                immunisation.Transaction = this.Transaction;
                DataRow theDR;

                foreach (var Value in immnisationFields)
                {
                    oUtility.Init_Hashtable();
                    oUtility.AddParameters("@Ptn_pk", SqlDbType.Int, Value.Ptnpk.ToString());
                    oUtility.AddParameters("@LocationId", SqlDbType.Int, Value.LocationId.ToString());
                    oUtility.AddParameters("@Immunisation_code", SqlDbType.VarChar, Value.ImmunisationCode.ToString());

                    if (Value.ImmunisationDate.Year.ToString() != "1900")
                    {
                        oUtility.AddParameters("@ImmunisationDate", SqlDbType.VarChar, String.Format("{0:dd-MMM-yyyy}", Value.ImmunisationDate));
                    }


                    oUtility.AddParameters("@ImmunisationCU", SqlDbType.Int, Value.ImmunisationCU.ToString());
                    oUtility.AddParameters("@UserId", SqlDbType.Int, Value.UserId.ToString());
                    oUtility.AddParameters("@CardAvailabe", SqlDbType.Int, Value.CardAvailable.ToString());
                    oUtility.AddParameters("@ImmunisationOther", SqlDbType.VarChar, Value.ImmunisationOther);
                    oUtility.AddParameters("@Flag", SqlDbType.Int, Value.Flag.ToString());
                    theRowAffected = (int)immunisation.ReturnObject(oUtility.theParams, "Pr_IQTouch_Pharmacy_AddUpdateImmunisation", ClsUtility.ObjectEnum.ExecuteNonQuery);
                    if (theRowAffected == 0)
                    {
                        MsgBuilder theMsg = new MsgBuilder();
                        theMsg.DataElements["MessageText"] = "Error in Saving Immunisation Details. Try Again..";
                        AppException.Create("#C1", theMsg);
                    }
                }
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                immunisation = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }

            return(theRowAffected);
        }
예제 #18
0
        public int SaveExposedInfant(int Id, int Ptn_Pk, int ExposedInfantId, string FirstName, string LastName, DateTime DOB, string FeedingPractice3mos,
                                     string CTX2mos, string HIVTestType, string HIVResult, string FinalStatus, DateTime?DeathDate, int UserID)
        {
            int       theRowAffected = 0;
            ClsObject VisitManager   = new ClsObject();

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                VisitManager.Connection  = this.Connection;
                VisitManager.Transaction = this.Transaction;
                ClsUtility.Init_Hashtable();

                ClsUtility.AddParameters("@Id", SqlDbType.Int, Id.ToString());
                ClsUtility.AddParameters("@Ptn_Pk", SqlDbType.Int, Ptn_Pk.ToString());
                ClsUtility.AddParameters("@ExposedInfantId", SqlDbType.Int, ExposedInfantId.ToString());
                ClsUtility.AddParameters("@FirstName", SqlDbType.VarChar, FirstName.ToString());
                ClsUtility.AddParameters("@LastName", SqlDbType.VarChar, LastName.ToString());
                ClsUtility.AddParameters("@DOB", SqlDbType.DateTime, DOB.ToString());
                ClsUtility.AddParameters("@FeedingPractice3mos", SqlDbType.VarChar, FeedingPractice3mos.ToString());
                ClsUtility.AddParameters("@CTX2mos", SqlDbType.VarChar, CTX2mos.ToString());
                ClsUtility.AddParameters("@HIVResult", SqlDbType.VarChar, HIVResult.ToString());
                ClsUtility.AddParameters("@HIVTestType", SqlDbType.VarChar, HIVTestType.ToString());
                ClsUtility.AddParameters("@FinalStatus", SqlDbType.VarChar, FinalStatus.ToString());
                ClsUtility.AddParameters("@UserID", SqlDbType.VarChar, UserID.ToString());
                if (DeathDate != null)
                {
                    ClsUtility.AddParameters("@DeathDate", SqlDbType.VarChar, DeathDate == null ? null : DeathDate.ToString());
                }
                theRowAffected = (int)VisitManager.ReturnObject(ClsUtility.theParams, "pr_Clinical_SaveExposedInfant", ClsUtility.ObjectEnum.ExecuteNonQuery);
                if (theRowAffected == 0)
                {
                    MsgBuilder theMsg = new MsgBuilder();
                    theMsg.DataElements["MessageText"] = "Error in Saving Custom Field. Try Again..";
                    AppException.Create("#C1", theMsg);
                }
                else
                {
                    DataMgr.CommitTransaction(this.Transaction);
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                VisitManager = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
            return(theRowAffected);
        }
예제 #19
0
        public DataTable SavePatientIPTDetails(int facilityID, int ptnpk, int visitId,
                                               string IPT,
                                               string IPTAdherence,
                                               string IPTContraindication,
                                               string IPTDiscontinued,
                                               DateTime?IPTEndDate,
                                               DateTime?IPTStartDate,
                                               int EligibleForIPT,
                                               string otherReasonDeclinedIPT,
                                               string otherReasonDiscontinuedIPT
                                               )
        {
            ClsObject clsObj = new ClsObject();

            try
            {
                this.Connection    = DataMgr.GetConnection();
                this.Transaction   = DataMgr.BeginTransaction(this.Connection);
                clsObj.Connection  = this.Connection;
                clsObj.Transaction = this.Transaction;
                string dtVal = DBNull.Value.ToString();

                DataTable ReturnDT = new DataTable();

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, ptnpk.ToString());
                ClsUtility.AddParameters("@LocationId", SqlDbType.Int, facilityID.ToString());
                ClsUtility.AddParameters("@Visit_Pk", SqlDbType.Int, visitId.ToString());
                ClsUtility.AddParameters("@IPT", SqlDbType.Int, IPT.ToString());
                ClsUtility.AddParameters("@IPTAdherence", SqlDbType.Int, IPTAdherence.ToString());
                ClsUtility.AddParameters("@IPTContraindication", SqlDbType.Int, IPTContraindication.ToString());
                ClsUtility.AddParameters("@IPTDiscontinued", SqlDbType.Int, IPTDiscontinued.ToString());
                ClsUtility.AddParameters("@IPTEndDate", SqlDbType.VarChar, IPTEndDate.HasValue == true ? IPTEndDate.Value.ToString("yyyy-MM-dd hh:mm:ss").ToString() : DBNull.Value.ToString());
                ClsUtility.AddParameters("@IPTStartDate", SqlDbType.VarChar, IPTStartDate.HasValue == true ? IPTStartDate.Value.ToString("yyyy-MM-dd hh:mm:ss").ToString() : DBNull.Value.ToString());
                ClsUtility.AddParameters("@EligibleForIPT", SqlDbType.Int, "1".ToString());
                ClsUtility.AddParameters("@OtherReasonDeclinedIPT", SqlDbType.VarChar, otherReasonDeclinedIPT.ToString());
                ClsUtility.AddParameters("@OtherReasonDiscontinuedIPT", SqlDbType.VarChar, otherReasonDiscontinuedIPT.ToString());
                ClsObject UserManager = new ClsObject();
                ReturnDT = (DataTable)clsObj.ReturnObject(ClsUtility.theParams, "pr_IPT_SavePatientIPTDetails", ClsDBUtility.ObjectEnum.DataTable);

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(ReturnDT);
            }
            catch (Exception ex)
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw ex;
            }
            finally
            {
                clsObj = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #20
0
        public int Save_Update_PaedsChecklist(int patientID, int VisitID, int LocationID, Hashtable ht, int userID)
        {
            DataSet   theDS;
            int       retval  = 0;
            ClsObject KNHPaed = new ClsObject();

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                KNHPaed.Connection  = this.Connection;
                KNHPaed.Transaction = this.Transaction;

                oUtility.Init_Hashtable();
                oUtility.AddParameters("@patientid", SqlDbType.Int, patientID.ToString());
                oUtility.AddParameters("@locationid", SqlDbType.Int, LocationID.ToString());
                oUtility.AddParameters("@Visit_ID", SqlDbType.Int, VisitID.ToString());
                oUtility.AddParameters("@UserId", SqlDbType.Int, userID.ToString());

                /*** ART Parameters ***/
                oUtility.AddParameters("@visitDate", SqlDbType.VarChar, ht["visitDate"].ToString());
                oUtility.AddParameters("@patientOnART", SqlDbType.Int, ht["patientOnART"].ToString());
                oUtility.AddParameters("@ArtStartDate", SqlDbType.VarChar, ht["ArtStartDate"].ToString());
                oUtility.AddParameters("@CurrentRegimen", SqlDbType.VarChar, ht["CurrentRegimen"].ToString());
                oUtility.AddParameters("@DoseAppropriate", SqlDbType.Int, ht["DoseAppropriate"].ToString());
                oUtility.AddParameters("@SixMonths", SqlDbType.Int, ht["SixMonths"].ToString());
                oUtility.AddParameters("@zScore", SqlDbType.Int, ht["zScore"].ToString());
                oUtility.AddParameters("@routineAdherence", SqlDbType.Int, ht["routineAdherence"].ToString());
                oUtility.AddParameters("@vlTest", SqlDbType.Int, ht["vltest"].ToString());
                oUtility.AddParameters("@LastVLResult", SqlDbType.VarChar, ht["LastVLResult"].ToString());
                oUtility.AddParameters("@firstEACC", SqlDbType.Int, ht["firstEACC"].ToString());
                oUtility.AddParameters("@secondEACC", SqlDbType.Int, ht["secondEACC"].ToString());
                oUtility.AddParameters("@thirdEACC", SqlDbType.Int, ht["thirdEACC"].ToString());
                oUtility.AddParameters("@facilityMDT", SqlDbType.Int, ht["facilityMDT"].ToString());
                oUtility.AddParameters("@repeatViral", SqlDbType.Int, ht["repeatViral"].ToString());
                oUtility.AddParameters("@switchedToSecond", SqlDbType.Int, ht["switchedToSecond"].ToString());
                oUtility.AddParameters("@counselling", SqlDbType.VarChar, ht["counselling"].ToString());
                oUtility.AddParameters("@fullDisclosure", SqlDbType.Int, ht["fullDisclosure"].ToString());
                oUtility.AddParameters("@IPT", SqlDbType.VarChar, ht["IPT"].ToString());
                oUtility.AddParameters("@adolescentsFile", SqlDbType.Int, ht["adolescentsFile"].ToString());
                oUtility.AddParameters("@adolescentsTransitionStart", SqlDbType.Int, ht["adolescentsTransitionStart"].ToString());
                oUtility.AddParameters("@adolescentsTransitionComplete", SqlDbType.Int, ht["AdolescentsTransitionComplete"].ToString());
                oUtility.AddParameters("@actionTaken", SqlDbType.VarChar, ht["actionTaken"].ToString());

                theDS = (DataSet)KNHPaed.ReturnObject(oUtility.theParams, "pr_KNHPaedchecklist_SaveData", ClsUtility.ObjectEnum.DataSet);
                int VisitId = Convert.ToInt32(theDS.Tables[0].Rows[0]["Visit_Id"]);
                retval = VisitId;
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            return(retval);
        }
예제 #21
0
        public int SaveUpdateCustomFieldValues(string[] sqlstr)
        {
            int RowsAffected = 0;

            try
            {
                int i;

                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject CustomFields = new ClsObject();
                CustomFields.Connection  = this.Connection;
                CustomFields.Transaction = this.Transaction;

                for (i = 0; i < sqlstr.Length; i++)
                {
                    oUtility.Init_Hashtable();
                    oUtility.AddParameters("@QryString", SqlDbType.VarChar, sqlstr[i]);

                    RowsAffected += (Int32)CustomFields.ReturnObject(oUtility.theParams, "pr_General_Dynamic_Insert", ClsUtility.ObjectEnum.ExecuteNonQuery);
                }

                /*
                 * if (RowsAffected == 0)
                 * {
                 *  MsgBuilder theBL = new MsgBuilder();
                 *  theBL.DataElements["MessageText"] = "Error in Saving Custom Fields record. Try Again..";
                 *  AppException.Create("#C1", theBL);
                 * }
                 * else
                 * {
                 *  MsgBuilder theBL = new MsgBuilder();
                 *  theBL.DataElements["MessageText"] = "Saved Custom Fields record...";
                 *  AppException.Create("#C1", theBL);
                 * }
                 */

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(RowsAffected);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                RowsAffected = 0;
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #22
0
        public int SaveFamilyInfo(int Id, int Ptn_Pk, string RFirstName, string RLastName, int Sex, int AgeYear, int AgeMonth, int RelationshipType, int HivStatus, int HivCareStatus, int UserId, int DeleteFlag, int ReferenceId, string RegistrationNo, DateTime RelationshipDate)
        {
            ClsObject FamilyInfo = new ClsObject();
            int       retval     = 0;

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                FamilyInfo.Connection  = this.Connection;
                FamilyInfo.Transaction = this.Transaction;

                oUtility.Init_Hashtable();
                oUtility.AddParameters("@Id", SqlDbType.Int, Id.ToString());
                oUtility.AddParameters("@Ptn_pk", SqlDbType.Int, Ptn_Pk.ToString());
                oUtility.AddParameters("@RFirstName", SqlDbType.VarChar, RFirstName.ToString());
                oUtility.AddParameters("@RLastName", SqlDbType.VarChar, RLastName.ToString());
                oUtility.AddParameters("@Sex", SqlDbType.Int, Sex.ToString());
                oUtility.AddParameters("@AgeYear", SqlDbType.Int, AgeYear.ToString());
                if (AgeMonth != 0)
                {
                    oUtility.AddParameters("@AgeMonth", SqlDbType.Int, AgeMonth.ToString());
                }
                oUtility.AddParameters("@RelationshipType", SqlDbType.Int, RelationshipType.ToString());
                oUtility.AddParameters("@HivStatus", SqlDbType.Int, HivStatus.ToString());
                oUtility.AddParameters("@HivCareStatus", SqlDbType.Int, HivCareStatus.ToString());
                oUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());
                oUtility.AddParameters("@DeleteFlag", SqlDbType.Int, DeleteFlag.ToString());
                oUtility.AddParameters("@ReferenceId", SqlDbType.Int, ReferenceId.ToString());
                oUtility.AddParameters("@RegistrationNo", SqlDbType.VarChar, RegistrationNo.ToString());
                oUtility.AddParameters("@DBKey", SqlDbType.VarChar, ApplicationAccess.DBSecurity);
                if (RelationshipDate.DayOfYear != 1)
                {
                    oUtility.AddParameters("@RelationshipDate", SqlDbType.DateTime, RelationshipDate.ToString());
                }
                retval = (int)FamilyInfo.ReturnObject(oUtility.theParams, "Pr_Clinical_SaveFamilyInfo_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                FamilyInfo = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
            return(retval);
        }
예제 #23
0
        public int SaveNewLabselectList(int testid, DataTable theDTselectList, int UserID)
        {
            try
            {
                int theRowAffected = 0;
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject LabManager = new ClsObject();
                LabManager.Connection  = this.Connection;
                LabManager.Transaction = this.Transaction;

                oUtility.Init_Hashtable();
                oUtility.AddParameters("@testID", SqlDbType.Int, testid.ToString());

                theRowAffected = (Int32)LabManager.ReturnObject(oUtility.theParams, "pr_Admin_deleteLabTestselectList_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);
                if (theRowAffected == 0)
                {
                    MsgBuilder theBL = new MsgBuilder();
                    theBL.DataElements["MessageText"] = "Error in delete Lab Result record. Try Again..";
                    AppException.Create("#C1", theBL);
                }


                for (int i = 0; i < theDTselectList.Rows.Count; i++)
                {
                    oUtility.Init_Hashtable();
                    oUtility.AddParameters("@LabName", SqlDbType.VarChar, theDTselectList.Rows[i]["selectlist"].ToString());
                    oUtility.AddParameters("@UserId", SqlDbType.Int, UserID.ToString());
                    oUtility.AddParameters("@testID", SqlDbType.Int, testid.ToString());

                    theRowAffected = (Int32)LabManager.ReturnObject(oUtility.theParams, "pr_Admin_AddLabTestselectList_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);
                    if (theRowAffected == 0)
                    {
                        MsgBuilder theBL = new MsgBuilder();
                        theBL.DataElements["MessageText"] = "Error in Saving Lab record. Try Again..";
                        AppException.Create("#C1", theBL);
                    }
                }
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(theRowAffected);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #24
0
        public DataSet SaveCodeDecode(string Name, string DName, int SRNO, int UserID)
        {
            DataSet dsCustomList;

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject CustomFields = new ClsObject();
                CustomFields.Connection  = this.Connection;
                CustomFields.Transaction = this.Transaction;


                oUtility.Init_Hashtable();
                oUtility.AddParameters("@Name", SqlDbType.VarChar, Name);
                oUtility.AddParameters("@DecodeName", SqlDbType.VarChar, DName);
                oUtility.AddParameters("@SRNO", SqlDbType.Int, SRNO.ToString());
                oUtility.AddParameters("@UserID", SqlDbType.Int, UserID.ToString());


                dsCustomList = (DataSet)CustomFields.ReturnObject(oUtility.theParams, "pr_Admin_AddCodeDecode_Constella", ClsUtility.ObjectEnum.DataSet);

                /*
                 * if ( dsCustomList==null && dsCustomList.Tables[0].Rows.Count  == 0 )
                 * {
                 *  MsgBuilder theBL = new MsgBuilder();
                 *  theBL.DataElements["MessageText"] = "Error in Saving Custom List record. Try Again..";
                 *  AppException.Create("#C1", theBL);
                 * }
                 * else
                 * {
                 *  MsgBuilder theBL = new MsgBuilder();
                 *  theBL.DataElements["MessageText"] = "Saved Custom List record...";
                 *  AppException.Create("#C1", theBL);
                 * }
                 */

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(dsCustomList);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw new ApplicationException("There is an unspecified eror");
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #25
0
        public void ImportIQCareData(Int32 LocationId, string theFileName)
        {
            try
            {
                ///Databases cannot be created in Transaction Mode. ///
                oUtility.Init_Hashtable();
                ClsObject theImportManager = new ClsObject();
                theImportManager.ReturnObject(oUtility.theParams, "Pr_Admin_CreateExportDB_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);

                ///Restore DB-Cannot be in Transaction Mode///
                oUtility.Init_Hashtable();
                oUtility.AddParameters("@FileName", SqlDbType.VarChar, theFileName);
                theImportManager.ReturnObject(oUtility.theParams, "Pr_Admin_RestoreImportIQCareData_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);

                this.Connection              = DataMgr.GetConnection();
                this.Transaction             = DataMgr.BeginTransaction(this.Connection);
                theImportManager.Connection  = this.Connection;
                theImportManager.Transaction = this.Transaction;

                ///Import IQCare Data///
                oUtility.Init_Hashtable();
                oUtility.AddParameters("@Password", SqlDbType.VarChar, ApplicationAccess.DBSecurity.ToString());
                theImportManager.ReturnObject(oUtility.theParams, "Pr_Admin_ImportIQCareData_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);

                theImportManager.ReturnObject(oUtility.theParams, "Pr_Admin_ImportIQCareCustomFormData_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);

                theImportManager.ReturnObject(oUtility.theParams, "Pr_Admin_ImportIQCareTransactionData_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);

                oUtility.Init_Hashtable();
                theImportManager.ReturnObject(oUtility.theParams, "Pr_Admin_ImportIQCareSupportData_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);

                DataMgr.CommitTransaction(this.Transaction);

                ///Drop DB-Cannot be in Transaction Mode///
                oUtility.Init_Hashtable();
                theImportManager.ReturnObject(oUtility.theParams, "Pr_Admin_DropIQExportDB_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);
                DataMgr.ReleaseConnection(this.Connection);
            }
            catch
            {
                if (this.Transaction != null)
                {
                    DataMgr.RollBackTransation(this.Transaction);
                }
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #26
0
        public int SaveDisposeItems(int StoreId, int LocationId, DateTime AsofDate, int UserId, DataTable theDT)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject ObjStoreDispose = new ClsObject();
                int       theRowAffected  = 0;
                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@LocationId", SqlDbType.Int, LocationId.ToString());
                ClsUtility.AddParameters("@StoreId", SqlDbType.Int, StoreId.ToString());
                ClsUtility.AddParameters("@DisposeDate", SqlDbType.VarChar, AsofDate.ToString());
                ClsUtility.AddParameters("@DisposePreparedBy", SqlDbType.Int, UserId.ToString());
                ClsUtility.AddParameters("@DisposeAuthorisedBy", SqlDbType.Int, UserId.ToString());
                DataRow theDR = (DataRow)ObjStoreDispose.ReturnObject(ClsUtility.theParams, "pr_SCM_SaveDisposeItems_Futures", ClsUtility.ObjectEnum.DataRow);
                for (int i = 0; i < theDT.Rows.Count; i++)
                {
                    ClsUtility.Init_Hashtable();
                    if (Convert.ToInt32(!DBNull.Value.Equals(theDT.Rows[i]["Dispose"])) == 1)
                    {
                        ClsUtility.AddParameters("@DisposeId", SqlDbType.Int, theDR["DisposeId"].ToString());
                        ClsUtility.AddParameters("@ItemId", SqlDbType.Int, theDT.Rows[i]["ItemId"].ToString());
                        ClsUtility.AddParameters("@BatchId", SqlDbType.Int, theDT.Rows[i]["BatchId"].ToString());
                        ClsUtility.AddParameters("@ExpiryDate", SqlDbType.DateTime,
                                                 theDT.Rows[i]["ExpiryDate"].ToString());
                        ClsUtility.AddParameters("@StoreId", SqlDbType.Int, theDT.Rows[i]["StoreId"].ToString());
                        ClsUtility.AddParameters("@Quantity", SqlDbType.Int, "-" + theDT.Rows[i]["Quantity"].ToString());
                        ClsUtility.AddParameters("@UserId ", SqlDbType.Int, UserId.ToString());
                        theRowAffected =
                            (int)
                            ObjStoreDispose.ReturnObject(ClsUtility.theParams, "pr_SCM_SaveDisposeItems_Futures",
                                                         ClsUtility.ObjectEnum.ExecuteNonQuery);
                    }
                }
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(theRowAffected);
            }


            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #27
0
        /// <summary>
        /// Updaing the Existing Custom Fields Records into CustomFields Table
        /// </summary>
        /// <param name="Label"></param>
        /// <param name="FeatureID"></param>
        /// <param name="SectionID"></param>
        /// <param name="ControlID"></param>
        /// <param name="UserID"></param>
        /// <param name="CustomFieldID"></param>
        /// <returns></returns>
        public int UpdateCustomFields(string Lblfield, string lbldesc, int FeatureID, int SectionID, int ControlID, int UserID, int CustomFieldID, int UnitFlag, int MinValue, int MaxValue, string UnitsNum)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject CustomFields = new ClsObject();
                CustomFields.Connection  = this.Connection;
                CustomFields.Transaction = this.Transaction;


                oUtility.Init_Hashtable();
                oUtility.AddParameters("@Label", SqlDbType.VarChar, Lblfield);
                oUtility.AddParameters("@flddesc", SqlDbType.VarChar, lbldesc);
                oUtility.AddParameters("@FeatureID", SqlDbType.Int, FeatureID.ToString());
                oUtility.AddParameters("@SectionID", SqlDbType.Int, SectionID.ToString());
                oUtility.AddParameters("@ControlID", SqlDbType.Int, ControlID.ToString());
                oUtility.AddParameters("@UserID", SqlDbType.Int, UserID.ToString());
                oUtility.AddParameters("@CustomFieldID", SqlDbType.Int, CustomFieldID.ToString());
                oUtility.AddParameters("@UnitFlag", SqlDbType.Int, UnitFlag.ToString());
                oUtility.AddParameters("@Min", SqlDbType.Int, MinValue.ToString());
                oUtility.AddParameters("@Max", SqlDbType.Int, MaxValue.ToString());
                oUtility.AddParameters("@Units", SqlDbType.VarChar, UnitsNum);


                int RowsAffected = (Int32)CustomFields.ReturnObject(oUtility.theParams, "Pr_Admin_UpdateCustomField_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);

                /*
                 * if (RowsAffected == 0)
                 * {
                 *  MsgBuilder theBL = new MsgBuilder();
                 *  theBL.DataElements["MessageText"] = "Error in Saving Custom Fields record. Try Again..";
                 *  AppException.Create("#C1", theBL);
                 * }
                 */

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(Convert.ToInt32(RowsAffected));
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw new ApplicationException("There is an unspecified eror");
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #28
0
        public DataSet SaveUpdateHomeVisitData(Hashtable hashTable, int signature, int UserId)
        {
            try
            {
                DataSet theDS;
                int     visitID;
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);
                oUtility.Init_Hashtable();
                //Parameters
                oUtility.AddParameters("@Ptn_pk", SqlDbType.Int, hashTable["patientID"].ToString());
                oUtility.AddParameters("@Visit_Pk", SqlDbType.Int, hashTable["visitID"].ToString());
                oUtility.AddParameters("@LocationId", SqlDbType.Int, hashTable["locationID"].ToString());
                oUtility.AddParameters("@visitdate", SqlDbType.VarChar, String.Format("{0:dd-MMM-yyyy}", hashTable["visitDate"].ToString()));
                oUtility.AddParameters("@PatientIndependent", SqlDbType.Int, hashTable["PatientIndependent"].ToString());
                oUtility.AddParameters("@BasicNeeds", SqlDbType.Int, hashTable["BasicNeeds"].ToString());
                oUtility.AddParameters("@StatusDisclosed", SqlDbType.Int, hashTable["StatusDisclosed"].ToString());
                oUtility.AddParameters("@ARVStorage", SqlDbType.Int, hashTable["ARVStorage"].ToString());
                oUtility.AddParameters("@ReceiveSocialSupport", SqlDbType.Int, hashTable["RecieveSocialSupport"].ToString());
                oUtility.AddParameters("@NonClinicalServices", SqlDbType.Int, hashTable["NonClinicalServices"].ToString());
                oUtility.AddParameters("@MentalHealthIssues", SqlDbType.Int, hashTable["MentalHealthIssues"].ToString());
                oUtility.AddParameters("@PatientSuffering", SqlDbType.Int, hashTable["PatientSuffering"].ToString());
                oUtility.AddParameters("@SideEffects", SqlDbType.Int, hashTable["SideEffects"].ToString());
                oUtility.AddParameters("@FamilyTested", SqlDbType.Int, hashTable["FamilyTested"].ToString());
                oUtility.AddParameters("@comments", SqlDbType.Int, hashTable["comments"].ToString());
                oUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());
                oUtility.AddParameters("@DataQlty", SqlDbType.Int, "0");
                oUtility.AddParameters("@signature", SqlDbType.Int, "0");
                oUtility.AddParameters("@StartTime", SqlDbType.VarChar, null);

                ClsObject VisitManager = new ClsObject();
                VisitManager.Connection  = this.Connection;
                VisitManager.Transaction = this.Transaction;
                theDS   = (DataSet)VisitManager.ReturnObject(oUtility.theParams, "pr_Clinical_SaveUpdateHomeVisitData", ClsUtility.ObjectEnum.DataSet);
                visitID = (int)theDS.Tables[0].Rows[0]["Visit_Id"];

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(theDS);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #29
0
        public DataSet SaveUpdateInitialVisitData(Hashtable hashTable, int DataQuality, int signature)
        {
            try
            {
                DataSet theDS;
                int     visitID;
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);
                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, hashTable["patientID"].ToString());
                ClsUtility.AddParameters("@Visit_Pk", SqlDbType.Int, hashTable["visitID"].ToString());
                ClsUtility.AddParameters("@locationID", SqlDbType.Int, hashTable["locationID"].ToString());
                ClsUtility.AddParameters("@CareEntry", SqlDbType.Int, hashTable["CareEntry"].ToString());
                ClsUtility.AddParameters("@OtherCareEntry", SqlDbType.VarChar, hashTable["OtherCareEntry"].ToString());
                ClsUtility.AddParameters("@ConfirmHIVDate", SqlDbType.VarChar, hashTable["ConfirmHIVDate"].ToString());
                ClsUtility.AddParameters("@ModeHIVTest", SqlDbType.Int, hashTable["ModeHIVTest"].ToString());
                ClsUtility.AddParameters("@TestLocation", SqlDbType.VarChar, hashTable["TestLocation"].ToString());
                ClsUtility.AddParameters("@PriorART", SqlDbType.Int, hashTable["PriorART"].ToString());
                ClsUtility.AddParameters("@ElligibleDate", SqlDbType.VarChar, hashTable["ElligibleDate"].ToString());
                ClsUtility.AddParameters("@WhyElligible", SqlDbType.Int, hashTable["WhyElligible"].ToString());
                ClsUtility.AddParameters("@AdhCounslingDate", SqlDbType.VarChar, hashTable["AdhCounslingDate"].ToString());
                ClsUtility.AddParameters("@DateTransferedIn", SqlDbType.VarChar, hashTable["DateTransferedIn"].ToString());
                ClsUtility.AddParameters("@FacilityTransferFrom", SqlDbType.Int, hashTable["FacilityTransferFrom"].ToString());

                ClsUtility.AddParameters("@DataQlty", SqlDbType.Int, DataQuality.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, signature.ToString());
                ClsObject VisitManager = new ClsObject();
                VisitManager.Connection  = this.Connection;
                VisitManager.Transaction = this.Transaction;

                // DataSet tempDataSet;
                theDS   = (DataSet)VisitManager.ReturnObject(ClsUtility.theParams, "pr_Clinical_SaveUpdate_Nigeria_InitialVisit", ClsDBUtility.ObjectEnum.DataSet);
                visitID = (int)theDS.Tables[0].Rows[0]["Visit_Id"];

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);

                return(theDS);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
예제 #30
0
        public void SavePharmacyReturn(Int32 thePatientId, Int32 theLocationId, Int32 theStoreId, DateTime theReturnDate, Int32 theUserId, Int32 thePharmacyId, DataTable theDT)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);
                ClsObject theManager = new ClsObject();

                foreach (DataRow theDR in theDT.Rows)
                {
                    if (Convert.ToInt32(theDR["ReturnQty"]) > 0)
                    {
                        ClsUtility.Init_Hashtable();
                        ClsUtility.AddParameters("@Ptn_Pk", SqlDbType.Int, thePatientId.ToString());
                        ClsUtility.AddParameters("@StoreId", SqlDbType.Int, theStoreId.ToString());
                        ClsUtility.AddParameters("@VisitId", SqlDbType.Int, theDR["visitId"].ToString());
                        ClsUtility.AddParameters("@Ptn_Pharmacy_Pk", SqlDbType.Int, thePharmacyId.ToString());
                        ClsUtility.AddParameters("@Drug_Pk", SqlDbType.Int, theDR["ItemId"].ToString());
                        ClsUtility.AddParameters("@StrengthId", SqlDbType.Int, theDR["StrengthId"].ToString());
                        ClsUtility.AddParameters("@FrequencyId", SqlDbType.Int, theDR["FrequencyId"].ToString());
                        ClsUtility.AddParameters("@ReturnQuantity", SqlDbType.Int, theDR["ReturnQty"].ToString());
                        ClsUtility.AddParameters("@ReturnReason", SqlDbType.Int, theDR["ReturnReason"].ToString());
                        ClsUtility.AddParameters("@Prophylaxis", SqlDbType.Int, theDR["Prophylaxis"].ToString());
                        ClsUtility.AddParameters("@BatchId", SqlDbType.Int, theDR["BatchId"].ToString());
                        ClsUtility.AddParameters("@CostPrice", SqlDbType.Decimal, theDR["CostPrice"].ToString());
                        ClsUtility.AddParameters("@Margin", SqlDbType.Decimal, theDR["Margin"].ToString());
                        ClsUtility.AddParameters("@SellingPrice", SqlDbType.Decimal, theDR["SellingPrice"].ToString());
                        ClsUtility.AddParameters("@BillAmount", SqlDbType.Decimal, theDR["BillAmount"].ToString());
                        ClsUtility.AddParameters("@ExpiryDate", SqlDbType.VarChar, theDR["ExpiryDate"].ToString());
                        ClsUtility.AddParameters("@DispensingUnit", SqlDbType.Int, theDR["DispensingUnitId"].ToString());
                        ClsUtility.AddParameters("@ReturnDate", SqlDbType.VarChar, theReturnDate.ToString("dd-MMM-yyyy"));
                        ClsUtility.AddParameters("@LocationId", SqlDbType.Int, theLocationId.ToString());
                        ClsUtility.AddParameters("@UserId", SqlDbType.Int, theUserId.ToString());
                        Int32 theRowCount = (Int32)theManager.ReturnObject(ClsUtility.theParams, "pr_SCM_SavePharmacyReturnDetail_Futures", ClsDBUtility.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);
                }
            }
        }