public async Task <ActionResult> SearchAsync(AdjustmentSearch search)
        {
            var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true);

            try
            {
                var result = await InventoryAdjustments.GetSearchViewAsync(this.Tenant, meta.OfficeId, search).ConfigureAwait(true);

                return(this.Ok(result));
            }
            catch (Exception ex)
            {
                return(this.Failed(ex.Message, HttpStatusCode.InternalServerError));
            }
        }
示例#2
0
        public async Task <ActionResult> PostAsync(InventoryAdjustment model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.InvalidModelState(this.ModelState));
            }

            var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true);

            model.OfficeId = meta.OfficeId;
            model.UserId   = meta.UserId;
            model.LoginId  = meta.LoginId;

            try
            {
                long id = await InventoryAdjustments.AddAsync(this.Tenant, model).ConfigureAwait(true);

                return(this.Ok(id));
            }
            catch (Exception ex)
            {
                return(this.Failed(ex.Message, HttpStatusCode.InternalServerError));
            }
        }