コード例 #1
0
 private void MenuCancelSell_Click(object sender, EventArgs e)
 {
     if (this.lvSell.SelectedItems != null && this.lvSell.SelectedItems.Count > 0)
     {
         DialogResult dr = MessageBox.Show("将作废所选择的销售数据,请确认!", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (dr == DialogResult.OK)
         {
             foreach (ListViewItem lvi in this.lvSell.SelectedItems)
             {
                 Foundation.CancelSellNO(lvi.Tag.ToString());
                 //if (Foundation.CancelSellNO(lvi.Tag.ToString()))
                 //{
                 //    lvi.BackColor = Color.Red;
                 //    this.labelTotal.Text = (Convert.ToInt32(this.labelTotal.Text) - Convert.ToInt32(lvi.SubItems[9].Text)).ToString();
                 //    this.labelTotalCount.Text = (Convert.ToInt32(this.labelTotalCount.Text) - Convert.ToInt32(lvi.SubItems[6].Text)).ToString();
                 //}
             }
             tabControlSell_SelectedIndexChanged(null, null);
         }
     }
     else
     {
         MessageBox.Show("请选择要作废的销售数据", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }