Пример #1
0
        public CompanyDataObject GetData(string companyTypeCode, Func <SqlDataReader, CompanyDataObject> companyDataMapper)
        {
            SqlQueryParameter sqlQueryParameter = new SqlQueryParameter {
                ParameterName = "CompanyTypeCode", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.String, ParameterSize = 100, ParameterValue = companyTypeCode
            };

            return(companyDataMapper(CommandTypeManager.ExecuteReader("CompanyDataFetch", sqlQueryParameter)));
        }
Пример #2
0
        public DashboardDataDto GetData(int?userId, Func <SqlDataReader, DashboardDataDto> dashboardDtoMapper)
        {
            List <SqlQueryParameter> sqlQueryParameters = new List <SqlQueryParameter>();

            sqlQueryParameters.Add(new SqlQueryParameter {
                ParameterName = "UserId", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.Integer, ParameterValue = userId
            });

            return(dashboardDtoMapper(CommandTypeManager.ExecuteReader("DashboardDataFetch", sqlQueryParameters.ToArray())));
        }
Пример #3
0
        public Result <CompanySummaryDto> Get(CompanySearchFilter companySearchFilter, Func <SqlDataReader, Result <CompanySummaryDto> > companyMapper)
        {
            List <SqlQueryParameter> sqlQueryParameters = GetPagedDataParameters(companySearchFilter.PageData);

            sqlQueryParameters.Add(new SqlQueryParameter {
                ParameterName = "UserId", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.Integer, ParameterValue = companySearchFilter.UserId
            });
            sqlQueryParameters.Add(new SqlQueryParameter {
                ParameterName = "OrganisationId", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.Integer, ParameterValue = companySearchFilter.OrganisationId
            });
            sqlQueryParameters.Add(new SqlQueryParameter {
                ParameterName = "SearchText", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.String, ParameterSize = 100, ParameterValue = companySearchFilter.SearchText
            });

            return(companyMapper(CommandTypeManager.ExecuteReader("CompaniesFetch", sqlQueryParameters.ToArray())));
        }
Пример #4
0
        public Result <CompanySummaryDto> GetApp(CompanyAppSearchFilter companyAppSearchFilter, Func <SqlDataReader, Result <CompanySummaryDto> > companyMapper)
        {
            List <SqlQueryParameter> sqlQueryParameters = GetPagedDataParameters(companyAppSearchFilter.PageData);

            sqlQueryParameters.Add(new SqlQueryParameter {
                ParameterName = "Latitude", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.Decimal, ParameterValue = companyAppSearchFilter.Latitude
            });
            sqlQueryParameters.Add(new SqlQueryParameter {
                ParameterName = "Longitude", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.Decimal, ParameterValue = companyAppSearchFilter.Longitude
            });
            sqlQueryParameters.Add(new SqlQueryParameter {
                ParameterName = "SubCategoryId", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.Integer, ParameterValue = companyAppSearchFilter.SubCategoryId
            });
            sqlQueryParameters.Add(new SqlQueryParameter {
                ParameterName = "DeviceId", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.String, ParameterSize = 100, ParameterValue = companyAppSearchFilter.DeviceId
            });
            sqlQueryParameters.Add(new SqlQueryParameter {
                ParameterName = "SearchText", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.String, ParameterSize = 100, ParameterValue = companyAppSearchFilter.SearchText
            });

            return(companyMapper(CommandTypeManager.ExecuteReader("CompaniesAppFetch", sqlQueryParameters.ToArray())));
        }