public ActionResult AddOrderBasket(int productId)
        {
            var product = _productService.GetById(productId);

            OrderDetailBasketModel orderBasket = new OrderDetailBasketModel();

            orderBasket.ProductName = _productService.GetById(productId).ProductName;

            orderBasket.OrderDetail.ProductId = productId;
            orderBasket.Quantity              = 1;
            orderBasket.OrderDetail.UserId    = AccountHelper.GetAccount().Id;
            orderBasket.OrderDetail.Discount  = 0;
            orderBasket.OrderDetail.Unit      = _unitService.GetById(product.UnitId ?? 1).Name;
            orderBasket.OrderDetail.Tax       = Convert.ToDecimal(_taxService.GetById(product.Tax).Name);
            orderBasket.OrderDetail.UnitPrice = product.Price;


            orderBasket.OrderDetail.Total = (decimal)(orderBasket.Quantity * (double)Convert.ToDecimal(orderBasket.OrderDetail.UnitPrice));

            OrderCalcTax(orderBasket);

            OrderDetailCart.ActiveOrder.OrderAdd(orderBasket.OrderDetail, orderBasket.ProductName);

            return(Json("1"));
        }
Exemple #2
0
        public ActionResult Details(int id)
        {
            MainApplication model = new MainApplication();

            model.MainTaxMasters = _taxservice.GetById(id);
            model.DynamicList    = _subtaxservice.getAllTaxesByStates(model.MainTaxMasters.VAT, model.MainTaxMasters.SalesTax, model.MainTaxMasters.OtherTax);
            return(View(model));
        }
        /// <summary>
        ///  Initialize the Edit form.
        /// </summary>
        /// <param name="id">Tax id</param>
        /// <returns></returns>
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var taxModel = _taxService.GetById(id.Value);

            PopulateDropDownLists(taxModel);

            if (taxModel == null)
            {
                return(HttpNotFound());
            }

            return(View(taxModel));
        }
Exemple #4
0
 public async Task <IActionResult> Get([FromRoute] Guid id, CancellationToken cancellationToken)
 {
     return(new OkObjectResult(await _taxService.GetById(id, cancellationToken)));
 }
Exemple #5
0
 public TaxDetails Get(int id)
 {
     return(_TaxService.GetById(id));
 }
        public JsonResult TaxEdit(int id)
        {
            var taxData = _taxService.GetById(id);

            return(Json(taxData, JsonRequestBehavior.AllowGet));
        }