protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L5OS_SSFA_1614 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Guid();
            //find tenant ID
            P_L3MD_GDDC_0928 param = new P_L3MD_GDDC_0928();
            param.DeviceCode = Parameter.AccountCode;
            var docResult = cls_Get_Doctor_by_DeviceCode.Invoke(Connection, Transaction, param);

            //TODO: handle!
            if (docResult == null)
            {
            }
            //retrive surveys
            P_L5OS_SSub_1641 paramForSubmission = new P_L5OS_SSub_1641();
            paramForSubmission.AccountID    = docResult.Result.USR_AccountID;
            paramForSubmission.TenantID     = docResult.Result.Tenant_RefID;
            paramForSubmission.HEC_DoctorID = docResult.Result.HEC_DoctorID;
            paramForSubmission.HEC_ShippingPosition_BarcodeLabelID = Parameter.HEC_ShippingPosition_BarcodeLabelID;
            paramForSubmission.LOG_SHP_Shipment_PositionID         = Parameter.LOG_SHP_Shipment_PositionID;
            paramForSubmission.TemplateVersionID = Parameter.TemplateVersionID;
            paramForSubmission.answerPairs       = Parameter.answerPairs;
            cls_Save_Submission.Invoke(Connection, Transaction, paramForSubmission);

            return(returnValue);

            #endregion UserCode
        }
        protected static FR_L5OS_GSFSPDAUI_1800 Execute(DbConnection Connection, DbTransaction Transaction, P_L5OS_GSFSPDAUI_1800 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5OS_GSFSPDAUI_1800();
            //Put your code here

            L5OS_GSFSPD_1315[] allSurveys = null;
            //find tenant ID
            P_L3MD_GDDC_0928 param = new P_L3MD_GDDC_0928();
            param.DeviceCode = Parameter.AccountCode;
            var docResult = cls_Get_Doctor_by_DeviceCode.Invoke(Connection, Transaction, param);

            //TODO: handle!
            if (docResult != null)
            {
                //P_L3AC_SACUH_1003 historyParam = new P_L3AC_SACUH_1003();
                //historyParam.Device_AccountCodeID = docResult.USR_Device_AccountCodeID;
                //historyParam.TenantID = docResult.Tenant_RefID;
                //historyParam.UsedBy_BrowserAgent = UsedBy_BrowserAgent;
                //historyParam.UsedBy_ExternalAddress = UsedBy_ExternalAddress;
                //cls_Save_USR_AccountCode_UsageHistory.Invoke(connectionString, historyParam);
            }

            //retrive surveys
            P_L5OS_GSFSPD_1315 paramForSurvey = new P_L5OS_GSFSPD_1315();
            paramForSurvey.HEC_DoctorID = docResult.Result.HEC_DoctorID;
            paramForSurvey.TenantID     = docResult.Result.Tenant_RefID;
            allSurveys = cls_Get_SurveyForShippedProduct_by_DocID.Invoke(Connection, Transaction, paramForSurvey).Result;

            List <L5OS_GSFSPD_1315> rv = new List <L5OS_GSFSPD_1315>();

            foreach (var barcodeValue in Parameter.QrCodeValues)
            {
                L5OS_GSFSPD_1315[] applicableQuestions = allSurveys.Where(a => a.ShippingPosition_BarcodeLabel == barcodeValue).ToArray();

                rv.AddRange(applicableQuestions);
            }

            returnValue.Result         = new L5OS_GSFSPDAUI_1800();
            returnValue.Result.Surveys = rv.ToArray();

            return(returnValue);

            #endregion UserCode
        }