Exemple #1
0
        public Diablog_Cay(string id)
        {
            InitializeComponent();
            border();
            CayDB db = new CayDB();
            // load noi dung de sua thong tin
            List <string> l = new List <string>()
            {
                "Xuân", "Hạ", "Thu", "Đông"
            };

            comboBoxMuaThuHoach.DataSource = l;
            #region gắn giá trị
            this.id                     = Convert.ToInt32(id);
            o                           = db.GetCay(id);
            textTenCay.Text             = o.TenCay;
            comboBoxMuaThuHoach.Text    = o.MuaThuHoach;
            textSoLuong.Text            = o.SoLuong.ToString();
            DatepickerNamTrongCay.Value = o.NamTrongCay;
            DatepickerNamTrongCay.Value.ToString("dd/MM/yyyy");
            #endregion
            // An button add
            button_add.Enabled = false;
            button_add.Visible = false;
            //Hien button luu
            button_luu.Visible = true;
            //button_luu.Enabled = false;
        }
Exemple #2
0
        static void Main(string[] args)
        {
            // kullanıcıdan alınan 2 sayıyı toplayan program
            Console.WriteLine("toplam için 2 sayı girin");
            int x = Convert.ToInt32(Console.ReadLine());   Cay cay = new Cay(); // aynı şey
            int y = Convert.ToInt32(Console.ReadLine());

            Topla(x, y);
        }
Exemple #3
0
            public Cay CaySiparis(string pizzaType)
            {
                Cay cay = CayOlustur(pizzaType);

                cay.Hazirlama(); // abstract factory pattern
                cay.Sukaynatma();
                cay.CayiIlaveEtme();
                cay.CayiDinlendirme();
                cay.FincanaKoyma();
                return(cay);
            }
Exemple #4
0
            public Cay CaySiparis(string cayType)
            {
                Cay cay = CayOlustur(cayType);

                cay.Hazirlama();
                cay.Sukaynatma();
                cay.CayiIlaveEtme();
                cay.CayiDinlendirme();
                cay.FincanaKoyma();
                return(cay);
            }
Exemple #5
0
 private void bunifuFlatButton1_Click(object sender, EventArgs e)
 {
     if (check())
     {
         o = new Cay()
         {
             MaLoaiCay = this.id, TenCay = textTenCay.Text, MuaThuHoach = comboBoxMuaThuHoach.Text, SoLuong = Convert.ToInt32(textSoLuong.Text), NamTrongCay = DatepickerNamTrongCay.Value.Date,
         };
         bus.Edit(o);
         MessageBox.Show("Sửa thành công");
         Dialog_close();
     }
 }
Exemple #6
0
            // hillsboro-style preparation for all pizzas
            protected override Cay CayOlustur(string type)
            {
                Cay cay = null;

                if (type == "Siyah")
                {
                    cay = new RizeStiliSiyahCay();
                }
                else if (type == "Yesil")
                {
                    cay = new RizeStiliYesilCay();
                }

                /*else if (type == "Suede")
                 *  cay = new HillsboroStyleShoePizza();*/

                return(cay);
            }
Exemple #7
0
            // portland-style preparation for all pizzas
            protected override Cay CayOlustur(string type)
            {
                Cay cay = null;

                if (type == "Siyah")
                {
                    cay = new CinStiliSiyahCay();
                }
                else if (type == "Yesil")
                {
                    cay = new CinStiliYesilCay();
                }

                /* else if (type == "Suede")
                 *   pizza = new PortlandStyleShoePizza();*/

                return(cay);
            }
Exemple #8
0
        private void btnDoldur_Click(object sender, EventArgs e)
        {
            try
            {
                int   adet;
                Cay   cay   = new Cay();
                Kahve kahve = new Kahve();

                if (radioButton2.Checked)
                {
                    richTextBox1.Text = "" + cay.Doldur();
                    adet = Convert.ToInt32(textBox1.Text);
                    MessageBox.Show(cay.hazirla(adet));
                }
                else if (radioButton1.Checked)
                {
                    grpKahve.Visible = true;
                    if (radioButton3.Checked)
                    {
                        kahve.Doldur();

                        kahve.cesit       = Kahve.Cesitler.TürkKahvesi;
                        richTextBox1.Text = "" + kahve.cesit;
                        adet = Convert.ToInt32(textBox1.Text);
                        MessageBox.Show(kahve.hazirla(adet));
                    }
                    else if (radioButton4.Checked)
                    {
                        kahve.Doldur();

                        kahve.cesit       = Kahve.Cesitler.Cappucino;
                        richTextBox1.Text = "" + kahve.cesit;

                        adet = Convert.ToInt32(textBox1.Text);
                        MessageBox.Show(kahve.hazirla(adet));
                    }
                }
            }
            catch (Exception ex)
            {
                richTextBox1.Text = "" + ex.Message;
            }
        }
