Exemplo n.º 1
0
        private void loadTable()
        {
            // TODO: This line of code loads data into the 'belajar1DataSet2.msmenu' table. You can move, or remove it, as needed.
            this.msmenuTableAdapter.Fill(this.belajar1DataSet2.msmenu);
            // TODO: This line of code loads data into the 'belajar1DataSet3.msmember' table. You can move, or remove it, as needed.
            this.msmemberTableAdapter.Fill(this.belajar1DataSet3.msmember);
            // TODO: This line of code loads data into the 'belajar1DataSet4.detailorder' table. You can move, or remove it, as needed.
            this.detailorderTableAdapter.Fill(this.belajar1DataSet4.detailorder);

            txtname.Text             = null;
            txtprice.Text            = null;
            txtqty.Value             = 1;
            pictReview.ImageLocation = null;
            int allPrice = 0;

            orderIDToolStripTextBox.Text = orderId.ToString();
            actSearch();

            for (int i = 0; i < dataGridOrder.RowCount; i++)
            {
                int    menuId = Convert.ToInt32(dataGridOrder.Rows[i].Cells[2].Value);
                msmenu menu   = new msmenu();
                menu = db.msmenus.Single(id => id.menuid == menuId);
                string namaMenu = menu.name;
                int    price    = menu.price;
                dataGridOrder.Rows[i].Cells[3].Value = namaMenu;
                dataGridOrder.Rows[i].Cells[5].Value = price;

                int totalPrice = Convert.ToInt32(dataGridOrder.Rows[i].Cells[6].Value);
                allPrice     += totalPrice;
                lblTotal.Text = allPrice.ToString();
            }
        }
Exemplo n.º 2
0
        private void Btndelete_Click(object sender, EventArgs e)
        {
            msmenu menu = new msmenu();

            menu = db.msmenus.Single(x => x.menuid == Convert.ToInt32(txtid.Text));
            db.msmenus.DeleteOnSubmit(menu);
            db.SubmitChanges();
            load();
        }
Exemplo n.º 3
0
        private void Btnupdate_Click(object sender, EventArgs e)
        {
            msmenu menu = new msmenu();

            menu       = db.msmenus.Single(x => x.menuid == Convert.ToInt32(txtid.Text));
            menu.name  = txtname.Text;
            menu.price = Convert.ToInt32(txtprice.Text);
            menu.photo = txtphoto.Text.ToString();
            db.SubmitChanges();
            load();
        }
Exemplo n.º 4
0
        private void Btninsert_Click(object sender, EventArgs e)
        {
            msmenu menu = new msmenu();

            menu.name  = txtname.Text;
            menu.price = Convert.ToInt32(txtprice.Text);
            menu.photo = txtphoto.Text.ToString();
            db.msmenus.InsertOnSubmit(menu);
            db.SubmitChanges();
            load();
        }
Exemplo n.º 5
0
        private void DataGridOrder_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow rows = dataGridOrder.CurrentRow;

            detailId = Convert.ToInt32(rows.Cells[0].Value);
            int menuID = Convert.ToInt32(rows.Cells[2].Value);

            txtqty.Value  = Convert.ToInt32(rows.Cells[4].Value);
            txtprice.Text = rows.Cells[5].Value.ToString();

            msmenu menu = new msmenu();

            menu = db.msmenus.Single(x => x.menuid == menuID);
            pictReview.ImageLocation = menu.photo;
            txtname.Text             = menu.name;
            txtqty.Enabled           = false;
        }
Exemplo n.º 6
0
        private void loadTable()
        {
            loadData();
            txtBankName.Text      = null;
            txtCardNumber.Text    = null;
            txtPaymentType.Text   = null;
            orderIdToolStrip.Text = comboOrderID.Text;
            filterTable();
            int allPrice = 0;

            for (int i = 0; i < dataGridOrder.RowCount; i++)
            {
                int    menuId = Convert.ToInt32(dataGridOrder.Rows[i].Cells[6].Value);
                msmenu menu   = new msmenu();
                menu = db.msmenus.Single(id => id.menuid == menuId);
                string namaMenu = menu.name;
                int    price    = menu.price;
                dataGridOrder.Rows[i].Cells[0].Value = namaMenu;
                dataGridOrder.Rows[i].Cells[2].Value = price;

                int totalPrice = Convert.ToInt32(dataGridOrder.Rows[i].Cells[3].Value);
                allPrice     += totalPrice;
                lblTotal.Text = allPrice.ToString();
            }
            headerorder headerOrder = new headerorder();

            headerOrder = db.headerorders.Single(id => id.orderid == Convert.ToInt32(comboOrderID.Text));
            if (headerOrder.payment == "null")
            {
                btnSave.Enabled        = true;
                txtBankName.Enabled    = true;
                txtCardNumber.Enabled  = true;
                txtPaymentType.Enabled = true;
                txtPaymentType.Enabled = true;
            }
            else
            {
                btnSave.Enabled        = false;
                txtBankName.Enabled    = false;
                txtCardNumber.Enabled  = false;
                txtPaymentType.Enabled = false;
            }
        }
Exemplo n.º 7
0
 partial void Deletemsmenu(msmenu instance);
Exemplo n.º 8
0
 partial void Updatemsmenu(msmenu instance);
Exemplo n.º 9
0
 partial void Insertmsmenu(msmenu instance);