Пример #1
0
        private void ShowAnSangList()
        {
            QuanAnEntities db   = new QuanAnEntities();
            var            list = db.AnSangs.ToArray();

            this.grdAnsang.DataSource = list;
        }
Пример #2
0
        private void showAnSangList()
        {
            var db   = new QuanAnEntities();
            var list = db.AnSangs.ToArray();

            this.GrdAnSang.DataSource = list;
        }
Пример #3
0
        private void ShowAnSangList()
        {
            QuanAnEntities db = new QuanAnEntities();

            AnSang[] list = db.AnSangs.ToArray();
            this.GRDAnSang.DataSource = list;
        }
Пример #4
0
        void btnThemMoi_Click(object sender, EventArgs e)
        {
            var tenmon  = this.txtTenMon.Text;
            var giatien = int.Parse(this.txtGiaTien.Text);
            var anSang  = new AnSang();

            anSang.TenMon  = tenmon;
            anSang.GiaTien = giatien;
            var db = new QuanAnEntities();

            db.AnSangs.Add(anSang);
            db.SaveChanges();

            MessageBox.Show("Them moi mon an thanh cong");
            this.Close();
        }
Пример #5
0
        void btnLuu_Click(object sender, EventArgs e)
        {
            var tenMon  = this.tbxTenMon.Text;
            var giaTien = int.Parse(this.tbxGiaTien.Text);
            var anSang  = new AnSang();

            anSang.TenMon  = tenMon;
            anSang.GiaTien = giaTien;
            var db = new QuanAnEntities();

            db.AnSangs.Add(anSang);
            db.SaveChanges();

            MessageBox.Show("Them Mon Thanh Cong !!!");
            this.Close();
        }