async Task ExecuteLoadProductItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { ProductItems.Clear(); //var items = await restService.GetResponse<List<Product>>(Constants.urlApi + "manufacturers/" + manufacturerId + "/products", true); var items = await App.QuoteProductDatabase.GetProductItemsAsync(); ProductItems = new ObservableCollection <ProductItem>(items); } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
public void Init() { ProductItems.Clear(); ProductItems.Add(new ProductItem { Name = "iPhone 7 Plus 太空金", price = 28000, number = 2, UpdateSumCommand = new DelegateCommand(CalculateSum), }); ProductItems.Add(new ProductItem { Name = "60天世界旅遊一周", price = 168168, number = 1, UpdateSumCommand = new DelegateCommand(CalculateSum), }); ProductItems.Add(new ProductItem { Name = "32\"重乳酪起司", price = 742, number = 2, UpdateSumCommand = new DelegateCommand(CalculateSum), }); ProductItems.Add(new ProductItem { Name = "海港自助餐劵", price = 468, number = 8, UpdateSumCommand = new DelegateCommand(CalculateSum), }); }
public ActionResult Cart(string pid, string pqty) { //var pro = db.Products.ToList(); //foreach (var item in pro) //{ // if (int.Parse(pqty) > item.SuppliedProduct.AvailableQuantity) // { // TempData["Error"]= "Out Of Stock"; // } //} foreach (var item in ShoppingCart.Items) { if (item.Id == int.Parse(pid)) { item.Count += int.Parse(pqty); ViewBag.Items = ShoppingCart.Items; TempData["Message"] = "Your Cart has been updated !"; return(Redirect(Request.UrlReferrer.ToString())); } } ProductItems i = new ProductItems() { Id = int.Parse(pid), Count = int.Parse(pqty) }; ShoppingCart.Items.Add(i); ViewBag.Items = ShoppingCart.Items; TempData["Message"] = "Your Product has been added to cart !"; return(Redirect(Request.UrlReferrer.ToString())); }
public async Task <ActionResult <ProductItems> > PostProductItems(ProductItems productItems) { _context.ProductItemes.Add(productItems); await _context.SaveChangesAsync(); return(CreatedAtAction("GetProductItems", new { id = productItems.ProductItemId }, productItems)); }
public HttpResponseMessage AddProduct(ProductViewModel obj) { try { using (NavAssignmentEntities db = new NavAssignmentEntities()) { var checkingData = db.Products.Any(m => m.code == obj.code || m.productName == obj.productName); if (checkingData) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Product already exists. Please try new")); } else { ProductItems model = new ProductItems(); model.AddProduct(obj); } } } catch (Exception) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Somthing went wrong")); } return(Request.CreateResponse(HttpStatusCode.OK, "Added Successfully")); }
async Task ExecuteRefreshCommand() { if (IsBusy) { return; } IsBusy = true; try { var orders = await _service.GetProducts(); ProductItems.Clear(); foreach (var todo in orders) { ProductItems.Add(todo); } } catch (Exception ex) { Acr.UserDialogs.UserDialogs.Instance.ShowError(ex.Message); } finally { IsBusy = false; } }
//ProductItems private void btnProductItems_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { try { restForeColorOfNavBarItem(); NavBarItem navBarItem = (NavBarItem)sender; navBarItem.Appearance.ForeColor = Color.Blue; if (!xtraTabControlStoresContent.Visible) { xtraTabControlStoresContent.Visible = true; } XtraTabPage xtraTabPage = getTabPage(xtraTabControlStoresContent, "عناصر البند"); if (xtraTabPage == null) { xtraTabControlStoresContent.TabPages.Add("عناصر البند"); xtraTabPage = getTabPage(xtraTabControlStoresContent, "عناصر البند"); } xtraTabPage.Controls.Clear(); xtraTabControlStoresContent.SelectedTabPage = xtraTabPage; ProductItems objForm = new ProductItems(); objForm.TopLevel = false; xtraTabPage.Controls.Add(objForm); objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; objForm.Dock = DockStyle.Fill; objForm.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public List <IProductLineSaleItem> GetProductLineSaleItems() { List <IProductLineSaleItem> items = new List <IProductLineSaleItem>(); items = ProductItems.ToList(); return(items); }
//End of Mouse Click Operations private void GetItemDetais(string barCode) { vItem = sVM.GetProductItemDetais(barCode); if (vItem != null) { TXTItemDetail.Text = vItem.ItemDesc; // ["ItemDetail"]; TXTRate.Text = "" + vItem.MRP; // ["MRP"]; TXTQty.Text = "" + vItem.Qty; //["Qty"]; } }
public async Task <IActionResult> PutProductItems([FromBody] ProductItems productItems) { _context.Entry(productItems).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { return(BadRequest()); } return(NoContent()); }
//[ValidateAntiForgeryToken] public ActionResult ListEditors(int productItemId) { if (ModelState.IsValid) { // Custom Validation: the selected combobox value should be in the list if (ProductItems.GetAvailableForUserList().FindIndex(i => i.Id == productItemId) != -1) { // DoSomethig(productItemId); } else { ModelState.AddModelError("", "Invalid input. Looks like a hacker attack."); } } return(View("ListEditors", productItemId)); }
public async Task <ActionResult> Produit(int id) { string requestUrl = Constant.ApiUrl + "Produits/" + id.ToString(); HttpResponseMessage response; using (var httpClient = new HttpClient()) { response = await httpClient.GetAsync(requestUrl); } var content = await response.Content.ReadAsStringAsync(); ProductItems product = await InfoProduct(JsonConvert.DeserializeObject <ProductItems>(content)); ViewBag.Produit = product; return(View()); }
private void Apply(ProductAdded @event) { Version++; var newProductItem = @event.ProductItem; var existingProductItem = FindProductItemMatchingWith(newProductItem); if (existingProductItem is null) { ProductItems.Add(newProductItem); return; } ProductItems.Replace( existingProductItem, existingProductItem.MergeWith(newProductItem) ); }
private void Apply(ProductRemoved @event) { Version++; var productItemToBeRemoved = @event.ProductItem; var existingProductItem = FindProductItemMatchingWith(@event.ProductItem); if (existingProductItem.HasTheSameQuantity(productItemToBeRemoved)) { ProductItems.Remove(existingProductItem); return; } ProductItems.Replace( existingProductItem, existingProductItem.Substract(productItemToBeRemoved) ); }
private void BtnProductItemsRecord_Click(object sender, EventArgs e) { try { tableLayoutPanelContent.Controls.Clear(); resetButtonsStoreDetailsPanelStyle(); Button btn = (Button)sender; btn.ForeColor = Color.Black; btn.BackColor = Color.White; ProductItems objForm = new ProductItems(); objForm.TopLevel = false; tableLayoutPanelContent.Controls.Add(objForm); objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; objForm.Dock = DockStyle.Fill; objForm.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
IEnumerator LoadJsonProducts(string url) { UnityWebRequest www = UnityWebRequest.Get(url); yield return(www.SendWebRequest()); if (www.isNetworkError) { Debug.Log(www.error); } else { string json = www.downloadHandler.text; Debug.Log("JSON: " + json); productItems = JsonUtility.FromJson <ProductItems>(json); Debug.Log(productItems.Products.Length); for (int i = 0; i < productItems.Products.Length; i++) { Debug.Log("JSON-VALUES-PRODUCTS: " + productItems.Products[i].id); } } }
private StoreView _setAndGetProductItems(IDbConnection connection, bool update = false, byte?typeId = null) { if (ProductItems == null || update) { var storeData = _psCache.LocalWhere(connection, i => i.Trash == false).ToList(); var tTypes = _ptCache.LocalFlilteredByKeys(connection, storeData.Select(i => i.ProductTypeId)); ProductItems = storeData.Select(s => new StoreViewItem { Active = !s.Trash, Date = s.Date, ProductTypeId = s.ProductTypeId, ProductStoreId = s.Id, ProductCost = (double)s.Cost, ProductCurrencyCode = s.CurrencyCode, ProductItemProperty = s.Property, TypeText = tTypes.First(i => i.Id == s.ProductTypeId).Property.TranslateText }).ToList(); } if (RepoList == null || update) { RepoList = GetProductTypesBaseAll(connection); } var result = new StoreView { SelectList = RepoList.ToList() }; if (typeId == null || typeId == 0) { result.StoreList = ProductItems.ToList(); return(result); } result.StoreList = ProductItems.Where(i => i.ProductTypeId == typeId).ToList(); return(result); }
public HttpResponseMessage DeleteProduct(int id) { try { using (NavAssignmentEntities db = new NavAssignmentEntities()) { var checkingData = db.Customers.Any(m => m.customerId == id); if (!checkingData) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Product Not Found")); } else { ProductItems model = new ProductItems(); model.DeleteProduct(id); } return(Request.CreateResponse(HttpStatusCode.OK, "Deleted Successfully")); } } catch (Exception) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Somthing went wrong")); } }
public HttpResponseMessage EditProduct(ProductViewModel obj) { try { using (NavAssignmentEntities db = new NavAssignmentEntities()) { var checkingData = db.Products.Any(m => m.productId == obj.productId); if (!checkingData) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Product Not Found")); } else { ProductItems model = new ProductItems(); model.EditProductr(obj); } return(Request.CreateResponse(HttpStatusCode.OK, "updated Successfully")); } } catch (Exception) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Somthing went wrong")); } }
public async Task <IActionResult> Create(ProductItems productItems) { if (!ModelState.IsValid) { return(View(productItems)); } if (productItems.Photo == null) { ModelState.AddModelError("Photo", "Photo shuld be selected."); return(View(productItems)); } if (!productItems.Photo.ContentType.Contains("image/")) { ModelState.AddModelError("Photo", "Photo is not valid."); return(View(productItems)); } productItems.Image = await productItems.Photo.SaveFileAsync(_env.WebRootPath); await _context.ProductItems.AddAsync(productItems); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }
public async Task <ProductItems> InfoProduct(ProductItems product) { List <Famille> listFamille = await Famille(); List <Stock> listStock = await Stock(); for (int j = 0; j < listFamille.Count; j++) { if (product.IdFamille == listFamille[j].Id) { product.Famille = listFamille[j].Libelle; j = listFamille.Count; } } for (int j = 0; j < listStock.Count; j++) { if (product.Id == listStock[j].IdProduit) { product.Quantite = listStock[j].Quantite; j = listFamille.Count; } } return(product); }
public HttpResponseMessage GetProductList() { try { using (NavAssignmentEntities db = new NavAssignmentEntities()) { var checkingData = db.Customers.Any(); if (!checkingData) { return(Request.CreateResponse(HttpStatusCode.OK, "No Products")); } else { ProductItems model = new ProductItems(); List <ProductViewModel> dataList = model.GetProductList(); return(Request.CreateResponse(HttpStatusCode.OK, dataList)); } } } catch (Exception) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Somthing went wrong")); } }
public void PurchaseToStock(Purchase p) { ProductItems pItem = new ProductItems() { Barcode = p.Barcode, Cost = p.Cost, SupplierId = p.SupplierName, BrandName = "", ID = -1, ItemDesc = p.ItemDesc, MRP = p.MRP, Qty = p.Quantity, ProductName = p.ProductName, Size = ToSize(p.StyleCode), StyleCode = p.StyleCode, Tax = p.TaxAmt, //TODO: GST Correct It /*CGST =p.TaxRate, HSNCode=p.HSNCode, * IGST=p.TaxRate,SGST=p.TaxRate,PreGST=p.TaxType*/ }; Logs.LogMe("Insert of Data is " + pIDB.InsertDataWithVerify(pItem)); }
private PricedProductItem FindProductItemMatchingWith(PricedProductItem productItem) { return(ProductItems .SingleOrDefault(pi => pi.MatchesProductAndPrice(productItem))); }
public void AddProductLineSaleItem(IProduct product, int quantity) { IProductLineSaleItem item = new ProductSaleLineItem(product, quantity, 1); ProductItems.Add(item); }
//Retorna o item do produto pelo id informado public async Task <ProductItems> GetByIdAnythingAsync(ProductItems ProductItems) { var result = await SearchByIdAsync("product_items", ProductItems.Id); return(FromDynamicTo <ProductItems>(result?.product_item)); }
public ActionResult ListEditors() { return(View("ListEditors", ProductItems.GetAvailableForUserList()[0].Id)); }
public string GetItemInfo(ProductItems itemname) { var productitem = new Link(By.XPath(string.Format(ProductItem, itemnames[itemname])), itemnames[itemname]).GetElement().Text; return productitem; }
public static List <ProductItems> FillProductItems() { List <ProductItems> listOfProductItems = new List <ProductItems>(); ProductItems ProductItems = new ProductItems(); ProductItems.SubCategoryId = 1; ProductItems.ProductId = 1; ProductItems.Price = 7600.00; ProductItems.ProductName = "Noriko Two Door Wardrobe with Two Drawers and Mirror"; ProductItems.ProductDescription = "Two Door Wardrobe"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 1; ProductItems.ProductId = 2; ProductItems.Price = 2000.00; ProductItems.ProductName = "Almirah Kidsmlx Lkl66"; ProductItems.ProductDescription = "Plastic Wardrobe Cupboard"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 1; ProductItems.ProductId = 3; ProductItems.Price = 9345.00; ProductItems.ProductName = "Hometown Ibis Multipurpose Cabinet (Wenge)"; ProductItems.ProductDescription = "Multipurpose Cabinet"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 1; ProductItems.ProductId = 4; ProductItems.Price = 2000.00; ProductItems.ProductName = "Armoire Wardrobe Storage Cabinet"; ProductItems.ProductDescription = "Wardrobe Storage Cabinet"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 2; ProductItems.ProductId = 5; ProductItems.Price = 4544.00; ProductItems.ProductName = "Remington Hunting Cleaning and Maintenance Kit"; ProductItems.ProductDescription = "Hunting Cleaning and Maintenance Kit"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 2; ProductItems.ProductId = 6; ProductItems.Price = 544.00; ProductItems.ProductName = "Alix 16 Wood And Laminate Floor Cleaner Polish"; ProductItems.ProductDescription = "Floor Cleaner Polish"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 2; ProductItems.ProductId = 7; ProductItems.Price = 999.00; ProductItems.ProductName = "Euroclean Xforce Vacuum Cleaner"; ProductItems.ProductDescription = "Vacuum Cleaner"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 3; ProductItems.ProductId = 8; ProductItems.Price = 725.00; ProductItems.ProductName = "WallTola PVC Vinyl Colorful Decorative Peacock Wall Sticker"; ProductItems.ProductDescription = "Wall Sticker"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 3; ProductItems.ProductId = 9; ProductItems.Price = 2990.00; ProductItems.ProductName = "DecorNation Red & Black MDF Nesting Square Durable Wall Shelf"; ProductItems.ProductDescription = "Durable Wall Shelf"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 4; ProductItems.ProductId = 10; ProductItems.Price = 24990.00; ProductItems.ProductName = "Amaani Furniture's Solid Wood Queen Size Bed with Storage "; ProductItems.ProductDescription = "Bed with Storage"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 4; ProductItems.ProductId = 11; ProductItems.Price = 17000.00; ProductItems.ProductName = "Oscar Three Seater Sofa in Peacock Blue Colour"; ProductItems.ProductDescription = "Sofa Sets"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 5; ProductItems.ProductId = 12; ProductItems.Price = 3290.00; ProductItems.ProductName = "Office Bird Note Counting Machine (ob 2020)"; ProductItems.ProductDescription = "Note Counting Machine"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 5; ProductItems.ProductId = 13; ProductItems.Price = 4600.00; ProductItems.ProductName = "Gadget Hero's Mini Desktop Paper Shredder Machine Manual A5 Size"; ProductItems.ProductDescription = "Paper Shredder Machine"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 5; ProductItems.ProductId = 14; ProductItems.Price = 7500.00; ProductItems.ProductName = "Namibind Paper Shredder Machine OS-005"; ProductItems.ProductDescription = "Paper Shredder Machine"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 6; ProductItems.ProductId = 15; ProductItems.Price = 3700.00; ProductItems.ProductName = "Imp A3 Pouch Lamination Machinexl1233025"; ProductItems.ProductDescription = "Lamination Machine"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 6; ProductItems.ProductId = 16; ProductItems.Price = 4890.00; ProductItems.ProductName = "Oddy Compact 12 inch Lamination Machine - A3-4R LM-A3-4R"; ProductItems.ProductDescription = "Lamination Machine"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 6; ProductItems.ProductId = 17; ProductItems.Price = 925.00; ProductItems.ProductName = "Namibind Thermal Binding Machines NB-1000"; ProductItems.ProductDescription = "Thermal Binding Machines"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 7; ProductItems.ProductId = 18; ProductItems.Price = 2700.00; ProductItems.ProductName = "Brother P-Touch PT-D200MA Label Maker"; ProductItems.ProductDescription = "Label Maker"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 7; ProductItems.ProductId = 19; ProductItems.Price = 9200.00; ProductItems.ProductName = "Accurate Electronics PAX POS Bill and Label Printing Weighing Scale"; ProductItems.ProductDescription = "Label Printing Machine"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 7; ProductItems.ProductId = 20; ProductItems.Price = 8700.00; ProductItems.ProductName = "Tvs Pt-262 Thermal Printer"; ProductItems.ProductDescription = "Thermal Label Printer and Stamp Making Machine"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 8; ProductItems.ProductId = 21; ProductItems.Price = 3000.00; ProductItems.ProductName = "Bizinto 41 In 1 Pcs Tool Kit and Screwdriver Set UV_HT_06"; ProductItems.ProductDescription = "Tool Kit and Screwdriver"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 8; ProductItems.ProductId = 22; ProductItems.Price = 5700.00; ProductItems.ProductName = "Black & Decker - EPC12 - 12V Cordless Drill And Driver (16 Pc. Kit + 2 Batteries)"; ProductItems.ProductDescription = "Driller Kit and Drivers"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 8; ProductItems.ProductId = 23; ProductItems.Price = 47000.00; ProductItems.ProductName = "ACER Desktop PC COMPUTER CORE i5 PROCESSOR / 8GB RAM /320GB HDD/DELL LED MONITOR"; ProductItems.ProductDescription = "Desktop And Computers"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 8; ProductItems.ProductId = 24; ProductItems.Price = 25000.00; ProductItems.ProductName = "DELL Desktop Inspiron Aio 3043(Intel PQC N3540/500 GB/ 2GB/ Windows 8.1/ 19.5)"; ProductItems.ProductDescription = "Desktop And Computers"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 9; ProductItems.ProductId = 25; ProductItems.Price = 3500.00; ProductItems.ProductName = "Philips HL1631 500-Watt Juicer"; ProductItems.ProductDescription = "Juicer"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 9; ProductItems.ProductId = 26; ProductItems.Price = 4549.00; ProductItems.ProductName = "Cello 850W Mixer Grinder (Model: GNM1100-ULTRA)"; ProductItems.ProductDescription = "Mixer Grinder"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 9; ProductItems.ProductId = 27; ProductItems.Price = 14619.00; ProductItems.ProductName = "Black and Decker 140W Hand Mixer"; ProductItems.ProductDescription = "Hand Mixture"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 9; ProductItems.ProductId = 28; ProductItems.Price = 4619.00; ProductItems.ProductName = "Sujata 810W Powermatic Plus Juicer Mixer Grinder"; ProductItems.ProductDescription = "Juicer Mixer Grinder"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 9; ProductItems.ProductId = 29; ProductItems.Price = 5209.00; ProductItems.ProductName = "Bajaj FX11 Food Processor"; ProductItems.ProductDescription = "Juicer Mixer Grinder"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 9; ProductItems.ProductId = 30; ProductItems.Price = 15575.00; ProductItems.ProductName = "Black & Decker FX Food Processor 1000 W Juicer Mixer Grinder"; ProductItems.ProductDescription = "Juicer Mixer Grinder"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 10; ProductItems.ProductId = 31; ProductItems.Price = 6500.00; ProductItems.ProductName = "Kent Ultra Water Purifier"; ProductItems.ProductDescription = "Water Purifier"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 10; ProductItems.ProductId = 32; ProductItems.Price = 1445.00; ProductItems.ProductName = "Pureit Classic 14 Litres Water Purifier"; ProductItems.ProductDescription = "Water Purifier"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 11; ProductItems.ProductId = 33; ProductItems.Price = 5209.00; ProductItems.ProductName = "Bajaj FX11 Food Processor"; ProductItems.ProductDescription = "Food Processor"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 11; ProductItems.ProductId = 34; ProductItems.Price = 7980.00; ProductItems.ProductName = "Morphy Richards Icon DLX 1000-Watt Food Processor"; ProductItems.ProductDescription = "Food Processor"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 12; ProductItems.ProductId = 35; ProductItems.Price = 175.00; ProductItems.ProductName = "High Quality Wooden Kitchen Tools Set Of 5 Pieces"; ProductItems.ProductDescription = "Kitchen Tools"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 12; ProductItems.ProductId = 36; ProductItems.Price = 10734.00; ProductItems.ProductName = "Franke AK-100S Rail System Utensil Holder with Hooks"; ProductItems.ProductDescription = "Kitchen Tools"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 13; ProductItems.ProductId = 37; ProductItems.Price = 750.00; ProductItems.ProductName = "Brazucareplikas Brazuca Football - Size: 5"; ProductItems.ProductDescription = "Football Products"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 13; ProductItems.ProductId = 38; ProductItems.Price = 825.00; ProductItems.ProductName = "Vinex NA Dual Sided Clipboard (Spring Release Clip)"; ProductItems.ProductDescription = "Football Products"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 14; ProductItems.ProductId = 39; ProductItems.Price = 800.00; ProductItems.ProductName = "Purplle Hair For Sure (150 ml)(Hair Treatment Hair Repair, Hair Gain, Hair growth)"; ProductItems.ProductDescription = "Cricket Products"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 14; ProductItems.ProductId = 40; ProductItems.Price = 619.00; ProductItems.ProductName = "BC Repair Rescue Treatment - For Damaged Hair (New Packaging) 200ml/6"; ProductItems.ProductDescription = "Cricket Products"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 15; ProductItems.ProductId = 41; ProductItems.Price = 1499.00; ProductItems.ProductName = "Adidas Neoprene Dumbbell - 3.0kg"; ProductItems.ProductDescription = "BodyBuilding & Fitness"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 15; ProductItems.ProductId = 42; ProductItems.Price = 4499.00; ProductItems.ProductName = "Adidas Kettlebell - 8kg"; ProductItems.ProductDescription = "BodyBuilding & Fitness"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 15; ProductItems.ProductId = 43; ProductItems.Price = 3599.00; ProductItems.ProductName = "Adidas Door Gym Weight Lifting Bar"; ProductItems.ProductDescription = "BodyBuilding & Fitness"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 16; ProductItems.ProductId = 44; ProductItems.Price = 98295.00; ProductItems.ProductName = " K-SWISS Men s Vertical Tubes Cali-Mari Low Running Shoeby"; ProductItems.ProductDescription = "Running Products"; listOfProductItems.Add(ProductItems); ProductItems = new ProductItems(); ProductItems.SubCategoryId = 16; ProductItems.ProductId = 45; ProductItems.Price = 35376.00; ProductItems.ProductName = "TYR TMZSJB6A Carbon Zipper Back Shorts John W/Pad, X-Small (Black/Red)"; ProductItems.ProductDescription = "Running Products"; listOfProductItems.Add(ProductItems); return(listOfProductItems); }
public IActionResult Index() { var model = new AccountStatementViewModel(); //_user is expected to contain client details. mock data for model. var _user = new AuthenticateResponse { MembershipKey = 1006979, //1007435, EmailAddress = "*****@*****.**", //"*****@*****.**", FirstName = "Tolulope", LastName = "Olusakin", FullName = "Olusakin Tolulope S"//"Funmilayo Ruth Adeyemi", }; try { var customer = _client.GetUserProfile(_user.MembershipKey); List <ProductDetails> getSummaries = new List <ProductDetails>(); List <decimal> sumOfAccruedInterests = new List <decimal>(); //get account summary var accountsRequest = new SummaryRequest { MembershipNumber = _user.MembershipKey }; //var accountsResponse = _clientService.GetAccountSummary(accountsRequest); var accountsResponse = _clientService.GetAccountSummary(accountsRequest); if (accountsResponse != null) { foreach (var item in accountsResponse.Summaries) { var summaries = new ProductDetails(); summaries.ProductName = item.ProductName; summaries.ProductCode = item.ProductCode; summaries.Currency = item.Currency; summaries.AccruedInterest = item.AccruedInterest; summaries.CurrentBalance = item.CurrentBalance; summaries.PendingTransaction = item.PendingTransaction; getSummaries.Add(summaries); sumOfAccruedInterests.Add(summaries.AccruedInterest); } model.Summaries = getSummaries; } //get last transactions var transactions = _client.LoadLastTransactions(_user, accountsResponse, 6); List <ProductTransactions> getTransactions = new List <ProductTransactions>(); if (transactions != null && transactions.Count > 0) { foreach (var item in transactions) { var product = new ProductTransactions(); product.MarketValue = item.MarketValue; product.Description = item.Description; product.TransactionDate = item.TransactionDate; product.TransactionType = item.TransactionType; product.Amount = item.Amount; product.UnitPrice = item.UnitPrice; product.FundCode = item.FundCode; product.Units = item.Units; getTransactions.Add(product); } model.Transactions = getTransactions; } //get total balance var totalBalanceRequest = new TotalBalanceRequest { MembershipNumber = _user.MembershipKey }; var totalBalanceResponse = _clientService.GetTotalBalance(totalBalanceRequest); if (totalBalanceResponse != null) { model.TotalBalance = totalBalanceResponse.TotalBalance; } List <ProductItems> getItems = new List <ProductItems>(); if (customer.ProductItems != null) { foreach (var productitems in customer.ProductItems) { var product = new ProductItems(); product.ProductName = productitems.ProductName; product.ProductCode = productitems.ProductCode; getItems.Add(product); } model.SelectProductName = getItems; } var accruedInterests = sumOfAccruedInterests.Sum(); ViewBag.SumAccruedInterest = accruedInterests; } catch (Exception ex) { //HttpContext.Session.Set("error", ex.Message); TempData["message"] = ViewBag.Message = ex.Message; Utilities.ProcessError(ex, _contentRootPath); _logger.LogError(null, ex, ex.Message); } return(View(model)); }
public decimal GetItemTotalAmount() { return(ProductItems.Sum(p => p.Amount)); }