protected void btnCredits_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); check ck = new check(); string order_code = ck.CheckInput(txtCode.Text); string credits = ck.CheckInput(txtCredits.Text); pro_data_conn cn = new pro_data_conn(); string sql = ""; sql += "UPDATE TB_ORDER_ACCOUNT SET credit = " + credits + " WHERE userid = '" + order_code + "'"; cn.mdb_exe(sql); LoadListData(); }
protected void SetOrderStatus(string status) { System.Threading.Thread.Sleep(2000); check ck = new check(); string order_code = ck.CheckInput(txtCode.Text); pro_data_conn cn = new pro_data_conn(); string sql = ""; sql += "UPDATE TB_ORDER SET order_status = " + status + " WHERE order_code = '" + order_code + "'"; cn.mdb_exe(sql); LoadListData(); }
protected void SetOrderDetail(string a,string c1,string c2) { //a是行为的角色,1为货主,2为货代,0为系统 //c1是操作之前的状态号 //c2是操作之后的状态号码 //数组中参数{1}将被具体角色替换,{1}将被货主公司名替换,{2}将被货代公司名替换 check ck = new check(); string order_code = ck.CheckInput(txtCode.Text); string[] op_array = new string[29]; op_array[0] = "1|0|1|订舱方 {1} 保存订单"; op_array[1] = "1|0|2|订舱方 {1} 提交订舱单,等待承运方答复"; op_array[2] = "1|1|2|订舱方 {1} 提交订舱单,等待承运方答复"; op_array[3] = "2|2|3|承运方 {2} 接受订舱"; op_array[4] = "2|2|6|承运方 {2} 不接受订舱,申请系统审核"; op_array[5] = "2|6|2|承运方 {2} 取消不接受订舱"; op_array[6] = "0|6|11|系统通过了承运方 {2} 的不接受订舱申请,该订单作废"; op_array[7] = "0|6|2|系统未通过承运方 {2} 的不接受订舱申请,该订单恢复原状态"; op_array[8] = "1|12|2|订舱方 {1} 恢复了该订舱单,重新等待承运方答复"; op_array[9] = "1|2|7|订舱方 {1} 撤消了该订舱单"; op_array[10] = "1|7|2|订舱方 {1} 取消撤消该订舱单,重新等待承运方答复"; op_array[11] = "0|7|12|系统通过了订舱方 {1} 的撤消订舱申请,该订单作废"; op_array[12] = "0|7|2|系统未通过订舱方 {1} 的撤消订舱申请,该订单恢复原状态"; op_array[13] = "1|12|2|订舱方 {1} 恢复了该订舱单,重新等待承运方答复"; op_array[14] = "1|3|4|订舱方 {1} 确认出运"; op_array[15] = "1|3|8|订舱方 {1} 撤消了该订舱单"; op_array[16] = "1|8|3|订舱方 {1} 取消撤消该订舱单,重新等待承运方答复"; op_array[17] = "0|8|13|系统通过了订舱方 {1} 的撤消订舱申请,该订单作废"; op_array[18] = "0|8|3|系统未通过订舱方 {1} 的撤消订舱申请,该订单恢复原状态"; op_array[19] = "1|13|8|订舱方 {1} 恢复了该订舱单,重新等待承运方答复"; op_array[20] = "2|3|5|承运方 {2} 确认出运,交易结束"; op_array[21] = "2|4|5|承运方 {2} 同意完成,交易结束"; op_array[22] = "1|4|9|订舱方 {1} 撤消了该订舱单"; op_array[23] = "1|9|4|订舱方 {1} 取消撤消该订舱单,重新等待承运方答复"; op_array[24] = "0|9|14|系统通过了订舱方 {1} 的撤消订舱申请,该订单作废"; op_array[25] = "0|9|4|系统未通过订舱方 {1} 的撤消订舱申请,该订单恢复原状态"; op_array[26] = "1|14|9|订舱方 {1} 恢复了该订舱单,重新等待承运方答复"; op_array[27] = "1|1|10|订舱方 {1} 删除该订舱单"; op_array[28] = "1|10|1|订舱方 {1} 恢复该订舱单"; string detail_txt = ""; for (int i = 0; i < op_array.Length; i++) { if (a == op_array[i].Split('|')[0].ToString() & c1 == op_array[i].Split('|')[1].ToString() & c2 == op_array[i].Split('|')[2].ToString()) { detail_txt = op_array[i].Split('|')[3].ToString(); } }//确认当前的状态数组 string sql = ""; sql += "SELECT "; sql += "TB_ORDER.date_create, "; sql += "TB_ORDER.order_code, "; sql += "UA.userid AS aid, "; sql += "UB.userid AS bid, "; sql += "UA.CompanyName AS aname, "; sql += "UB.CompanyName AS bname "; sql += "FROM TB_ORDER,TB_USER UA,TB_USER UB "; sql += "WHERE 1=1 "; sql += "AND TB_ORDER.order_shipper = UA.userid "; sql += "AND TB_ORDER.order_forward = UB.userid "; sql += "AND TB_ORDER.order_code = '" + order_code + "'"; pro_data_conn cn = new pro_data_conn(); DataSet ds = new DataSet(); ds = cn.mdb_ds(sql, "order"); detail_txt = detail_txt.Replace("{1}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["aid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["aname"].ToString() + "</a>"); detail_txt = detail_txt.Replace("{2}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["bid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["bname"].ToString() + "</a>"); sql = "INSERT INTO TB_ORDER_DETAIL (order_code,detail_txt,detail_date) VALUES ('" + order_code + "','" + detail_txt + "',GetDate())"; cn.mdb_exe(sql); if (c2 == "5") { sql = "SELECT * FROM TB_ORDER WHERE order_code = '" + order_code + "'"; DataSet ds1 = new DataSet(); ds1 = cn.mdb_ds(sql, "account"); double base_fee = 0; base_fee = Convert.ToDouble(ds1.Tables["account"].Rows[0]["container_20gp"].ToString()) * 150; base_fee += Convert.ToDouble(ds1.Tables["account"].Rows[0]["container_40gp"].ToString()) * 150; base_fee += Convert.ToDouble(ds1.Tables["account"].Rows[0]["container_40hq"].ToString()) * 150; sql = "UPDATE TB_ORDER_ACCOUNT SET credit = credit + " + base_fee + " WHERE userid = " + ds.Tables["order"].Rows[0]["aid"].ToString(); cn.mdb_exe(sql); sql = "UPDATE TB_ORDER_ACCOUNT SET credit = credit - " + base_fee * 2 + " WHERE userid = " + ds.Tables["order"].Rows[0]["bid"].ToString(); cn.mdb_exe(sql); } }
protected void Button1_Click(object sender, EventArgs e) { check ck = new check(); pro_data_conn cn = new pro_data_conn(); DataSet ds = new DataSet(); string sql = ""; string order_status = "1"; string order_code = ltrGongZuoBianHao.Text; string order_shipper = ck.CheckNumber(GetRequestCookies("user_id", "0")); string order_forward = ck.CheckNumber(ltrUserid.Text); string shipper_name = ck.CheckInput(txtShipperName.Value); string cargo_name = ck.CheckInput(txtCargoName.Value); string measurement = ck.CheckInput(txtMeasurement.Value); string carrier_name = ck.CheckInput(ltrCarrier.Text); string startport = ck.CheckInput(ltrStartPort.Text); string destport = ck.CheckInput(ltrDestPort.Text); string container_20gp = ck.CheckNumber(txtContainer_20gp.Value); string container_40gp = ck.CheckNumber(txtContainer_40gp.Value); string container_40hq = ck.CheckNumber(txtContainer_40hq.Value); string freight_type = "8"; string freight_code = ltrYid2.Text; sql += "INSERT INTO TB_ORDER "; sql += "( "; sql += "date_create, "; sql += "order_status, "; sql += "order_code, "; sql += "order_shipper, "; sql += "order_forward, "; sql += "shipper_name, "; sql += "cargo_name, "; sql += "measurement, "; sql += "carrier_name, "; sql += "startport, "; sql += "destport, "; sql += "container_20gp, "; sql += "container_40gp, "; sql += "container_40hq, "; sql += "freight_type, "; sql += "freight_code "; sql += ") "; sql += "VALUES "; sql += "( "; sql += "GetDate(), "; sql += "" + order_status + ", "; sql += "'" + order_code + "', "; sql += "" + order_shipper + ", "; sql += "" + order_forward + ", "; sql += "'" + shipper_name + "', "; sql += "'" + cargo_name + "', "; sql += "'" + measurement + "', "; sql += "'" + carrier_name + "', "; sql += "'" + startport + "', "; sql += "'" + destport + "', "; sql += "" + container_20gp + ", "; sql += "" + container_40gp + ", "; sql += "" + container_40hq + ", "; sql += "" + freight_type + ", "; sql += "" + freight_code + " "; sql += ") "; //Response.Write(sql); cn.mdb_exe(sql); Response.Redirect("success.aspx"); }