/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { int n = dataGridView1.SelectedRows.Count; if (n == 0) { MessageDialog.ShowPromptMessage("请选择需要删除的数据行!"); } else { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { int id = Convert.ToInt32(dataGridView1.SelectedRows[i].Cells[0].Value); string info = string.Format("您是否确定要删除 [{0}] 物品基础物品信息?", dataGridView1.SelectedRows[i].Cells[2].Value.ToString()); if (MessageDialog.ShowEnquiryMessage(info) == DialogResult.Yes) { if (!m_basicGoodsServer.DeleteGoods(id, out m_findGoodsPlanCost, out m_err)) { MessageDialog.ShowPromptMessage(m_err); return; } } } } RefreshDataGridView(m_findGoodsPlanCost); RefreshControl(); }
/// <summary> /// 删除计划价格 /// </summary> /// <param name="planCost">要删除的记录</param> private void DeletePlanPrice(View_F_GoodsPlanCost planCost) { if (planCost.录入员编码 == BasicInfo.LoginID && planCost.日期 == ServerTime.Time.Date) { if (!m_planCostServer.DeleteGoods(planCost.序号, out m_strErr)) { MessageDialog.ShowErrorMessage(m_strErr); } } }