private void SiparisKontrol() { siparisno = Convert.ToInt32(txtboxSiparis.Text); Orders order = db.Set <Orders>().Find(siparisno); if (order == null) { MessageBox.Show("Böyle bir sipariş bulunamadı."); } else { frmorder frm = new frmorder(siparisno); frm.Show(); } }
private void btnolustur_Click(object sender, EventArgs e) { Orders order = new Orders(); order.CustomerID = comboBoxcust.SelectedValue.ToString(); order.ShipVia = Convert.ToInt32(comboBoxkargo.SelectedValue); order.EmployeeID = Convert.ToInt32(comboBoxemp.SelectedValue); order.OrderDate = dateTimePickerorder.Value; order.RequiredDate = dateTimePickerreq.Value; order.ShippedDate = dateTimePickership.Value; db.Orders.Add(order); db.SaveChanges(); MessageBox.Show(order.OrderID + "siparis ana kayıt eklendi."); frmorder frm = new frmorder(order.OrderID); frm.Show(); }