Esempio n. 1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_DO_GPDD_1700 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_DO_GPDD_1700 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_DO_GPDD_1700 functionReturn = new FR_DO_GPDD_1700();

            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_Practice_DetailData", ex);
            }
            return(functionReturn);
        }
Esempio n. 2
0
        protected static FR_DO_GPDD_1700 Execute(DbConnection Connection, DbTransaction Transaction, P_DO_GPDD_1700 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_DO_GPDD_1700();
            returnValue.Result = new DO_GPDD_1700();
            var practice_details = new DO_GPDD_1700();

            var data = cls_Get_Practice_Details_for_PracticeID.Invoke(Connection, Transaction, new P_DO_GPDfPID_1432 {
                PracticeID = Parameter.ID
            }, securityTicket).Result;

            foreach (var practice in data)
            {
                if (practice.is_company)
                {
                    practice_details.address = practice.street;
                    practice_details.bank    = practice.practice_bank_name;
                    practice_details.bic     = practice.practice_bank_BIC;
                    practice_details.bsnr    = practice.practice_BSNR;
                    practice_details.No      = practice.number;

                    practice_details.email          = practice.contact_email;
                    practice_details.fax            = practice.contact_fax;
                    practice_details.iban           = practice.practice_IBAN;
                    practice_details.id             = practice.practiceID.ToString();
                    practice_details.phone          = practice.contact_telephone;
                    practice_details.name           = practice.practice_name;
                    practice_details.town           = practice.city;
                    practice_details.Zip            = practice.zip;
                    practice_details.account_holder = practice.account_holder;
                    practice_details.password       = "******";


                    if (practice.IsValue_Number)
                    {
                        if (practice.PropertyName.Equals("Default Shipping Date Offset"))
                        {
                            practice_details.default_shipping_date_offset = practice.Value_Number;
                        }
                    }

                    if (practice.IsValue_Boolean)
                    {
                        if (practice.PropertyName.Equals("Waive Service Fee"))
                        {
                            practice_details.isWaiveServiceFee = practice.Value_Boolean;
                        }
                        if (practice.PropertyName.Equals("Order Drugs"))
                        {
                            practice_details.IsOrderDrugs = practice.Value_Boolean;
                        }
                        if (practice.PropertyName.Equals("Surgery Practice"))
                        {
                            practice_details.IsSurgeryPractice = practice.Value_Boolean;
                        }
                        if (practice.PropertyName.Equals("Only Label Required"))
                        {
                            practice_details.IsOnlyLabelRequired = practice.Value_Boolean;
                        }
                        if (practice.PropertyName.Equals("Quick order"))
                        {
                            practice_details.IsQuickOrderActive = practice.Value_Boolean;
                        }
                    }
                }
                else
                {
                    practice_details.contact_email       = practice.contact_email;
                    practice_details.contact_person_name = practice.contact_person_name;
                    practice_details.contact_telephone   = practice.contact_telephone;
                }

                var accountID = cls_Get_Practice_AccountID_for_PracticeID.Invoke(Connection, Transaction, new P_DO_GPAIDfPID_1351()
                {
                    PracticeID = Parameter.ID
                }, securityTicket).Result.accountID;
                practice_details.login_email = data.First().sign_in_email;
            }

            var shouldDownloadReportProperty = cls_Get_Practice_PropertyValue_for_PropertyName_and_PracticeID.Invoke(Connection, Transaction, new P_DO_GPPVfPNaPID_0916()
            {
                PracticeID   = Parameter.ID,
                PropertyName = "Download Report Upon Submission"
            }, securityTicket).Result;
            if (shouldDownloadReportProperty != null)
            {
                practice_details.ShouldDownloadReportUponSubmission = shouldDownloadReportProperty.BooleanValue;
            }

            var pressEnterToSearchProperty = cls_Get_Practice_PropertyValue_for_PropertyName_and_PracticeID.Invoke(Connection, Transaction, new P_DO_GPPVfPNaPID_0916()
            {
                PracticeID   = Parameter.ID,
                PropertyName = "Press enter to search"
            }, securityTicket).Result;
            if (pressEnterToSearchProperty != null)
            {
                practice_details.PressEnterToSearch = pressEnterToSearchProperty.BooleanValue;
            }

            var practiceHasOctDeviceProperty = cls_Get_Practice_PropertyValue_for_PropertyName_and_PracticeID.Invoke(Connection, Transaction, new P_DO_GPPVfPNaPID_0916()
            {
                PracticeID   = Parameter.ID,
                PropertyName = "Practice has OCT device"
            }, securityTicket).Result;
            if (practiceHasOctDeviceProperty != null)
            {
                practice_details.PracticeHasOctDevice = practiceHasOctDeviceProperty.BooleanValue;
            }

            var defaultPharmacyProperty = cls_Get_Practice_PropertyValue_for_PropertyName_and_PracticeID.Invoke(Connection, Transaction, new P_DO_GPPVfPNaPID_0916()
            {
                PracticeID   = Parameter.ID,
                PropertyName = "Default pharmacy"
            }, securityTicket).Result;
            if (defaultPharmacyProperty != null)
            {
                practice_details.DefaultPharmacy = String.IsNullOrEmpty(defaultPharmacyProperty.TextValue) ? Guid.Empty.ToString() : defaultPharmacyProperty.TextValue;
            }
            else
            {
                practice_details.DefaultPharmacy = null;
            }

            var quickOrderProperty = cls_Get_Practice_PropertyValue_for_PropertyName_and_PracticeID.Invoke(Connection, Transaction, new P_DO_GPPVfPNaPID_0916()
            {
                PracticeID   = Parameter.ID,
                PropertyName = "Quick order"
            }, securityTicket).Result;
            if (quickOrderProperty != null)
            {
                practice_details.IsQuickOrderActive = quickOrderProperty.BooleanValue;
            }

            var deliveryDateFromProperty = cls_Get_Practice_PropertyValue_for_PropertyName_and_PracticeID.Invoke(Connection, Transaction, new P_DO_GPPVfPNaPID_0916()
            {
                PracticeID   = Parameter.ID,
                PropertyName = "Delivery date from"
            }, securityTicket).Result;
            if (quickOrderProperty != null)
            {
                practice_details.DeliveryDateFrom = deliveryDateFromProperty.TextValue;
            }
            else
            {
                practice_details.DeliveryDateFrom = "08:00";
            }

            var deliveryDateToProperty = cls_Get_Practice_PropertyValue_for_PropertyName_and_PracticeID.Invoke(Connection, Transaction, new P_DO_GPPVfPNaPID_0916()
            {
                PracticeID   = Parameter.ID,
                PropertyName = "Delivery date to"
            }, securityTicket).Result;
            if (quickOrderProperty != null)
            {
                practice_details.DeliveryDateTo = deliveryDateToProperty.TextValue;
            }
            else
            {
                practice_details.DeliveryDateTo = "18:00";
            }

            var gracePeriodProperty = cls_Get_Practice_PropertyValue_for_PropertyName_and_PracticeID.Invoke(Connection, Transaction, new P_DO_GPPVfPNaPID_0916()
            {
                PracticeID   = Parameter.ID,
                PropertyName = "Grace period"
            }, securityTicket).Result;
            if (gracePeriodProperty != null)
            {
                practice_details.UseGracePeriod = gracePeriodProperty.BooleanValue;
            }

            returnValue.Result = practice_details;

            return(returnValue);

            #endregion UserCode
        }