Portfolio

Monday, November 9, 2015

Starting a Project and Finishing the End Product

Start a Web Shop 

I followed this project designing a consignment shop for a clerk to use in their store.  It was a challenging task to finish and it took me about 4-5 days to complete because I kept stopping.  I would suggest to stick to the project and not get side tracked like me.  It should have taken me less time, but things happen.

Write out your notes

When I first started I wrote out my objectives about what I wanted to achieve in a small application.  Therefore, I wrote out my tasks in Microsoft Word and the classes in MS Excel.  The reason for this was to see the tasks clearly. 

Time to design

Now open up Visual Studio and select a windows application in C#.  You can view my code now to see my application.





ConsignmentShopUI

using ConsignmentShopLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ConsignmentShopUI

{
    public partial class ConsignmentShop : Form
    {

        private Store store = new Store();

        BindingSource itemsBinding = new BindingSource();


      
        public ConsignmentShop()
        {
            InitializeComponent();
            SetupData();

            itemsBinding.DataSource = store.Items;
            itemsListBox.DataSource = itemsBinding;

            itemsListBox.DisplayMember = "Display";
            itemsListBox.ValueMember = "Display";

        }

        private void SetupData()
        {
           
            store.Vendors.Add(new Vendor { FirstName = "Bob", LastName = "Jones"});
            store.Vendors.Add(new Vendor { FirstName = "Tony", LastName = "Bologna" });

            store.Items.Add(new Item { Title = "Moby Dick",
                                        Description = "A book about a whale.",
                                        Price = 2.99M,
                                        Owner = store.Vendors[0] });
            store.Items.Add(new Item
            {
                Title = "Of Mice and Men",
                Description = "A book about two displaced migrant ranch workers.",
                Price = 3.50M,
                Owner = store.Vendors[0]
            });

            store.Items.Add(new Item
            {
                Title = "The Great Gatsby",
                Description = "A book about a midwesterner that moved next door to a mansion owned by a wealthy man",
                Price = 3.50M,
                Owner = store.Vendors[1]
            });
            store.Items.Add(new Item
            {
                Title = "The Complete Poems",
                Description = "A book about poems.",
                Price = 2.80M,
                Owner = store.Vendors[1]
            });

            store.Name = "Seconds Are Better";
        }
       
        }

    }



No comments:

Post a Comment