public async Task <ActionResult> SetPriceListAsync(int customerId, IEnumerable <CustomerwiseSellingPrice> model) { if (customerId <= 0) { return(this.Failed(I18N.BadRequest, HttpStatusCode.BadRequest)); } var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true); try { await SellingPrices.SetPriceList(this.Tenant, meta.UserId, customerId, model).ConfigureAwait(true); return(this.Ok()); } catch (Exception ex) { return(this.Failed(ex.Message, HttpStatusCode.InternalServerError)); } }
public async Task <ActionResult> GetPriceListAsync(int customerId) { if (customerId <= 0) { return(this.Failed(I18N.BadRequest, HttpStatusCode.BadRequest)); } var meta = await AppUsers.GetCurrentAsync().ConfigureAwait(true); try { var result = await SellingPrices.GetSellingPrices(this.Tenant, meta.OfficeId, customerId).ConfigureAwait(true); return(this.Ok(result)); } catch (Exception ex) { return(this.Failed(ex.Message, HttpStatusCode.InternalServerError)); } }