private void DataGrid2_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { try { string strCount = ((TextBox)e.Item.Cells[8].Controls[0]).Text; if (this.JudgeIsNull(strCount, "数量")) { return; } if (!this.JudgeIsNum(strCount, "数量")) { return; } if (decimal.Parse(strCount) <= 0) { Popup("数量必需大于零"); return; } OrderBookDetail detail = new OrderBookDetail(); detail.cnnOrderSerialNo = decimal.Parse(txtOrderSerialNo.Text); detail.cnvcProductCode = e.Item.Cells[3].Text; detail.cnnOrderCount = decimal.Parse(((TextBox)e.Item.Cells[8].Controls[0]).Text); detail.cnvcOperID = oper.strLoginID; OperLog operLog = new OperLog(); operLog.cnvcOperID = oper.strLoginID; operLog.cnvcDeptID = oper.strDeptID; operLog.cnvcOperType = "订单修改产品"; OrderFacade order = new OrderFacade(); order.UpdateDetail(detail, operLog); Popup("修改成功"); this.DataGrid2.EditItemIndex = -1; BindDetail(txtOrderSerialNo.Text); } catch (Exception ex) { Popup(ex.Message); } }