Пример #1
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L5TR_GT_1748 Invoke(DbConnection Connection, DbTransaction Transaction, P_L5TR_GT_1748 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Пример #2
0
        protected static FR_L5TR_GT_1748 Execute(DbConnection Connection, DbTransaction Transaction, P_L5TR_GT_1748 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5TR_GT_1748();
            returnValue.Result = new L5TR_GT_1748();
            int IsBilled    = Parameter.SearchParameters.s_isBilled == true ? 1 : 0;
            int IsPerformed = Parameter.SearchParameters.s_isPerformed == true ? 1 : 0;
            int IsSheduled  = Parameter.SearchParameters.s_isScheduled == true ? 1 : 0;

            returnValue.Result.page_size    = Parameter.NumberOfElementsPerPage;
            returnValue.Result.current_page = Parameter.PageClicked;

            P_L5TR_GTDC_1426 count_param = new P_L5TR_GTDC_1426();
            count_param.S_Practice        = SearchMethods.getPracticeParameter(Parameter.SearchParameters.s_practice);
            count_param.statusParameters  = SearchMethods.getStatusParameter(IsBilled, IsPerformed, IsSheduled, Parameter.SearchParameters.s_treatmentFrom, Parameter.SearchParameters.s_treatmentTo);
            count_param.s_Patient         = SearchMethods.getPatientParameter(Parameter.SearchParameters.s_patientFirstName, Parameter.SearchParameters.s_patientLastName);
            count_param.s_HealthInsurance = SearchMethods.getPracticeParameter(Parameter.SearchParameters.s_healtInsurance);

            var recordCount = cls_Get_TreatmentlDataCount.Invoke(Connection, Transaction, count_param, securityTicket).Result.total_record_count;
            returnValue.Result.total_record_count = recordCount;
            returnValue.Result.total_page_count   = (recordCount + Parameter.NumberOfElementsPerPage - 1) / Parameter.NumberOfElementsPerPage;
            var startRowIndex = (Parameter.PageClicked - 1) * Parameter.NumberOfElementsPerPage;
            returnValue.Result.start_row_index = startRowIndex;
            returnValue.Result.end_row_index   = startRowIndex + returnValue.Result.page_size > recordCount ? recordCount : startRowIndex + returnValue.Result.page_size;


            /*@Get Treatments
             *------------------------------------------------*/
            P_L5TR_GTD_1607 par = new P_L5TR_GTD_1607();
            par.StartIndex        = startRowIndex;
            par.NumberOfElements  = Parameter.NumberOfElementsPerPage;
            par.S_Practice        = count_param.S_Practice;
            par.statusParameters  = count_param.statusParameters;
            par.s_Patient         = count_param.s_Patient;
            par.s_HealthInsurance = count_param.s_HealthInsurance;

            returnValue.Result.treatments = cls_Get_TreatmentlData.Invoke(Connection, Transaction, par, securityTicket).Result.ToArray();

            return(returnValue);

            #endregion UserCode
        }
Пример #3
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5TR_GT_1748 Invoke(string ConnectionString, P_L5TR_GT_1748 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }
Пример #4
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5TR_GT_1748 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5TR_GT_1748 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5TR_GT_1748 functionReturn = new FR_L5TR_GT_1748();

            try
            {
                if (cleanupConnection == true)
                {
                    Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                if (cleanupTransaction == true)
                {
                    Transaction = Connection.BeginTransaction();
                }

                functionReturn = Execute(Connection, Transaction, Parameter, securityTicket);

                #region Cleanup Connection/Transaction
                //Commit the transaction
                if (cleanupTransaction == true)
                {
                    Transaction.Commit();
                }
                //Close the connection
                if (cleanupConnection == true)
                {
                    Connection.Close();
                }
                #endregion
            }
            catch (Exception ex)
            {
                try
                {
                    if (cleanupTransaction == true && Transaction != null)
                    {
                        Transaction.Rollback();
                    }
                }
                catch { }

                try
                {
                    if (cleanupConnection == true && Connection != null)
                    {
                        Connection.Close();
                    }
                }
                catch { }

                throw new Exception("Exception occured in method cls_Get_Treatments", ex);
            }
            return(functionReturn);
        }