private void SetFormValues() { ClearForm(); txtSubTotal.Text = Math.Round(_subTotal, 2).ToString(F2); txtShippingAndHandling.Text = ShippingAndHandling.ToString(F2); txtRetailTotal.Text = Math.Round(_retailTotal, 2).ToString(F2); SetEstimatedTaxLabel(); txtTaxAmount.Text = Math.Round(_taxAmount, 2).ToString(F2); txtBackgroundCheckFee.Text = GetBackgroundCheckFee().ToString(F2); textBoxCouponAmt.Text = _transactionCouponAmount.ToString(F2); if (LayawayPaymentCalc != null) { var bProcedures = new BusinessRulesProcedures(CDS); if (bProcedures.IsServiceFeeTaxable(CDS.CurrentSiteId)) { txtLayawayServiceFee.Text = LayawayPaymentCalc.ServiceFee.ToString(F2); } else { txtLayawayServiceFee.Text = LayawayPaymentCalc.ServiceFeeTotal.ToString(F2); } } customButtonOutTheDoor.Enabled = _subTotal > 0.0m; customButtonCoupon.Location = new Point(customButtonOutTheDoor.Location.X, customButtonOutTheDoor.Location.Y - 118); }
public ShippingAndHandling GetShippingAndHandlingAmount() { // Multiply album price by count of that album to get // the current price for each of those albums in the cart // sum all album price totals to get the cart total ShippingAndHandling ShippingAndHandlingAmount = null; ShippingAndHandlingAmount = (from sh in db.ShippingAndHandlings select sh).FirstOrDefault(); return(ShippingAndHandlingAmount); }
public ActionResult ViewOrderDetailsReport(int id, string name) { //var transID4 = Request.QueryString["id"].ToString(); FECombineOrderDetailsViewModel model = new FECombineOrderDetailsViewModel(); if (Session["username"] != null) { try { var orderDetails = (from o in db.Orders join od in db.OrderDetails on o.OrderID equals od.OrderID join p in db.Products on o.ProductID equals p.ProductID join u in db.Users on o.UserID equals u.UserID join c in db.Countries on u.CountryID equals c.CountryID where (o.OrderTransactionNumber == name) select new FEOrderDetailsViewModel { ProductID = o.ProductID, OrderID = o.OrderID, TransactionID = o.OrderTransactionNumber, ProductName = od.ProductName, ProductSku = o.ProductModelNumber, ProductFrontViewThumb = p.ProductFrontViewThumbnail.Substring(1), ProductQuantity = o.OrderQuantity, ProductUnitPrice = o.OrderUnitPrice, ProductTotalPrice = o.OrderQuantity * o.OrderUnitPrice, }).ToList(); model.List = orderDetails; } catch (Exception ex) { ViewBag.DisplayMessage = "Info"; ModelState.AddModelError("", ex.Message); } try { var orderDetailsItems = (from o in db.Orders join od in db.OrderDetails on o.OrderID equals od.OrderID //join p in db.Products on o.ProductID equals p.ProductID join u in db.Users on o.UserID equals u.UserID join c in db.Countries on u.UserBillingCountry equals c.CountryID.ToString() join cd in db.Countries on u.CountryID equals cd.CountryID where (o.OrderTransactionNumber == name) select new FEOrderDetailsItemsViewModel { OrderID = o.OrderID, TransIDShort = o.OrderTransactionNumber.Substring(0, 8).ToUpper(), TransactionID = o.OrderTransactionNumber, OrderDate = o.OrderDate, OrderDeliveryStatus = o.OrderDeliveryStatus, UserFirstName = u.UserFirstName, UserLastName = u.UserLastName, UserCountry = cd.CountryName, UserState = u.UserState, UserCity = u.UserCity, UserPhoneNumber = u.UserPhone, UserAddress1 = u.UserAddress1, UserBillingAddress = u.UserBillingAddress, UserBillingCity = u.UserBillingCity, UserBillingCountry = c.CountryName, UserBillingState = u.UserBillingState, OrderDeliveryMethod = o.OrderDeliveryOption, OrderPaymentMethod = o.OrderPaymentOption, UserBillingFirstName = u.UserBillingFirstName, UserBillingLastName = u.UserBillingLastName, UserBillingPhone = u.UserBillingPhone }).FirstOrDefault(); model.OrderItems = orderDetailsItems; ViewBag.CartTotal = GetTotalPriceForOrderSummary(name); if (ViewBag.CartTotal > 0) { ViewBag.CartTotals = GetTotalPriceForOrderSummary(name); ShippingAndHandling sh = GetShippingAndHandlingAmount(); ViewBag.ShippingAndHandling = sh.ShippingAndHandlingCharges; //ViewBag.ShippingAndHandling = 1000m; ViewBag.Tax = sh.Vat; ViewBag.Discount = 0.00m; ViewBag.OrderSummaryTotal = ViewBag.CartTotal + ViewBag.ShippingAndHandling + ViewBag.Tax; } else { ViewBag.ShippingAndHandling = 0.00m; ViewBag.Tax = 0.00m; ViewBag.Discount = 0.00m; ViewBag.OrderSummaryTotal = 0.00m; } } catch (Exception ex) { ViewBag.DisplayMessage = "Info"; ModelState.AddModelError("", ex.Message); } //} } else { return(RedirectToAction("Index", "Home")); } return(View(model)); }