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)); } }
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)); } }