///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5OS_GSFSPD_1315_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5OS_GSFSPD_1315 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5OS_GSFSPD_1315_Array functionReturn = new FR_L5OS_GSFSPD_1315_Array(); 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_SurveyForShippedProduct_by_DocID", ex); } return(functionReturn); }
protected static FR_L5OS_GSFSPD_1315_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5OS_GSFSPD_1315 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5OS_GSFSPD_1315_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_OphthalSurveys.Atomic.Retrieval.SQL.cls_Get_SurveyForShippedProduct_by_DocID.sql"; command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd(); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket); command.CommandTimeout = QueryTimeout; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "HEC_DoctorID", Parameter.HEC_DoctorID); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "TenantID", Parameter.TenantID); List <L5OS_GSFSPD_1315_raw> results = new List <L5OS_GSFSPD_1315_raw>(); var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); try { reader.SetOrdinals(new string[] { "HEC_ShippingPosition_BarcodeLabelID", "LOG_SHP_Shipment_PositionID", "LOG_SHP_Shipment_HeaderID", "ShippingPosition_BarcodeLabel", "CMN_PRO_ProductID", "Product_Number", "Product_Name_DictID", "Creation_Timestamp", "Assignment_Creation_Timestamp", "CMN_PRO_Product_Questionnaire_AssignmentID", "QuestionnaireTemplate_RefID", "CMN_QST_Questionnaire_Template_VersionID", "CMN_QST_Questionnaire_ItemID", "Questionnaire_Template_RefID", "QuestionItem_Label_DictID", "QuestionItem_Description_DictID", "QuestionItem_SequenceNumber", "EnumerationAnswerType_Name_DictID", "CMN_QST_QuestionItem_EnumerationAnswerTypeID", "Enumerationanswers_Creation_Timestamp", "CMN_QST_QuestionItem_EnumerationAnswerID", "EnumerationAnswer_Text_DictID", "EnumerationAnswerType_RefID" }); while (reader.Read()) { L5OS_GSFSPD_1315_raw resultItem = new L5OS_GSFSPD_1315_raw(); //0:Parameter HEC_ShippingPosition_BarcodeLabelID of type Guid resultItem.HEC_ShippingPosition_BarcodeLabelID = reader.GetGuid(0); //1:Parameter LOG_SHP_Shipment_PositionID of type Guid resultItem.LOG_SHP_Shipment_PositionID = reader.GetGuid(1); //2:Parameter LOG_SHP_Shipment_HeaderID of type Guid resultItem.LOG_SHP_Shipment_HeaderID = reader.GetGuid(2); //3:Parameter ShippingPosition_BarcodeLabel of type String resultItem.ShippingPosition_BarcodeLabel = reader.GetString(3); //4:Parameter CMN_PRO_ProductID of type Guid resultItem.CMN_PRO_ProductID = reader.GetGuid(4); //5:Parameter Product_Number of type String resultItem.Product_Number = reader.GetString(5); //6:Parameter Product_Name of type Dict resultItem.Product_Name = reader.GetDictionary(6); resultItem.Product_Name.SourceTable = "cmn_pro_products"; loader.Append(resultItem.Product_Name); //7:Parameter Creation_Timestamp of type DateTime resultItem.Creation_Timestamp = reader.GetDate(7); //8:Parameter Assignment_Creation_Timestamp of type DateTime resultItem.Assignment_Creation_Timestamp = reader.GetDate(8); //9:Parameter CMN_PRO_Product_Questionnaire_AssignmentID of type Guid resultItem.CMN_PRO_Product_Questionnaire_AssignmentID = reader.GetGuid(9); //10:Parameter QuestionnaireTemplate_RefID of type Guid resultItem.QuestionnaireTemplate_RefID = reader.GetGuid(10); //11:Parameter CMN_QST_Questionnaire_Template_VersionID of type Guid resultItem.CMN_QST_Questionnaire_Template_VersionID = reader.GetGuid(11); //12:Parameter CMN_QST_Questionnaire_ItemID of type Guid resultItem.CMN_QST_Questionnaire_ItemID = reader.GetGuid(12); //13:Parameter Questionnaire_Template_RefID of type Guid resultItem.Questionnaire_Template_RefID = reader.GetGuid(13); //14:Parameter QuestionItem_Label of type Dict resultItem.QuestionItem_Label = reader.GetDictionary(14); resultItem.QuestionItem_Label.SourceTable = "cmn_qst_questionnaire_questionitems"; loader.Append(resultItem.QuestionItem_Label); //15:Parameter QuestionItem_Description of type Dict resultItem.QuestionItem_Description = reader.GetDictionary(15); resultItem.QuestionItem_Description.SourceTable = "cmn_qst_questionnaire_questionitems"; loader.Append(resultItem.QuestionItem_Description); //16:Parameter QuestionItem_SequenceNumber of type String resultItem.QuestionItem_SequenceNumber = reader.GetString(16); //17:Parameter EnumerationAnswerType_Name of type Dict resultItem.EnumerationAnswerType_Name = reader.GetDictionary(17); resultItem.EnumerationAnswerType_Name.SourceTable = "cmn_qst_questionitem_enumerationanswertypes"; loader.Append(resultItem.EnumerationAnswerType_Name); //18:Parameter CMN_QST_QuestionItem_EnumerationAnswerTypeID of type Guid resultItem.CMN_QST_QuestionItem_EnumerationAnswerTypeID = reader.GetGuid(18); //19:Parameter Enumerationanswers_Creation_Timestamp of type DateTime resultItem.Enumerationanswers_Creation_Timestamp = reader.GetDate(19); //20:Parameter CMN_QST_QuestionItem_EnumerationAnswerID of type Guid resultItem.CMN_QST_QuestionItem_EnumerationAnswerID = reader.GetGuid(20); //21:Parameter EnumerationAnswer_Text of type Dict resultItem.EnumerationAnswer_Text = reader.GetDictionary(21); resultItem.EnumerationAnswer_Text.SourceTable = "cmn_qst_questionitem_enumerationanswers"; loader.Append(resultItem.EnumerationAnswer_Text); //22:Parameter EnumerationAnswerType_RefID of type Guid resultItem.EnumerationAnswerType_RefID = reader.GetGuid(22); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_SurveyForShippedProduct_by_DocID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5OS_GSFSPD_1315_raw.Convert(results).ToArray(); return(returnStatus); }