public void LoadProductPriceDetails() { int numberOfItems = Convert.ToInt32(ddlNumberOfItems.SelectedItem.Value); int productId = Convert.ToInt32(ddlProducts.SelectedItem.Value); if (productId > 0 && numberOfItems > 0) { InventoryBL bl = new InventoryBL(); var product = bl.GetProducts(productId).FirstOrDefault(); if (product != null) { if (product.Supplier_Id > 0) { var supplier = bl.GetSuppliers(product.Supplier_Id).FirstOrDefault(); if (supplier != null) { txtCost.Text = product.Price.ToString(); txtAmount.Text = (product.Price * numberOfItems).ToString(); txtGrossAmount.Text = (product.Price * numberOfItems).ToString(); txtServiceCharge.Text = supplier.Service_Charge_Value; txtVat.Text = supplier.Vat_Charge_Value; txtNetAmount.Text = ((product.Price * numberOfItems) + Convert.ToInt32(supplier.Service_Charge_Value) + Convert.ToInt32(supplier.Vat_Charge_Value)).ToString(); } } } } }
public void LoadDropdowns() { InventoryBL bl = new InventoryBL(); var supplier = bl.GetSuppliers(0); var categories = bl.GetCategories(); var brands = bl.GetBrands(); var stores = bl.GetStores(); ddlSupplier.Items.Add(new ListItem("Select", "0")); ddlCategory.Items.Add(new ListItem("Select", "0")); ddlBrand.Items.Add(new ListItem("Select", "0")); ddlStore.Items.Add(new ListItem("Select", "0")); foreach (var sup in supplier) { ddlSupplier.Items.Add(new ListItem(sup.Supplier_Name, sup.Supplier_Id.ToString())); } foreach (var item in categories) { ddlCategory.Items.Add(new ListItem(item.Category_Name, item.Category_Id.ToString())); } foreach (var item in brands) { ddlBrand.Items.Add(new ListItem(item.Brand_Name, item.Brand_Id.ToString())); } foreach (var item in stores) { ddlStore.Items.Add(new ListItem(item.Store_Name, item.Store_Id.ToString())); } }
public static dynamic GetSuppliers() { InventoryBL bl = new InventoryBL(); var result = bl.GetSuppliers(0).Select(x => new { Supplier_Id = x.Supplier_Id, Supplier_Name = x.Supplier_Name, Service_Charge_Value = x.Service_Charge_Value, Vat_Charge_Value = x.Vat_Charge_Value, Address = x.Address, Phone = x.Phone, Country = x.Country, Message = x.Message, Currency = x.Currency }).ToList(); return(result); }