Ejemplo n.º 1
0
        protected static FR_L5EX_SE_1508 Execute(DbConnection Connection, DbTransaction Transaction, P_L5EX_SE_1508 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5EX_SE_1508();
            //Put your code here
            Guid examinationID = new Guid();
            if (Parameter.PerformedInternally)
            {
                ORM_HEC_ACT_PerformedAction examination = new ORM_HEC_ACT_PerformedAction();
                examination.IfPerfomed_DateOfAction               = Parameter.ExaminationDate;
                examination.IfPerformed_DateOfAction_Day          = Parameter.ExaminationDate.Day;
                examination.IfPerformed_DateOfAction_Month        = Parameter.ExaminationDate.Month;
                examination.IfPerformed_DateOfAction_Year         = Parameter.ExaminationDate.Year;
                examination.IfPerformed_MedicalPracticeType_RefID = Parameter.MedicalPracticeTypeID;
                examination.IsPerformed_Internally            = true;
                examination.Patient_RefID                     = Parameter.PatientID;
                examination.Tenant_RefID                      = securityTicket.TenantID;
                examination.IsPerformed_MedicalPractice_RefID = ORM_CMN_STR_Office.Query.Search(Connection, Transaction, new ORM_CMN_STR_Office.Query()
                {
                    CMN_STR_OfficeID = Parameter.OfficeID,
                    Tenant_RefID     = securityTicket.TenantID,
                    IsDeleted        = false
                }).Single().IfMedicalPractise_HEC_MedicalPractice_RefID;
                examination.Save(Connection, Transaction);

                ORM_HEC_ACT_PerformedAction_Doctor performedAction_doctor = new ORM_HEC_ACT_PerformedAction_Doctor();
                performedAction_doctor.HEC_Doctor_RefID = Parameter.DoctorID;
                performedAction_doctor.HEC_ACT_PerformedAction_RefID    = examination.HEC_ACT_PerformedActionID;
                performedAction_doctor.HEC_ACT_PerformedAction_DoctorID = Guid.NewGuid();
                performedAction_doctor.Tenant_RefID           = securityTicket.TenantID;
                performedAction_doctor.Creation_Timestamp     = DateTime.Now;
                performedAction_doctor.Modification_Timestamp = DateTime.Now;
                performedAction_doctor.Save(Connection, Transaction);

                examinationID = examination.HEC_ACT_PerformedActionID;
            }
            returnValue.Result = new L5EX_SE_1508();
            returnValue.Result.ExaminationID = examinationID;
            return(returnValue);

            #endregion UserCode
        }
Ejemplo n.º 2
0
 ///<summary>
 /// Ivokes the method with the given Connection, leaving it open if no exceptions occured
 ///<summary>
 public static FR_L5EX_SE_1508 Invoke(DbConnection Connection, P_L5EX_SE_1508 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, null, null, Parameter, securityTicket));
 }
Ejemplo n.º 3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5EX_SE_1508 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5EX_SE_1508 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5EX_SE_1508 functionReturn = new FR_L5EX_SE_1508();

            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_Save_Examination", ex);
            }
            return(functionReturn);
        }