/// <summary> /// This is main class. /// </summary> /// <param name="args"></param> static void Main(string[] args) { try { List <Product> products = new List <Product>(); ProductUtility productUtility = new ProductUtility(); Console.WriteLine("Total number of order"); int a = Convert.ToInt32(Console.ReadLine()); for (int i = 0; i < a; i++) { Console.WriteLine("Enter the type of product:A,B,C or D"); string type = Console.ReadLine(); Product product = new Product(type); products.Add(product); } int totalPrice = productUtility.GetTotalPrice(products); Console.WriteLine(totalPrice); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
// GET: ViewCart public ActionResult Index() { ViewData["ViewCart"] = "1"; ViewData["Price"] = "1"; ViewData["Cart"] = "0"; ViewData["ContinueShopping"] = "0"; Dictionary <string, string> kV = Utility.CookieUtility.getProductKeyValues(Request.Cookies); //make product id and no of item key value pair if (kV.Count > 0) { List <CartList> cl = ProductDao.getProductsByIds(kV); //calculate total to populate it in view int total = ProductUtility.Total(cl); ViewData["CartList"] = cl; ViewData["Total"] = total; } else { ViewData["Total"] = 0; } return(View()); }
void LoadTreeview() { ProductUtility obj = new ProductUtility(treeView1); obj.BuildRootPart(); ComboboxUtility.BindSupplier(cboSupplier); FormUtility.ResetForm(this); }
public void LoadTree() { ProductUtility ProductUtility = new ProductUtility(treeView1); ProductUtility.BuildRoot(); if (treeView1.Nodes != null) { treeView1.Nodes[0].Checked = true; } }
private void btnReport_Click(object sender, EventArgs e) { rptPoDetail rpt = new rptPoDetail(); reportUtility = new ReportUtility(rpt); IList <QuotationDetail> lstQuotation = gridControl1.DataSource as IList <QuotationDetail>; foreach (QuotationDetail detail in lstQuotation) { detail.TotalDescription = ProductUtility.ConvertToDescription(detail, ProductUtility.QuotationDetailToDescription); } reportUtility.Binding <QuotationDetail>(rpt.bindingSource1, lstQuotation); reportUtility.ShowPreview(); }
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { IList <Product> lstProduct; TreeTag treeTag = null; if (e.Node == null) { lstProduct = new List <Product>(); gridUtility.BindingData <Product>(lstProduct); } else { treeTag = e.Node.Tag as TreeTag; treeView1.SelectedNode = e.Node; if (e.Button == MouseButtons.Left) { if (treeTag == null) { return; } lstProduct = ProductUtility.FindProductByParent(treeTag); gridUtility.BindingData <Product>(lstProduct); } if (e.Button == MouseButtons.Right) { ICtxCategory.Show(treeView1.SelectedNode); } } lstPicture = null; m_Product = new Product(); m_Product.Category = new Category(); m_Product.Category.CategoryName = treeTag.CateName; m_Product.Series = new Series(); m_Product.Series.SerieName = treeTag.SerieName; m_Product.SeriesId = treeTag.SerieId; m_Product.Productline = new ProductLine(); m_Product.Productline.ProductLineName = treeTag.LineName; m_Product.ProductLineId = treeTag.LineId; InititalizeForm(m_Product); }
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node == null) { return; } TreeTag treeTag = e.Node.Tag as TreeTag; treeView1.SelectedNode = e.Node; IList <Model.Product> lstProduct = null; e.Node.Expand(); if (e.Button == MouseButtons.Left) { if (treeTag == null) { return; } lstProduct = ProductUtility.FindProductByParent(treeTag); } frmProduct.BindProductToListView(lstProduct); ShowPnl(PnlToShow.pnlProduct); }
public void LoadTree() { ProductUtility ProductUtility = new ProductUtility(treeView1); ProductUtility.BuildRoot(); }
private void AddMaterialToProduct(IList <Model.Material> lstProductMaterial, Product product) { ProductUtility.AddMaterialToProduct(lstProductMaterial, product); }
private void AddProductToGrid(IList <CustomProduct> lstProduct) { ProductUtility.AddProductToGrid(lstProduct, gridControl1); gridView1.RefreshData(); }
private void InititalizeForm(QuotationDetail quotationDetail) { richTextBox1.Text = ProductUtility.ConvertToDescription <Model.QuotationDetail>(m_QuotationDetail, ProductUtility.QuotationDetailToDescription, 2); }
private void AddProductToGrid(IList <CustomModel.CustomProduct> lstProduct) { ProductUtility.AddProductToGrid(lstProduct, gridControl1); }