private void btnSiparis_Click(object sender, EventArgs e) { cMasalar masa = new cMasalar(); frmMasalar ms = new frmMasalar(); cAdisyon newAddition = new cAdisyon(); cSiparis saveOrder = new cSiparis(); bool sonuc = false; if (masa.TableGetByState(tableId, 1) == true) { newAddition.ServisTurNo = 1; newAddition.PersonelId1 = 1; newAddition.MasaId = tableId; newAddition.Tarih = DateTime.Now; sonuc = newAddition.setByAdditionel(newAddition); masa.setChangeTableState(cGenel._ButtonName, 2); if (lvSiparisler.Items.Count > 0) { for (int i = 0; i < lvSiparisler.Items.Count; i++) { saveOrder.MasaId = tableId; saveOrder.UrunId = Convert.ToInt32(lvSiparisler.Items[i].SubItems[2].Text); saveOrder.AdisyonID = newAddition.getByAddition(tableId); saveOrder.Adet = Convert.ToInt32(lvSiparisler.Items[i].SubItems[1].Text); saveOrder.setSaveOrder(saveOrder); } this.Close(); ms.Show(); } } else if (masa.TableGetByState(tableId, 2) == true) { if (lvYeniEklenenler.Items.Count > 0) { for (int i = 0; i < lvYeniEklenenler.Items.Count; i++) { saveOrder.MasaId = tableId; saveOrder.UrunId = Convert.ToInt32(lvYeniEklenenler.Items[i].SubItems[1].Text); saveOrder.UrunId = newAddition.getByAddition(tableId); saveOrder.UrunId = Convert.ToInt32(lvYeniEklenenler.Items[i].SubItems[2].Text); saveOrder.setSaveOrder(saveOrder); } } if (silinenler.Count > 0) { foreach (string item in silinenler) { saveOrder.setDeleteOrder(Convert.ToInt32(item)); } } this.Close(); ms.Show(); } }
private void lvSiparisler_DoubleClick(object sender, EventArgs e) { if (lvSiparisler.Items.Count > 0) { if (lvSiparisler.SelectedItems[0].SubItems[4].Text != "0") { cSiparis saveorder = new cSiparis(); saveorder.setDeleteOrder(Convert.ToInt32(lvSiparisler.Items[0].SubItems[4].Text)); } else { for (int i = 0; i < lvYeniEklenenler.Items.Count; i++) { if (lvYeniEklenenler.Items[i].SubItems[4].Text == lvSiparisler.SelectedItems[0].SubItems[5].Text) { lvYeniEklenenler.Items.RemoveAt(i); } } } lvSiparisler.Items.RemoveAt(lvSiparisler.SelectedItems[0].Index); } }