Exemple #9
0
            // hillsboro-style preparation for all pizzas
            protected override Cay CayOlustur(string type)
            {
                Cay cay = null;
                MMalzemeFabrikasi malzemeFabrikasi =
                    new RizeMalzemeFabrikasi();

                if (type == "Siyah")
                {
                    cay = new SiyahCay(malzemeFabrikasi);
                }
                else if (type == "Yesil")
                {
                    cay = new YesilCay(malzemeFabrikasi);
                }

                /*  else if (type == "Suede")
                 *    pizza = new ShoePizza(malzemeFabrikasi);*/

                return(cay);
            }
Exemple #10
0
        public Diablog_Cay(string id)
        {
            InitializeComponent();
            CayDB db = new CayDB();

            // load noi dung de sua thong tin
            #region gắn giá trị
            this.id                    = Convert.ToInt32(id);
            o                          = db.GetCay(id);
            textTenCay.Text            = o.TenCay;
            comboBoxMuaThuHoach.Text   = o.MuaThuHoach;
            textSoLuong.Text           = o.SoLuong.ToString();
            DatepickerNamGieoDau.Value = o.NamGieoDau;
            #endregion
            // An button add
            button_add.Enabled = false;
            button_add.Visible = false;
            //Hien button luu
            button_luu.Visible = true;
            //button_luu.Enabled = false;
        }
Exemple #11
0
        private void button_add_Click(object sender, EventArgs e)
        {
            if (check())
            {
                o = new Cay()
                {
                    TenCay = o.TenCay, SoLuong = o.SoLuong, MuaThuHoach = o.MuaThuHoach, NamGieoDau = o.NamGieoDau, MaLoaiCay = o.MaLoaiCay
                };
                bus.Add(o);
                Dialog_close();
            }
            #region kt
            //string t="Tên phân bón : {0} \n Loại: {1} \n Ngày sx: {2} \n hạn sử dụng: {3}";
            //string msg = string.Format(t,o.TenPB,o.Loai,o.NgaySX.ToString("dd//MM/yyyy"), o.HanSD.ToString("dd//MM/yyyy"));
            //MessageBox.Show(msg);

            //DatepickerSX.Value.ToString("dd/MM/yyyy")
            //MessageBox.Show(textTenPB.Text+" " + comboBoxLoai.Text );

            //MessageBox.Show("thành công");
            #endregion
        }
Exemple #12
0
        private void button_add_Click(object sender, EventArgs e)
        {
            if (check())
            {
                o = new Cay()
                {
                    TenCay = textTenCay.Text, SoLuong = Convert.ToInt32(textSoLuong.Text), MuaThuHoach = comboBoxMuaThuHoach.Text, NamTrongCay = DatepickerNamTrongCay.Value.Date
                };
                bus.Add(o);
                MessageBox.Show("Thêm thành công");
                Dialog_close();
            }
            #region kt
            //string t="Tên phân bón : {0} \n Loại: {1} \n Ngày sx: {2} \n hạn sử dụng: {3}";
            //string msg = string.Format(t,o.TenPB,o.Loai,o.NgaySX.ToString("dd//MM/yyyy"), o.HanSD.ToString("dd//MM/yyyy"));
            //MessageBox.Show(msg);

            //DatepickerSX.Value.ToString("dd/MM/yyyy")
            //MessageBox.Show(textTenPB.Text+" " + comboBoxLoai.Text );


            #endregion
        }
Exemple #13
0
        public void Edit(Cay o)
        {
            CayDB db = new CayDB();

            db.Edit(o);
        }
Exemple #14
0
        public void Add(Cay o)
        {
            CayDB db = new CayDB();

            db.Add(o);
        }
 public void Doldur(Cay cay)
 {
     Console.WriteLine($"{cay.Name} hazır");
 }