Example #1
0
 public async Task <long> InsertCertifyingBody(CertifyingBody data)
 {
     return(await _requestProvider.BuildUpon(_url)
            .Uri($"/api/certifyingbody")
            .Method(HttpMethod.Post)
            .AddInterceptor(new JsonDeserializerInterceptor())
            .Content(new JsonContent(data))
            .Execute <long>());
 }
    public async Task<long> InsertCertifyingBody(CertifyingBody data)
    {

      var certifyingBodyParam = new DynamicParameters();
      certifyingBodyParam.Add("@Name", data.Name);
      certifyingBodyParam.Add("@Status", data.Status);
      certifyingBodyParam.Add("@ID", dbType: DbType.Int64, direction: ParameterDirection.Output);

      await SqlMapper.ExecuteAsync(_unitOfWork.Connection,
        "InsertCertifyingBody",
        certifyingBodyParam,
        commandType: CommandType.StoredProcedure,
        transaction: _unitOfWork.Transaction);

      return certifyingBodyParam.Get<long>("@ID");
    }
Example #3
0
        public halalLibraryList Map(long total,
                                    Ingredient ingredient         = null,
                                    Supplier supplier             = null,
                                    CertifyingBody certifyingBody = null,
                                    Officer officer = null)
        {
            if (_halalLibrary.totalData == 0)
            {
                _halalLibrary.totalData = total;
            }

            Ingredient outIngredient = null;

            if ((ingredient?.ID ?? 0) > 0 &&
                !_ingredientCache.TryGetValue(ingredient.ID, out outIngredient))
            {
                _ingredientCache[ingredient.ID] = ingredient;

                if (_halalLibrary.data == null)
                {
                    _halalLibrary.data = new List <Ingredient>();
                }

                if ((supplier?.ID ?? 0) > 0)
                {
                    ingredient.Supplier = supplier;
                }

                if ((certifyingBody?.ID ?? 0) > 0)
                {
                    ingredient.CertifyingBody = certifyingBody;
                }

                if (!string.IsNullOrEmpty(officer.Name))
                {
                    ingredient.VerifiedBy = officer;
                }

                _halalLibrary.data.Add(ingredient);
            }

            return(_halalLibrary);
        }
Example #4
0
 public Task <long> InsertCertifyingBody(CertifyingBody data)
 {
     return(_apiClient.HalalLibrarySdk.InsertCertifyingBody(data));
 }
Example #5
0
 public async Task <long> Post([FromBody] CertifyingBody data)
 {
     return(await _certifyingbodyservice.InsertCertifyingBody(data));
 }
Example #6
0
 public async Task <long> InsertCertifyingBody(CertifyingBody data)
 {
     return(await Execute(new InsertCertifyingBodyCommand(data)));
 }
Example #7
0
 public async Task <long> PostCertifyingBody([FromBody] CertifyingBody data)
 {
     return(await _halalLibraryService.InsertCertifyingBody(data));
 }