示例#1
0
        /// <summary>
        /// 勾选项导出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnExportCheck_OnClick(object sender, EventArgs e)
        {
            string array_lotnum = "";

            foreach (GridViewRow grow in GridView1.Rows)
            {
                CheckBox ckb = (CheckBox)grow.FindControl("CheckBox1");
                if (ckb.Checked)
                {
                    array_lotnum += "'" + grow.Cells[1].Text.Trim() + "',";
                }
            }

            if (array_lotnum == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('请勾选要导出的批号!!!');", true);
            }
            else if (array_lotnum.Split(',').Length > 1)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('请逐条勾导出!!!');", true);
            }
            else
            {
                array_lotnum = array_lotnum.Substring(0, array_lotnum.Length - 1);
                ExportTMDataFromDB.ExportMSData(array_lotnum, array_lotnum.Split('.')[1]);
            }
        }
示例#2
0
 /// <summary>
 /// 导出制作明细表
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnMsExport_OnClick(object sender, EventArgs e)
 {
     if (ddlLotNumList.SelectedIndex != 0)
     {
         ExportTMDataFromDB.ExportMSData(ddlLotNumList.SelectedValue, tsaid.Text);
     }
     else
     {
         this.ClientScript.RegisterStartupScript(GetType(), "js", "alert('按批号导出,请选择批号!!!');self.close();", true);
     }
 }