Beispiel #1
0
        private void btnMenuAdd_Click(object sender, EventArgs e)
        {
            MenuCardForm frm = new MenuCardForm();

            frm.FormModel = 1;
            frm.Text      = "Add New Menu";
            frm.context   = ctx;
            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                dataGridMenus.DataSource = ctx.MenuCards.ToArray();
                cboFilter.SelectedValue  = 0;
            }
        }
Beispiel #2
0
 private void btnMenuEdit_Click(object sender, EventArgs e)
 {
     if (dataGridMenus.SelectedRows.Count > 0)
     {
         MenuCard     item = (MenuCard)dataGridMenus.SelectedRows[0].DataBoundItem;
         MenuCardForm frm  = new MenuCardForm();
         frm.FormModel    = 2;
         frm.Text         = "Edit Menu";
         frm.context      = ctx;
         frm.SelectedMenu = item;
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             dataGridMenus.DataSource = ctx.MenuCards.ToArray();
             cboFilter.SelectedValue  = 0;
         }
     }
 }