public Task SaveTraitDeterminationResultAsync(SaveTraitDeterminationResultRequestArgs requestArgs)
 {
     return(DbContext.ExecuteNonQueryAsync(DataConstants.PR_SAVE_TRAIT_DETERMINATION_RESULT,
                                           CommandType.StoredProcedure, args =>
     {
         args.Add("@CropCode", requestArgs.CropCode);
         args.Add("@TVP", requestArgs.ToTvp());
     }));
 }
        public async Task <IHttpActionResult> SaveTraitDeterminationResult([FromBody] SaveTraitDeterminationResultRequestArgs args)
        {
            //args.Crops = string.Join(",", User.GetClaims("enzauth.crops"));
            var cropCodes = await _masterService.GetUserCropCodesAsync(User);

            args.Crops = string.Join(",", cropCodes);
            var items = await service.SaveTraitDeterminationResultAsync(args);

            return(Ok(new
            {
                args.TotalRows,
                Data = items
            }));
        }
Example #3
0
        public async Task <DataTable> SaveTraitDeterminationResultAsync(
            SaveTraitDeterminationResultRequestArgs requestArgs)
        {
            await repository.SaveTraitDeterminationResultAsync(requestArgs);

            var args = new TraitDeterminationResultRequestArgs
            {
                Crops      = requestArgs.Crops,
                Filter     = requestArgs.Filter,
                PageNumber = requestArgs.PageNumber,
                PageSize   = requestArgs.PageSize
            };
            var dt = await GetTraitDeterminationResultAsync(args);

            //return totalrows back to controller
            requestArgs.TotalRows = args.TotalRows;
            return(dt);
        }