예제 #1
0
        public async Task <IList <Certificate360> > GetCertificate360WithIngredient
            (Certificate360IngredientFilter filter)
        {
            var param = new DynamicParameters();

            param.Add("@Name", filter.Name);
            param.Add("@Brand", filter.BrandName);
            param.Add("@SupplierName", filter.SupplierName);
            param.Add("@CertifyingBody", filter.CertifyingBodyName);

            var mapper = new Certificate360Mapper();

            return((await SqlMapper.QueryAsync(
                        _unitOfWork.Connection,
                        "GetCertificate360WithIngredient",
                        new[]
            {
                typeof(Certificate360),
                typeof(Customer),
                typeof(Code),
                typeof(Code),
                typeof(Officer),
                typeof(Premise)
            },
                        obj =>
            {
                var cert = obj[0] as Certificate360;
                var certCustomer = obj[1] as Customer;
                var certCustCode = obj[2] as Code;
                var certCustGroupCode = obj[3] as Code;
                var certCustOfficer = obj[4] as Officer;
                var certPremise = obj[5] as Premise;
                return mapper.Map(cert,
                                  certCustomer,
                                  certCustCode,
                                  certCustGroupCode,
                                  certCustOfficer,
                                  certPremise);
            },
                        param,
                        splitOn: "ID, CustID, CustCodeID, CustCodeGroupID, OfficerID, PremID",
                        commandType: CommandType.StoredProcedure,
                        transaction: _unitOfWork.Transaction)).ToList());
        }
 public GetCertWithIngredientCommand(Certificate360IngredientFilter filter)
 {
     _filter = filter;
 }
예제 #3
0
 public async Task <IList <Model.Certificate360> > GetCertWithIngredient
     (Certificate360IngredientFilter filter)
 {
     return(await Execute(new GetCertWithIngredientCommand(filter)));
 }