Пример #1
0
        public async Task <ActionResult> SearchAsync(ReturnSearch search)
        {
            var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true);

            try
            {
                var result = await SalesReturnEntries.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(SalesReturn model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.InvalidModelState(this.ModelState));
            }

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

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

            try
            {
                long tranId = await SalesReturnEntries.PostAsync(this.Tenant, model).ConfigureAwait(true);

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