Esempio n. 1
0
        public async Task <ActionResult> SetPriceListAsync(int supplierId, IEnumerable <SupplierwiseCostPrice> model)
        {
            if (supplierId <= 0)
            {
                return(this.Failed(I18N.BadRequest, HttpStatusCode.BadRequest));
            }

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

            try
            {
                await CostPrices.SetPriceList(this.Tenant, meta.UserId, supplierId, model).ConfigureAwait(true);

                return(this.Ok());
            }
            catch (Exception ex)
            {
                return(this.Failed(ex.Message, HttpStatusCode.InternalServerError));
            }
        }
Esempio n. 2
0
        public async Task <ActionResult> GetPriceListAsync(int supplierId)
        {
            if (supplierId <= 0)
            {
                return(this.Failed(I18N.BadRequest, HttpStatusCode.BadRequest));
            }

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

            try
            {
                var result = await CostPrices.GetCostPrice(this.Tenant, meta.OfficeId, supplierId).ConfigureAwait(true);

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