Exemple #1
0
        /// <summary>Special Service Request List</summary>
        /// <cardinality>Many</cardinality>
        public List <SpecialServiceRequestListData> SpecialServiceRequestList(
            )
        {
            var ret = new List <SpecialServiceRequestListData>();

            string sql = @" 
                select 
	                 sssr.service_special_service_request_group_rcd
	                ,sssr.service_special_service_request_code
	                ,sssr.service_special_service_request_name
	                ,sssr.amount								
	                ,fc.financial_currency_type_name			
	                ,sssr.service_description
	                ,req.service_special_service_request_requirement_name
	                ,ope.service_special_service_request_operation_rule_name
                    ,sssr.service_special_service_request_id
                from service_special_service_request							as sssr	
                inner join service_special_service_request_requirement_ref		as req	on	req.service_special_service_request_requirement_rcd = sssr.request_service_special_service_request_requirement_rcd
                inner join service_special_service_request_operation_rule_ref	as ope	on	ope.service_special_service_request_operation_rule_rcd = sssr.service_special_service_request_operation_rule_rcd
                 left join financial_currency									as fc	on	fc.financial_currency_id = sssr.financial_currency_id
                order by sssr.service_special_service_request_code
                ";

            using (var conn = new SqlConnection(Conn.ConnectionString)) {
                conn.Open();
                conn.BeginTransaction(IsolationLevel.ReadUncommitted).Commit();

                using (var command = new SqlCommand(sql, conn)) {
                    Logging     log    = Logging.PerformanceTimeStart("SolutionNorSolutionPort.DataAccessLayer.FinancialSearch.SpecialServiceRequestList");
                    IDataReader reader = command.ExecuteReader(CommandBehavior.SingleResult);
                    log.PerformanceTimeStop(sql, command);

                    var ordinals = new SpecialServiceRequestListDataOrdinals(reader);

                    while (reader.Read())
                    {
                        var data = new SpecialServiceRequestListData();
                        data.Populate(reader, ordinals);
                        ret.Add(data);
                    }

                    reader.Close();
                }

                return(ret);
            }
        }
 // use ordinals to speed up access to DataReader
 // links:
 //  crud definition: https://en.wikipedia.org/wiki/Create,_read,_update_and_delete
 //  docLink: http://sql2x.org/documentationLink/327451c3-64a8-4de8-b359-76742d634497
 // parameters:
 //  reader: IDataReader from SQLClient
 public void Populate(IDataReader reader, SpecialServiceRequestListDataOrdinals ordinals)
 {
     if (!reader.IsDBNull(ordinals.ServiceSpecialServiceRequestGroupRcd))
     {
         ServiceSpecialServiceRequestGroupRcd = reader.GetString(ordinals.ServiceSpecialServiceRequestGroupRcd);
     }
     if (!reader.IsDBNull(ordinals.ServiceSpecialServiceRequestCode))
     {
         ServiceSpecialServiceRequestCode = reader.GetString(ordinals.ServiceSpecialServiceRequestCode);
     }
     if (!reader.IsDBNull(ordinals.ServiceSpecialServiceRequestName))
     {
         ServiceSpecialServiceRequestName = reader.GetString(ordinals.ServiceSpecialServiceRequestName);
     }
     if (!reader.IsDBNull(ordinals.Amount))
     {
         Amount = reader.GetDecimal(ordinals.Amount);
     }
     if (!reader.IsDBNull(ordinals.FinancialCurrencyTypeName))
     {
         FinancialCurrencyTypeName = reader.GetString(ordinals.FinancialCurrencyTypeName);
     }
     if (!reader.IsDBNull(ordinals.ServiceDescription))
     {
         ServiceDescription = reader.GetString(ordinals.ServiceDescription);
     }
     if (!reader.IsDBNull(ordinals.ServiceSpecialServiceRequestRequirementName))
     {
         ServiceSpecialServiceRequestRequirementName = reader.GetString(ordinals.ServiceSpecialServiceRequestRequirementName);
     }
     if (!reader.IsDBNull(ordinals.ServiceSpecialServiceRequestOperationRuleName))
     {
         ServiceSpecialServiceRequestOperationRuleName = reader.GetString(ordinals.ServiceSpecialServiceRequestOperationRuleName);
     }
     if (!reader.IsDBNull(ordinals.ServiceSpecialServiceRequestId))
     {
         ServiceSpecialServiceRequestId = reader.GetGuid(ordinals.ServiceSpecialServiceRequestId);
     }
 }