protected void qc_tj(object sender, EventArgs e) { try { if (Context.Request["tj_pd"].ToString() == "tj_true") { QiChuModel buiness = new QiChuModel(); List <qi_chu_info> list_qc = new List <qi_chu_info>(); int row = Convert.ToInt32(Request.Form["row_i"].ToString()); for (int i = 1; i < row; i++) { if (Context.Request["cpid" + i] != null) { qi_chu_info qci = new qi_chu_info(); qci.Cpid = Request.Form["cpid" + i].ToString(); qci.Cpname = Request.Form["cpname" + i].ToString(); qci.Cplb = Request.Form["cplb" + i].ToString(); qci.Cpsj = Request.Form["cpsj" + i].ToString(); qci.Cpsl = Request.Form["cpsl" + i].ToString(); qci.zh_name = user.name; qci.gs_name = user.gongsi; qci.Shijian = DateTime.Now.ToString("yyyy-MM-dd"); list_qc.Add(qci); } } if (list_qc.Count > 0) { buiness.add_qichu(list_qc); } for (int i = 0; i < row_count; i++) { buiness.update_qichu(Context.Request["id" + i].ToString(), Context.Request["cpid_cs" + i].ToString(), Context.Request["cpname_cs" + i].ToString(), Context.Request["cplb_cs" + i].ToString(), Context.Request["cpsj_cs" + i].ToString(), Context.Request["cpsl_cs" + i].ToString()); } Response.Write(" <script>alert('提交成功'); location='qi_chu.aspx';</script>"); } } catch { Response.Write(" <script>alert('网络错误,请稍后再试!');</script>"); } }