private void btnDelete_Click(object sender, EventArgs e) { try { dgvInventory.EndEdit(); List <string> sernolist = new List <string>(); string delSernoList = ""; foreach (DataGridViewRow row in dgvInventory.Rows) { DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells[1]; if ((bool)chk.Value) { sernolist.Add(row.Cells["dgvInventory_Serno"].Value.ToString()); } } delSernoList = APConfig.sqlArrayFormat(string.Join(",", sernolist)); Inventory ent = new Inventory(APConfig.Conn); string sConditions = ent.getCondition(Inventory.ncConditions.sernolist.ToString(), delSernoList); ent.deleteAll(sConditions); APConfig.SweetAlert(ShowBoxType.alert, "刪除完成"); this.Close(); } catch (Exception ex) { APConfig.SweetAlert(ShowBoxType.alert, string.Format("刪除失敗 {0}", ex.Message)); } }
private void btnInventoryDelete_Click(object sender, EventArgs e) { try { if (dgvInventory.SelectedRows.Count > 0) { List <string> sernolist = new List <string>(); string delSernoList = ""; foreach (DataGridViewRow row in dgvInventory.SelectedRows) { sernolist.Add(row.Cells["dgvInventory_Serno"].Value.ToString()); } delSernoList = APConfig.sqlArrayFormat(string.Join(",", sernolist)); using (var form = new PickInventoryDelete(mode.View, delSernoList)) { panelInventory.Visible = false; panelMask.Visible = true; var result = form.ShowDialog(); panelInventory.Visible = true; panelMask.Visible = false; } inventoryLoadData(ddlInventoryPage.SelectedIndex + 1); } } catch (Exception ex) { APConfig.SweetAlert(ShowBoxType.alert, string.Format("刪除失敗 {0}", ex.Message)); } }
public PickInventoryVendor(mode pmode, string pSernoList) { InitializeComponent(); mode = pmode; sernolist = APConfig.sqlArrayFormat(pSernoList); loadData(); }
public PickInventoryImport(string pSernoList) { InitializeComponent(); sernolist = string.IsNullOrEmpty(pSernoList) ? "" : APConfig.sqlArrayFormat(pSernoList); ItemSearch(); }
public PickInventoryReturn(string pSernoList) { InitializeComponent(); sernolist = string.IsNullOrEmpty(pSernoList) ? "" : APConfig.sqlArrayFormat(pSernoList); loadData(); }