示例#1
0
        //private void btnGetQuote_Click(object sender, EventArgs e)
        //{
        //    var desk = new Desk();
        //    var deskQuote = new DeskQuote(desk);
        //    deskQuote.CustomerName = customerName.Text;
        //    desk.Depth = txtDepth.Value;
        //    desk.Width = idth.Value;
        //    desk.NumberOfDrawers = numberOfDrawers.Value;
        //}

        public AddQuote()
        {
            InitializeComponent();
            var surfaceList = SurfaceMaterialFactory.GetSurfaceMaterials();

            lblMaterial.DataSource    = surfaceList;
            lblMaterial.DisplayMember = "Name";


            lblRushOptions.DataSource    = RushOrderFactory.GetRushOrder();
            lblRushOptions.DisplayMember = "Name";

            _desk      = new Desk();
            _deskQuote = new DeskQuote();
        }
示例#2
0
        //private void loadGrid(string searchTerm)
        //{
        //    dataGridView2.Rows.Clear();
        //    string[] deskQuotes = File.ReadAllLines(@"quotes.txt");
        //    foreach (string deskQuote in deskQuotes)
        //    {
        //        if (deskQuote.Contains(searchTerm))
        //        {
        //            string[] arrRow = deskQuote.Split(new char[] { ',' });
        //            dataGridView2.Rows.Add(arrRow);
        //        }
        //    }
        //}

        private void lblMaterial_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <DeskQuote> myQuotes = new List <DeskQuote>();
            string           readText = File.ReadAllText("C:\\Users\\lisac\\Documents\\quotes.txt");
            var             lines     = readText.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            SurfaceMaterial material  = (SurfaceMaterial)lblMaterial.SelectedItem;

            foreach (var line in lines)
            {
                var quote = new DeskQuote(line);
                if (material.Name.CompareTo(quote.Desk.SurfaceMaterial.Name) == 0)
                {
                    myQuotes.Add(quote);
                }
            }
            dataGridView2.AutoGenerateColumns = false;
            dataGridView2.DataSource          = myQuotes;
        }
示例#3
0
        public ViewAllQuotes()
        {
            InitializeComponent();



            string readText = File.ReadAllText("C:\\Users\\lisac\\Documents\\quotes.txt");
            var    lines    = readText.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

            foreach (var line in lines)
            {
                var quote = new DeskQuote(line);
                myQuotes.Add(quote);

                //dataGridView1.AutoGenerateColumns = true;
                Console.WriteLine(line);
            }

            dataGridView1.DataSource = myQuotes;
        }