protected void Button1_Click(object sender, EventArgs e) { if (hidsubmit.Value == "") { MessageBox("", "目的港不能为0个"); return; } if (hidsubmit.Value.Replace("qwerhjkl", "").Replace("sdfgyuio", "").Replace("0", "").Replace("1", "") == "") { MessageBox("", "目的港不能为0个"); return; } string[] strsubmitrow = Regex.Split(hidsubmit.Value, "sdfgyuio", new RegexOptions()); for (int k = 0; k < strsubmitrow.Length - 1; k++) { if (strsubmitrow[k].Substring(0, 8) == "qwerhjkl" && strsubmitrow[k] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl") { MessageBox("", "第" + Convert.ToString(k + 1) + "行的目的港不能为空"); return; } } if (txtTitle.Text == "") { MessageBox("", "标题不能为空"); } else if (BasicDatePicker1_TextBox.Value == "") { MessageBox("", "有效日期不能为空"); } else if (txtStart.Text == "") { MessageBox("", "启运港不能为空"); } else if (DropDownList1.Text == "请选择") { MessageBox("", "请选择航线"); } else { //try //{ string text = txtRemark.Value; text = text.Replace("\n", "<br>"); text = text.Replace(" ", " "); SqlParameter[] paras = new SqlParameter[21]; paras[0] = new SqlParameter("@PostDate", SqlDbType.SmallDateTime); paras[0].Value = DateTime.Now.ToString(); paras[1] = new SqlParameter("@DestPort", SqlDbType.NVarChar); paras[1].Value = ""; paras[2] = new SqlParameter("@StartPort", SqlDbType.NVarChar); paras[2].Value = check.CheckInput(txtStart.Text); paras[3] = new SqlParameter("@enddate", SqlDbType.NVarChar); paras[3].Value = check.CheckInput(BasicDatePicker1_TextBox.Value); paras[4] = new SqlParameter("@memo", SqlDbType.NText); paras[4].Value = text.Replace("'", "''"); paras[5] = new SqlParameter("@COMPANY", SqlDbType.NVarChar); paras[5].Value = ""; paras[6] = new SqlParameter("@AIRCOMPANY", SqlDbType.NVarChar); paras[6].Value = ""; paras[7] = new SqlParameter("@UserID", SqlDbType.Int); paras[7].Value = check.CheckNumber(Request.Cookies["user_id"].Value.ToString()); paras[8] = new SqlParameter("@title", SqlDbType.NVarChar, 50); paras[8].Value = check.CheckInput(txtTitle.Text); paras[9] = new SqlParameter("@attach", SqlDbType.NVarChar, 50); paras[9].Value = ""; paras[10] = new SqlParameter("@hits", SqlDbType.Int); paras[10].Value = 0; paras[11] = new SqlParameter("@LINE", SqlDbType.NVarChar, 50); paras[11].Value = check.CheckInput(DropDownList1.Text); paras[12] = new SqlParameter("@CompanyName", SqlDbType.NVarChar); paras[12].Value = ""; paras[13] = new SqlParameter("@CompanyAddr", SqlDbType.NVarChar); paras[13].Value = ""; paras[14] = new SqlParameter("@CompanyPhone", SqlDbType.NVarChar); paras[14].Value = ""; paras[15] = new SqlParameter("@CompanyFax", SqlDbType.NVarChar); paras[15].Value = ""; paras[16] = new SqlParameter("@CommuPerson", SqlDbType.NVarChar); paras[16].Value = ""; paras[17] = new SqlParameter("@email", SqlDbType.NVarChar); paras[17].Value = ""; paras[18] = new SqlParameter("@mobile", SqlDbType.NVarChar); paras[18].Value = ""; paras[19] = new SqlParameter("@UserID2", SqlDbType.Int); paras[19].Value = "0"; paras[20] = new SqlParameter("@id", SqlDbType.Int); paras[20].Direction = ParameterDirection.Output; int id = Convert.ToInt32(ExecoutID("Air_UP_brand_add", paras)); string strsubmit = hidsubmit.Value; string[] strarray = Regex.Split(strsubmit, "sdfgyuio", new RegexOptions()); int i; data_conn3 data_conn = new data_conn3(); SqlConnection conn = new SqlConnection(); conn = data_conn.mdb_conn(); conn.Open(); string value; string strSQL = ""; string[] strrow = new string[strarray.Length]; for (i = 0; i < strarray.Length - 1; i++) { if (strarray[i] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl") { strrow = Regex.Split(strarray[i], "qwerhjkl", RegexOptions.IgnoreCase); if (strrow[3] == "" && strrow[4] == "" && strrow[5] == "" && strrow[6] == "" && strrow[7] == "") { strrow[5] = "cable"; } value = check.CheckNumber(id.ToString()) + ",'" + check.CheckInput(strrow[0]) + "','" + check.CheckInput(strrow[1]) + "','" + check.CheckInput(strrow[2]) + "','" + check.CheckInput(strrow[3]) + "','" + check.CheckInput(strrow[4]) + "','" + check.CheckInput(strrow[5]) + "','" + check.CheckInput(strrow[6]) + "','" + check.CheckInput(strrow[7]) + "','" + check.CheckInput(strrow[8]) + "','" + check.CheckInput(strrow[9]) + "','" + check.CheckInput(strrow[10]) + "','" + check.CheckInput(strrow[11]) + "','" + check.CheckInput(txtTitle.Text) + "','" + check.CheckInput(txtStart.Text) + "','" + DateTime.Now + "','" + check.CheckInput(BasicDatePicker1_TextBox.Value) + "','" + check.CheckInput(DropDownList1.Text) + "'," + check.CheckNumber(Request.Cookies["user_id"].Value.ToString()); strSQL += "insert into T_AIRPRICE (AIRID,DestPort,PRICE_M,PRICE_N,PRICE_P45,PRICE_P100,PRICE_P300,PRICE_P500,PRICE_P1000,price20gpAppend,Distance,DepartureWkd,memo,Titlex,StartPortx,PostDatex,enddatex,linex,UserIDx) values (" + value + ");"; } } strSQL += "update T_AIRINFO set DestPort1='" + check.CheckInput(strrow[0]) + "',PRICE_M1='" + check.CheckInput(strrow[1]) + "',PRICE_N1='" + check.CheckInput(strrow[2]) + "',PRICE_P451='" + check.CheckInput(strrow[3]) + "',PRICE_P1001='" + check.CheckInput(strrow[4]) + "',PRICE_P3001='" + check.CheckInput(strrow[5]) + "',PRICE_P5001='" + check.CheckInput(strrow[6]) + "',PRICE_P10001='" + check.CheckInput(strrow[7]) + "' where id=" + id.ToString() + ";"; strSQL += "UPDATE TB_PRICECOUNT SET TB_PRICECOUNT.aircount = (SELECT COUNT(t_airinfo.id) AS yunjiacount FROM t_airinfo,t_airprice WHERE t_airinfo.id = t_airprice.airid),TB_PRICECOUNT.countdate = getdate() where TB_PRICECOUNT.cid = 1"; SqlCommand myCommand1 = new SqlCommand(strSQL, conn); myCommand1.ExecuteNonQuery(); conn.Close(); topnew tp = new topnew(); tp.SetTopNew(id.ToString(), check.CheckInput(txtTitle.Text), DateTime.Now.ToString(), "10", check.CheckInput(DropDownList1.Text), check.CheckInput(txtStart.Text.Replace("'", "''")), check.CheckNumber(Request.Cookies["user_id"].Value.ToString())); //Server.Transfer("ReleaseSucceed.aspx?id=" + id.ToString() + "&type=1"); Server.Transfer("office_air_list.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { if (WordsIScn(hidsubmit.Value) || WordsIScn(txtTitle.Text) || WordsIScn(txtStart.Text) || WordsIScn(txtRemark.Value)) { MessageBox("", "发布英文运价时,除了标题备注,不能出现中文"); return; } if (hidsubmit.Value == "") { MessageBox("", "目的港不能为0个"); return; } if (hidsubmit.Value.Replace("qwerhjkl", "").Replace("sdfgyuio", "").Replace("0", "").Replace("1", "") == "") { MessageBox("", "目的港不能为0个"); return; } string[] strsubmitrow = Regex.Split(hidsubmit.Value, "sdfgyuio", new RegexOptions()); for (int k = 0; k < strsubmitrow.Length - 1; k++) { if (strsubmitrow[k].Substring(0, 8) == "qwerhjkl" && (strsubmitrow[k] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl" && strsubmitrow[k] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl")) { MessageBox("", "第" + Convert.ToString(k + 1) + "行的目的港不能为空"); return; } string[] strrow = Regex.Split(strsubmitrow[k], "qwerhjkl", new RegexOptions()); if (strrow[8] == "" && (strsubmitrow[k] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl" && strsubmitrow[k] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl")) { MessageBox("", "第" + Convert.ToString(k + 1) + "行的船公司不能为空"); return; } } if (txtTitle.Text == "") { MessageBox("", "标题不能为空"); } else if (BasicDatePicker1_TextBox.Value == "") { MessageBox("", "有效日期不能为空"); } else if (txtStart.Text == "") { MessageBox("", "启运港不能为空"); } else if (DropDownList1.SelectedValue == "") { MessageBox("", "请选择航线"); } else { //try //{ string text = txtRemark.Value; text = text.Replace("\n", "<br>"); text = text.Replace(" ", " "); SqlParameter[] paras = new SqlParameter[29]; paras[0] = new SqlParameter("@UserID", SqlDbType.Int); paras[0].Value = check.CheckNumber(Request.Cookies["user_id"].Value.ToString()); paras[1] = new SqlParameter("@title", SqlDbType.NVarChar, 50); paras[1].Value = check.CheckInput(txtTitle.Text); paras[2] = new SqlParameter("@PostDate", SqlDbType.SmallDateTime); paras[2].Value = DateTime.Now.ToString(); paras[3] = new SqlParameter("@enddate", SqlDbType.SmallDateTime); paras[3].Value = check.CheckInput(BasicDatePicker1_TextBox.Value); paras[4] = new SqlParameter("@yunjialeixing", SqlDbType.Int); paras[4].Value = 8; paras[5] = new SqlParameter("@hangxianmiaoshu", SqlDbType.NVarChar, 255); paras[5].Value = check.CheckInput(DropDownList1.SelectedValue); paras[6] = new SqlParameter("@StartPort", SqlDbType.NVarChar, 50); paras[6].Value = check.CheckInput(txtStart.Text.Replace("'", "''")); paras[7] = new SqlParameter("@DestPort", SqlDbType.NVarChar); paras[7].Value = ""; paras[8] = new SqlParameter("@zhuangxiangchangdi", SqlDbType.NVarChar); paras[8].Value = ""; paras[9] = new SqlParameter("@baozhuangyaoqiu", SqlDbType.NVarChar); paras[9].Value = ""; paras[10] = new SqlParameter("@PriceDesc", SqlDbType.NText); paras[10].Value = ""; paras[11] = new SqlParameter("@memo", SqlDbType.NText); paras[11].Value = text.Replace("'", "''"); paras[12] = new SqlParameter("@fujiandizhi", SqlDbType.NVarChar); paras[12].Value = ""; paras[13] = new SqlParameter("@ifpass", SqlDbType.Int); paras[13].Value = 0; paras[14] = new SqlParameter("@hits", SqlDbType.Int); paras[14].Value = 0; paras[15] = new SqlParameter("@OnTop", SqlDbType.Int); paras[15].Value = 0; paras[16] = new SqlParameter("@supportspecial", SqlDbType.Bit); paras[16].Value = false; paras[17] = new SqlParameter("@specialdesc", SqlDbType.NVarChar); paras[17].Value = ""; paras[18] = new SqlParameter("@CompanyName", SqlDbType.NVarChar); paras[18].Value = ""; paras[19] = new SqlParameter("@CompanyAddr", SqlDbType.NVarChar); paras[19].Value = ""; paras[20] = new SqlParameter("@CompanyPhone", SqlDbType.NVarChar); paras[20].Value = ""; paras[21] = new SqlParameter("@CompanyFax", SqlDbType.NVarChar); paras[21].Value = ""; paras[22] = new SqlParameter("@CommuPerson", SqlDbType.NVarChar); paras[22].Value = ""; paras[23] = new SqlParameter("@email", SqlDbType.NVarChar); paras[23].Value = ""; paras[24] = new SqlParameter("@mobile", SqlDbType.NVarChar); paras[24].Value = ""; paras[25] = new SqlParameter("@entitle", SqlDbType.NVarChar, 200); paras[25].Value = check.CheckInput(txtTitle.Text); paras[26] = new SqlParameter("@enmemo", SqlDbType.NText); paras[26].Value = check.CheckInput(txtRemark.Value); paras[27] = new SqlParameter("@ifen", SqlDbType.Int); paras[27].Value = 1; paras[28] = new SqlParameter("@id", SqlDbType.Int); paras[28].Direction = ParameterDirection.Output; int id = Convert.ToInt32(ExecoutID("UP_brand_add", paras)); string strsubmit = hidsubmit.Value; string[] strarray = Regex.Split(strsubmit, "sdfgyuio", new RegexOptions()); int i; data_conn3 data_conn = new data_conn3(); SqlConnection conn = new SqlConnection(); conn = data_conn.mdb_conn(); conn.Open(); string value; string strSQL = ""; string[] strrow = new string[strarray.Length]; for (i = 0; i < strarray.Length - 1; i++) { if (strarray[i] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl" && strarray[i] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl") { strrow = Regex.Split(strarray[i], "qwerhjkl", RegexOptions.IgnoreCase); value = check.CheckNumber(id.ToString()) + ",'" + check.CheckInput(strrow[0]) + "','" + check.CheckInput(strrow[1]) + "','" + check.CheckInput(strrow[2]) + "','" + check.CheckInput(strrow[3]) + "','" + check.CheckInput(strrow[4]) + "','" + check.CheckInput(strrow[5]) + "','" + check.CheckInput(strrow[6]) + "','" + check.CheckInput(strrow[7]) + "','" + check.CheckInput(strrow[8]) + "','" + check.CheckInput(strrow[9]) + "','" + check.CheckInput(txtTitle.Text) + "','" + check.CheckInput(txtStart.Text) + "','" + DateTime.Now + "','" + check.CheckInput(BasicDatePicker1_TextBox.Value) + "',8,'" + check.CheckInput(DropDownList1.SelectedValue) + "'," + check.CheckNumber(Request.Cookies["user_id"].Value.ToString()) + ",'" + check.CheckInput(txtTitle.Text) + "',1"; strSQL += "insert into TB_YunJiaInfo (YunJiaID,DestPort,price20gp,price40gp,price40hq,price45hq,price20gpAppend,Distance,DepartureWkd,shipcompany,memo,Titlex,StartPortx,PostDatex,enddatex,yunjialeixingx,hangxianmiaoshux,UserIDx,entitlex,ifEnx) values (" + value + ");"; } } strSQL += "update TB_YunJia set DestPort1='" + check.CheckInput(strrow[0]) + "',price20gp1='" + check.CheckInput(strrow[1]) + "',price40gp1='" + check.CheckInput(strrow[2]) + "',price40hq1='" + check.CheckInput(strrow[3]) + "',price45hq1='" + check.CheckInput(strrow[4]) + "',shipcompany1='" + check.CheckInput(strrow[8]) + "' where id=" + id.ToString() + ";"; strSQL += "UPDATE TB_PRICECOUNT SET TB_PRICECOUNT.fclcount = (SELECT COUNT(tb_yunjia.id) AS yunjiacount FROM tb_yunjia,tb_yunjiainfo WHERE (tb_yunjia.yunjialeixing = 8) AND tb_yunjia.id = tb_yunjiainfo.yunjiaid),TB_PRICECOUNT.countdate = getdate() where TB_PRICECOUNT.cid = 1;"; SqlCommand myCommand1 = new SqlCommand(strSQL, conn); myCommand1.ExecuteNonQuery(); conn.Close(); topnew tp = new topnew(); tp.SetTopNew(id.ToString(), check.CheckInput(txtTitle.Text), DateTime.Now.ToString(), "8", check.CheckInput(DropDownList1.SelectedValue), check.CheckInput(txtStart.Text.Replace("'", "''")), check.CheckNumber(Request.Cookies["user_id"].Value.ToString())); Response.Redirect("office_fcl_list.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { if (WordsIScn(hidsubmit.Value) || WordsIScn(txtTitle.Text) || WordsIScn(txtStart.Text) || WordsIScn(txtRemark.Value)) { MessageBox("", "发布英文运价时,除了标题备注,不能出现中文"); return; } if (hidsubmit.Value == "") { MessageBox("", "目的港不能为0个"); return; } if (hidsubmit.Value.Replace("qwerhjkl", "").Replace("sdfgyuio", "").Replace("0", "").Replace("1", "") == "") { MessageBox("", "目的港不能为0个"); return; } string[] strsubmitrow = Regex.Split(hidsubmit.Value, "sdfgyuio", new RegexOptions()); for (int k = 0; k < strsubmitrow.Length - 1; k++) { if (strsubmitrow[k].Substring(0, 8) == "qwerhjkl" && strsubmitrow[k] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl" ) { MessageBox("", "第" + Convert.ToString(k + 1) + "行的目的港不能为空"); return; } } if (txtTitle.Text == "") { MessageBox("", "标题不能为空"); } else if (BasicDatePicker1_TextBox.Value == "") { MessageBox("", "有效日期不能为空"); } else if (txtStart.Text == "") { MessageBox("", "启运港不能为空"); } else if (DropDownList1.Text == "请选择") { MessageBox("", "请选择航线"); } else { string strSql; string meno = check.CheckInput(txtRemark.Value); meno = meno.Replace("\n", "<br>"); meno = meno.Replace(" ", " "); data_conn3 data_conn = new data_conn3(); SqlConnection conn = new SqlConnection(); conn = data_conn.mdb_conn(); conn.Open(); strSql = "update T_AIRINFO set entitle='" + check.CheckInput(txtTitle.Text.Replace("'", "''")) + "',title='" + check.CheckInput(txtTitle.Text.Replace("'", "''")) + "',enddate='" + check.CheckInput(BasicDatePicker1_TextBox.Value.Replace("'", "''")) + "',StartPort='" + check.CheckInput(txtStart.Text.Replace("'", "''")) + "',line='" + check.CheckInput(DropDownList1.SelectedValue.Replace("'", "''")) + "',enmemo='" + meno.Replace("'", "''") + "',memo='" + meno.Replace("'", "''") + "',PostDate='" + DateTime.Now.ToString().Replace("'", "''") + "',updateTimes=updateTimes+1 where id=" + check.CheckNumber(Request["id"]); SqlCommand myCommand = new SqlCommand(strSql, conn); myCommand.ExecuteNonQuery(); myCommand.CommandText = "delete from T_AIRPRICE where AIRID=" + check.CheckNumber(Request["id"]); myCommand.ExecuteNonQuery(); string strsubmit = hidsubmit.Value; string[] strarray = Regex.Split(strsubmit, "sdfgyuio", new RegexOptions()); strSql = ""; string value; string[] strrow = new string[strarray.Length]; for (int i = 0; i < strarray.Length - 1; i++) { if (strarray[i] != "qwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjklqwerhjkl") { strrow = Regex.Split(strarray[i], "qwerhjkl", new RegexOptions()); value = check.CheckNumber(Request["id"]) + ",'" + check.CheckInput(strrow[0]) + "','" + check.CheckInput(strrow[1]) + "','" + check.CheckInput(strrow[2]) + "','" + check.CheckInput(strrow[3]) + "','" + check.CheckInput(strrow[4]) + "','" + check.CheckInput(strrow[5]) + "','" + check.CheckInput(strrow[6]) + "','" + check.CheckInput(strrow[7]) + "','" + check.CheckInput(strrow[8]) + "','" + check.CheckInput(strrow[9]) + "','" + check.CheckInput(strrow[10]) + "','" + check.CheckInput(strrow[11]) + "','" + check.CheckInput(txtTitle.Text.Replace("'", "''")) + "','" + check.CheckInput(txtStart.Text) + "','" + DateTime.Now.ToString().Replace("'", "''") + "','" + check.CheckInput(BasicDatePicker1_TextBox.Value.Replace("'", "''")) + "','" + check.CheckInput(DropDownList1.Text.Replace("'", "''")) + "'," + check.CheckNumber(Request.Cookies["user_id"].Value.ToString()) + ",'" + check.CheckInput(txtTitle.Text) + "',1"; strSql += "insert into T_AIRPRICE (AIRID,DestPort,PRICE_M,PRICE_N,PRICE_P45,PRICE_P100,PRICE_P300,PRICE_P500,PRICE_P1000,price20gpAppend,Distance,DepartureWkd,memo,Titlex,StartPortx,PostDatex,enddatex,linex,UserIDx,entitlex,ifEnx) values (" + value + ");"; } } strSql += "update T_AIRINFO set DestPort1='" + check.CheckInput(strrow[0]) + "',PRICE_M1='" + check.CheckInput(strrow[1]) + "',PRICE_N1='" + check.CheckInput(strrow[2]) + "',PRICE_P451='" + check.CheckInput(strrow[3]) + "',PRICE_P1001='" + check.CheckInput(strrow[4]) + "',PRICE_P3001='" + check.CheckInput(strrow[5]) + "',PRICE_P5001='" + check.CheckInput(strrow[6]) + "',PRICE_P10001='" + check.CheckInput(strrow[7]) + "' where id=" + Request["id"].ToString() + ";"; strSql += "UPDATE TB_PRICECOUNT SET TB_PRICECOUNT.aircount = (SELECT COUNT(t_airinfo.id) AS yunjiacount FROM t_airinfo,t_airprice WHERE t_airinfo.id = t_airprice.airid),TB_PRICECOUNT.countdate = getdate() where TB_PRICECOUNT.cid = 1"; SqlCommand myCommand1 = new SqlCommand(strSql, conn); myCommand1.ExecuteNonQuery(); conn.Close(); topnew tp = new topnew(); tp.SetTopNew(check.CheckNumber(Request["id"]), check.CheckInput(txtTitle.Text.Replace("'", "''")), DateTime.Now.ToString(), "10", check.CheckInput(DropDownList1.Text.Replace("'", "''")), check.CheckInput(txtStart.Text.Replace("'", "''")), check.CheckNumber(Request.Cookies["user_id"].Value.ToString())); Response.Redirect("office_air_list.aspx"); } }