Esempio n. 1
0
        private void loadListRowIntoDetails(int RowIndex)
        {
            DataGridViewRow row = gvMenuItems.Rows[RowIndex];

            activeID = int.Parse(row.Cells[0].Value.ToString());
            data_models.Models.MenuItem m = MenuItemController.GetOneById(_context, (int)activeID);
            ddlCategory.Text = m.Category;
            tbxTitle.Text    = m.Title;
            if (m.Description != null)
            {
                rtbDescription.Text = m.Description;
            }
            if (m.Price != null)
            {
                tbxPrice.Text = toPaddedString((decimal)m.Price);
            }
            if (m.DiscountPrice == null)
            {
                cbxDiscount.Checked = false;
            }
            else
            {
                cbxDiscount.Checked   = true;
                tbxDiscountPrice.Text = toPaddedString((decimal)m.DiscountPrice);
            }

            cbxAvailable.Checked = m.IsAvailable;
            cbxSpecialty.Checked = m.IsSpecialty;
        }