private void btnOK_Click(object sender, EventArgs e) { if (this.lvSell.Items.Count < 1) { return; } GoodsSelledEventArgs ee = new GoodsSelledEventArgs(); OrderNO = Foundation.GetNewOrderNO(); SellDataTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); foreach (ListViewItem lvi in this.lvSell.Items) { Sell sell = new Sell(); sell.OrderNO = OrderNO; sell.GoodsNO = Convert.ToInt32(lvi.Tag.ToString()); sell.OutTime = SellDataTime; sell.OutCount = Convert.ToInt32(lvi.SubItems[3].Text); sell.OutPrice = Convert.ToDecimal(lvi.SubItems[4].Text); sell.Remarks = lvi.SubItems[8].Text; if (sell.Save()) { //ee.listSellNO.Add(sell.SellNO); ee.SellTime = SellDataTime; } } if (GoodsSelled != null) { GoodsSelled(null, ee); } if (this.cbbPrint.Checked) { PrintData(); } //iStatIn = 0; //this.txtReturnOut.Text = "0"; //this.numTrueIN.Value = 0; //this.txtStatIn.Text = iStatIn.ToString(); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }