private void btnDmgImport_Click(object sender, EventArgs e) { foreach (DataRow dr in damageEx.Rows) { try { string containerid = bll.GetContainerId(dr["CONTAINERNO"].ToString()); CtosResult result = OCR.BLL.CtosAPIBLL.OP007095(containerid, dr["DMGCODE"].ToString(), string.Format("{0} {1}", dr["DMGMEMO"].ToString(), dr["DMGSIZE"].ToString()), MainBLL.Parms.TICKETID); if (result.ERRORCODE != "0") { throw new Exception(result.ERRORMSG); } } catch (Exception ex) { MessageBox.Show(string.Format("导入残损信息失败:{0} dockid:{1}.EXCEPTION:{2}", dr["CONTAINERNO"].ToString(), dr["DOCKID"].ToString()), ex.Message); } } }