예제 #1
0
        private void Save_button_Click(object sender, EventArgs e)
        {
            productList = new List <Product>();
            Product newProduct = new Product();

            newProduct.Name     = Name.Text;
            newProduct.Price    = Convert.ToDouble(Price.Text);
            newProduct.Category = Category.Text;
            newProduct.Brand    = Brand.Text;
            newProduct.Color    = Color.Text;
            newProduct.Barcode  = Convert.ToInt32(Barcode.Text);
            newProduct.Stock    = Stock.Text;
            newProduct.Ad       = Ad.Text;


            GridView.Rows.Add(newProduct.Name, newProduct.Price, newProduct.Category, newProduct.Brand, newProduct.Color, newProduct.Barcode, newProduct.Stock, newProduct.Ad);

            productList.Add(newProduct);


            Name.Clear();
            Price.Clear();
            Color.Clear();
            Barcode.Clear();
            Stock.Clear();
            Ad.Clear();
        }
예제 #2
0
        private void Save_Click(object sender, EventArgs e)
        {
            person.name     = Ad.Text;
            person.Surname  = Soyad.Text;
            person.phone    = Phone.Text;
            person.mail     = Mail.Text;
            person.home_adr = Home_adress.Text;
            person.work_adr = Work_adress.Text;

            people.Add(person);
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine($"Ad: {person.name}");
            stringBuilder.AppendLine($"Soyad: {person.Surname}");
            stringBuilder.AppendLine($"Tel: {person.phone}");
            stringBuilder.AppendLine($"Mail: {person.mail}");
            stringBuilder.AppendLine($"Ev ünvanı: {person.home_adr}");
            stringBuilder.AppendLine($"İş ünvanı: {person.work_adr}");


            MessageBox.Show(stringBuilder.ToString(), "Məlumatlar");
            Ad.Clear();
            Soyad.Clear();
            Phone.Clear();
            Mail.Clear();
            Work_adress.Clear();
            Home_adress.Clear();

            panel3.Visible = false;
            panel2.Visible = false;
        }