public void SaveRecord(int q) { check ck = new check(); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string u = ck.CheckNumber(GetRequestCookies("user_id", "0")); string f = ck.CheckNumber(GetRequestQueryString("f", "0")); string yid = ck.CheckNumber(GetRequestQueryString("yid", "0")); string ydid = ck.CheckNumber(GetRequestQueryString("ydid", "0")); string sql = ""; string qgp = "0"; string price20gp = "0"; string price40gp = "0"; string price40hq = "0"; string price45hq = "0"; double yf = 0; double xxf = 0; price20gp = ck.CheckNumber(ltrFreightGP.Text); price40gp = ck.CheckNumber(ltrFreightGPV.Text); qgp = ck.CheckNumber(txtgp.Value); //yf += Convert.ToDouble(q20gp) * Convert.ToDouble(price20gp); //yf += Convert.ToDouble(q40gp) * Convert.ToDouble(price40gp); //yf += Convert.ToDouble(q40hq) * Convert.ToDouble(price40hq); //yf += Convert.ToDouble(q45hq) * Convert.ToDouble(price45hq); if (Convert.ToInt32(ck.CheckNumber(txtGrossWeight.Value)) > Convert.ToInt32(ck.CheckNumber(txtMeasurement.Value))) { yf += Convert.ToDouble(qgp) * Convert.ToDouble(price20gp); } else { yf += Convert.ToDouble(qgp) * Convert.ToDouble(price40gp); } xxf += 500; sql = ""; sql += "INSERT INTO TB_ORDER "; sql += "( "; sql += "date_create, "; sql += "order_status, "; sql += "order_code, "; sql += "order_shipper, "; sql += "order_forward, "; sql += "freight_type, "; sql += "freight_code, "; sql += "freight_code1, "; sql += "Shipper, "; sql += "Consignee, "; sql += "NotifyParty, "; sql += "CompanyName, "; sql += "Email, "; sql += "Contactor, "; sql += "Mobile, "; sql += "Tel, "; sql += "Fax, "; sql += "startport, "; sql += "midport, "; sql += "destport, "; sql += "MarksNumbers, "; sql += "NumbersofPackages, "; sql += "Description, "; sql += "GrossWeight, "; sql += "Measurement, "; sql += "kaihangri, "; sql += "jieshuri, "; sql += "carrier_name, "; sql += "zhuangxiangri, "; sql += "jieguanri, "; sql += "yf, "; sql += "xxf, "; sql += "lcl_cbm, "; sql += "pricegp, "; sql += "pricegpv, "; sql += "price20gpAppend, "; sql += "price_title, "; sql += "price_PostDate, "; sql += "price_enddate, "; sql += "price_companyname, "; sql += "price_shipcompany, "; sql += "price_hangxianmiaoshu, "; sql += "price_StartPort, "; sql += "price_DestPort, "; sql += "price_assurance_space, "; sql += "price_star_allin, "; sql += "price_star_user, "; sql += "beizhu "; sql += ") "; sql += "VALUES "; sql += "( "; sql += "GetDate(), "; sql += "" + q + ", "; sql += "'" + ck.CheckInput(txtCode.Value) + "', "; sql += "" + u + ", "; sql += "" + f + ", "; sql += "9, "; sql += "" + yid + ", "; sql += "" + ydid + ", "; sql += "'" + ck.CheckInput(txtShipper.Value) + "', "; sql += "'" + ck.CheckInput(txtConsignee.Value) + "', "; sql += "'" + ck.CheckInput(txtNotifyParty.Value) + "', "; sql += "'" + ck.CheckInput(txtCompanyName.Value) + "', "; sql += "'" + ck.CheckInput(txtEmail.Value) + "', "; sql += "'" + ck.CheckInput(txtContactor.Value) + "', "; sql += "'" + ck.CheckInput(txtMobile.Value) + "', "; sql += "'" + ck.CheckInput(txtTel.Value) + "', "; sql += "'" + ck.CheckInput(txtFax.Value) + "', "; sql += "'" + ck.CheckInput(txtstartport.Value) + "', "; sql += "'" + ck.CheckInput(txtmidport.Value) + "', "; sql += "'" + ck.CheckInput(txtdestport.Value) + "', "; sql += "'" + ck.CheckInput(txtMarksNumbers.Value) + "', "; sql += "'" + ck.CheckInput(txtNumbersofPackages.Value) + "', "; sql += "'" + ck.CheckInput(txtDescription.Value) + "', "; sql += "'" + ck.CheckInput(txtGrossWeight.Value) + "', "; sql += "'" + ck.CheckInput(txtMeasurement.Value) + "', "; sql += "'" + ck.CheckInput(txtkaihangri.Value) + "', "; sql += "'" + ck.CheckInput(ltrEndDate.Text) + "', "; sql += "'" + ck.CheckInput(txtcarrier_name.Value) + "', "; sql += "'" + ck.CheckInput(txtzhuangxiangri.Value) + "', "; sql += "'" + ck.CheckInput(txtjieguanri.Value) + "', "; sql += "" + yf.ToString() + ", "; sql += "" + xxf.ToString() + ", "; sql += "" + qgp + ", "; sql += "'" + ck.CheckInput(ltrFreightGP.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightGPV.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightAppend.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightTitleHid.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightPostdateHid.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightEnddateHid.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightCompanyHid.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightCarrier.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightLine.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightStartport.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightDestport.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightAssuranceSpaceLevel.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightAllinStarHid.Text) + "', "; sql += "'" + ck.CheckInput(ltrFreightUserStarHid.Text) + "', "; sql += "'" + ck.CheckInput(txtbeizhu.Value) + "' "; sql += ") "; if (q == 3) { sql = ""; sql += "UPDATE TB_ORDER SET "; sql += "Shipper = '" + ck.CheckInput(txtShipper.Value) + "', "; sql += "Consignee = '" + ck.CheckInput(txtConsignee.Value) + "', "; sql += "NotifyParty = '" + ck.CheckInput(txtNotifyParty.Value) + "', "; sql += "CompanyName = '" + ck.CheckInput(txtCompanyName.Value) + "', "; sql += "Email = '" + ck.CheckInput(txtEmail.Value) + "', "; sql += "Contactor = '" + ck.CheckInput(txtContactor.Value) + "', "; sql += "Mobile = '" + ck.CheckInput(txtMobile.Value) + "', "; sql += "Tel = '" + ck.CheckInput(txtTel.Value) + "', "; sql += "Fax = '" + ck.CheckInput(txtFax.Value) + "', "; sql += "startport = '" + ck.CheckInput(txtstartport.Value) + "', "; sql += "midport = '" + ck.CheckInput(txtmidport.Value) + "', "; sql += "destport = '" + ck.CheckInput(txtdestport.Value) + "', "; sql += "MarksNumbers = '" + ck.CheckInput(txtMarksNumbers.Value) + "', "; sql += "NumbersofPackages = '" + ck.CheckInput(txtNumbersofPackages.Value) + "', "; sql += "Description = '" + ck.CheckInput(txtDescription.Value) + "', "; sql += "GrossWeight = '" + ck.CheckInput(txtGrossWeight.Value) + "', "; sql += "Measurement = '" + ck.CheckInput(txtMeasurement.Value) + "', "; sql += "kaihangri = '" + ck.CheckInput(txtkaihangri.Value) + "', "; sql += "carrier_name = '" + ck.CheckInput(txtcarrier_name.Value) + "', "; sql += "zhuangxiangri = '" + ck.CheckInput(txtzhuangxiangri.Value) + "', "; sql += "jieguanri = '" + ck.CheckInput(txtjieguanri.Value) + "', "; sql += "lcl_cbm = " + qgp + ", "; sql += "yf = " + yf + ", "; sql += "xxf = " + xxf + ", "; sql += "beizhu = '" + ck.CheckInput(txtbeizhu.Value) + "' "; sql += "WHERE order_code = '" + ck.CheckInput(txtCode.Value) + "' "; } //Response.Write(sql); cn.mdb_exe(sql); sql = ""; sql += "UPDATE TB_ORDER_ACCOUNT SET "; sql += "bank = '" + ck.CheckInput(txtbank.Value) + "', "; sql += "bankname = '" + ck.CheckInput(txtbankname.Value) + "', "; sql += "bankaccount = '" + ck.CheckInput(txtbankaccount.Value) + "', "; sql += "otheraccount = '" + ck.CheckInput(txtotheraccount.Value) + "' "; sql += "WHERE userid = " + u; //Response.Write(sql); cn.mdb_exe(sql); sql = ""; sql += "UPDATE TB_User SET "; sql += "ali_account = '" + ck.CheckInput(txtaliaccount.Value) + "' "; sql += "WHERE userid = " + u; //Response.Write(sql); cn.mdb_exe(sql); sql = "SELECT * FROM TB_User where userid = " + f; ds = cn.mdb_ds(sql, "user"); //Response.Write(sql); if (q == 2) { pm p = new pm(); string txt = ""; txt = "<a href=\"/company/" + setkey(u) + "/\" target=\"_blank\">" + ck.CheckInput(txtCompanyName.Value) + "</a>于" + DateTime.Now.ToString() + "给您发送了一份线上订舱委托书,订舱编号:<a href=\"/search/lcl_order.aspx?filter=view&role=forward&orderid=" + ck.CheckInput(txtCode.Value) + "\" target=\"_blank\">" + ck.CheckInput(txtCode.Value) + "</a> ,请您尽快答复,以免错失商机!"; p.sendpm("41", f, txt, "1"); txt = "您于" + DateTime.Now.ToString() + "给<a href=\"/company/" + setkey(f) + "/\" target=\"_blank\">" + ck.CheckInput(ds.Tables["user"].Rows[0]["companyname"].ToString()) + "</a>发送了一份线上订舱委托书,订舱编号:<a href=\"/search/lcl_order.aspx?filter=view&role=shipper&orderid=" + ck.CheckInput(txtCode.Value) + "\" target=\"_blank\">" + ck.CheckInput(txtCode.Value) + "</a>,目前状态为等待对方商户的答复。"; p.sendpm("41", u, txt, "1"); } if (q == 3) { pm p = new pm(); string txt = ""; txt = "<a href=\"/company/" + setkey(u) + "/\" target=\"_blank\">" + ck.CheckInput(txtCompanyName.Value) + "</a>修改了订单<a href=\"/search/lcl_order.aspx?filter=view&role=forward&orderid=" + txtCode.Value + "\" target=\"_blank\">" + ck.CheckInput(txtCode.Value) + "</a>,提醒您重新查看该订单!"; p.sendpm("41", txtPubf.Text, txt, "1"); } }
public void SetComplaints(string o,string c,string t) { check ck = new check(); data_conn cn = new data_conn(); DataSet ds = new DataSet(); o = ck.CheckInput(o); c = ck.CheckInput(c); t = ck.CheckNumber(t);//0是货主投诉货代,1是货代投诉货主 string[] odetail; odetail = GetOrderDetail(o); string user_shipper = odetail[3]; string user_forward = odetail[4]; string user_shipper_name = odetail[3]; string user_forward_name = odetail[4]; string sql = ""; if (t == "0") { sql = "INSERT INTO TB_ORDER_COMPLAINTS (order_code,userid,complaintsid,txt) VALUES ('" + o + "'," + user_forward + "," + user_shipper + ",'" + c + "')"; ds = cn.mdb_ds(sql, "order"); pm p = new pm(); p.sendpm("41", odetail[4], "在订单" + odetail[110] + "交易过程中," + odetail[107] + "对您进行投诉,内容如下:<br/>" + c, "1"); } if (t == "1") { sql = "INSERT INTO TB_ORDER_COMPLAINTS (order_code,userid,complaintsid,txt) VALUES ('" + o + "'," + user_shipper + "," + user_forward + ",'" + c + "')"; ds = cn.mdb_ds(sql, "order"); pm p = new pm(); p.sendpm("41", odetail[3], "在订单" + odetail[109] + "交易过程中," + odetail[102] + "对您进行投诉,内容如下:<br/>" + c, "1"); } }
public string SetOrderDetail(string a, string c1, string c2, string o,string r) { //a是行为的角色,1为货主,2为货代,0为系统 //o是订单号 //c1是操作之前的状态号 //c2是操作之后的状态号码 //数组中参数{x}将被具体角色替换,{1}将被货主公司名替换, //{2}将被货代公司名替换,{3}将被订单号替换,{4}将被操作时间替换, //{5}将被拒绝理由替换,{6}将被个人信息替换,{7}将被重新选择替换, //{8}货主信息费,{9}货代信息费 //r是拒绝订舱的理由 string returnValue = "null"; check ck = new check(); string reject = ck.CheckInput(r); string order_code = ck.CheckInput(o); string op_code = ""; string[] op_array = new string[30]; 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|7|承运方 {2} 不接受订舱,理由是 {5} ,申请系统审核"; op_array[5] = "2|7|2|承运方 {2} 取消不接受订舱"; op_array[6] = "0|7|12|系统通过了承运方 {2} 的不接受订舱申请,该订单作废"; op_array[7] = "0|7|2|系统未通过承运方 {2} 的不接受订舱申请,该订单恢复原状态"; op_array[8] = "1|13|2|订舱方 {1} 恢复了该订舱单,重新等待承运方答复"; op_array[9] = "1|2|8|订舱方 {1} 撤消了该订舱单"; op_array[10] = "1|8|2|订舱方 {1} 取消撤消该订舱单,重新等待承运方答复"; op_array[11] = "0|8|13|系统通过了订舱方 {1} 的撤消订舱申请,该订单作废"; op_array[12] = "0|8|2|系统未通过订舱方 {1} 的撤消订舱申请,该订单恢复原状态"; op_array[13] = "1|13|2|订舱方 {1} 恢复了该订舱单,重新等待承运方答复"; op_array[14] = "1|3|4|订舱方 {1} 确认出运"; op_array[15] = "1|3|9|订舱方 {1} 撤消了该订舱单"; op_array[16] = "1|9|3|订舱方 {1} 取消撤消该订舱单,重新等待承运方答复"; op_array[17] = "0|9|14|系统通过了订舱方 {1} 的撤消订舱申请,该订单作废"; op_array[18] = "0|9|3|系统未通过订舱方 {1} 的撤消订舱申请,该订单恢复原状态"; op_array[19] = "1|15|9|订舱方 {1} 恢复了该订舱单,重新等待承运方答复"; op_array[20] = "2|3|5|承运方 {2} 确认出运"; op_array[21] = "1|5|6|订舱方 {1} 同意完成,交易结束"; op_array[22] = "2|4|6|承运方 {2} 同意完成,交易结束"; op_array[23] = "1|4|10|订舱方 {1} 撤消了该订舱单"; op_array[24] = "1|10|4|订舱方 {1} 取消撤消该订舱单,重新等待承运方答复"; op_array[25] = "0|10|14|系统通过了订舱方 {1} 的撤消订舱申请,该订单作废"; op_array[26] = "0|10|4|系统未通过订舱方 {1} 的撤消订舱申请,该订单恢复原状态"; op_array[27] = "1|15|10|订舱方 {1} 恢复了该订舱单,重新等待承运方答复"; op_array[28] = "1|1|11|订舱方 {1} 删除该订舱单"; op_array[29] = "1|11|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(); op_code = i.ToString(); } }//确认当前的状态数组 string sql = ""; string[] odetail; odetail = GetOrderDetail(order_code); //a是货主,b是货代 //Response.Write(sql); data_conn cn = new data_conn(); DataSet ds = new DataSet(); detail_txt = detail_txt.Replace("{1}", odetail[107]); detail_txt = detail_txt.Replace("{2}", odetail[102]); detail_txt = detail_txt.Replace("{5}", "<span style=\"color:red\">" + ck.CheckInput(reject) + "</span>"); sql = "UPDATE TB_ORDER SET order_status = " + c2 + " WHERE order_code = '" + order_code + "'"; cn.mdb_exe(sql);//改变订单状态 //生成交易记录 sql = "INSERT INTO TB_ORDER_DETAIL (order_code,detail_txt,detail_date) VALUES ('" + order_code + "','" + detail_txt + "',GetDate())"; cn.mdb_exe(sql); double base_fee = 0; if (c2 == "3") { OrderAddCredit(odetail[4], (0 - Convert.ToDouble(odetail[62])).ToString(), "4", order_code, odetail[3], "0");//扣除货代的信息费 } if (c2 == "6") { OrderAddCredit(odetail[3], Convert.ToDouble(odetail[61]).ToString(), "6", order_code, odetail[4], "0");//给货主加上信息费 OrderAddCredit(odetail[4], Convert.ToDouble(odetail[63]).ToString(), "5", order_code, odetail[3], "0");//归还货代的信息费 base_fee = Convert.ToDouble(odetail[60]); if (odetail[120] == "1") { AllinUser AllinUser1 = new AllinUser(); string[] udetail; udetail = AllinUser1.GetUserDetail(odetail[4]); string ali_account = udetail[9]; double baozhengjin = Convert.ToDouble(odetail[60]) * 4 / 10000; //测试用,把保证金缩小10000倍 baozhengjin = Math.Round(baozhengjin, 2); //保留两位小数,精确到分,否则支付宝会出错 string baozhengjin_total = baozhengjin.ToString(); string baozhengjin_back = Math.Round(Convert.ToDouble(baozhengjin.ToString()) * 3 / 4, 2).ToString(); System.DateTime currentTime = new System.DateTime(); currentTime = System.DateTime.Now; string out_order_no = ""; out_order_no = order_code + "_AA"; //out_trade_no 外部商家订单号 string out_trade_no = ""; out_trade_no = order_code + "_BB"; string gateway = "https://www.alipay.com/cooperate/gateway.do?"; //'支付接口 string service = "unfreeze2fastpay"; string partner = "2088201885472720"; //partner 合作伙伴ID 保留字段 string sign_type = "MD5"; string key = "o272s6dqq0s60tm44sy314jvnsfeihd0"; //partner账户的支付宝安全校验码 string out_order_dt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); ; //外部系统订单生成时间 string buyer_nick = ali_account; //买家昵称 string seller_nick = "*****@*****.**"; //卖家昵称 string order_from = "100002"; //(6) 订单的来源地(电子客票使用,淘宝=100001) Y string old_out_order_no = order_code; //(64) 外部系统的冻结资金时的订单号 string goods_detail = "test"; //(400) 购买商品详情(不同于商品名称) Y string totle_fee = baozhengjin_total; // 交易总金额 (0.01-100000000.00元) N string price = baozhengjin_total; // 商品价格(0.01-100000000.00元) N string other_fee = "0"; // 其他费用(0.00-100000000.00元) N string op_type = "0006"; //(50) 见业务类型表 N string royalty_type = "10"; //(50) 见业务类型表 N string royalty_parameters = "" + ali_account + "^" + baozhengjin_back + "^返还订舱保证金"; //(50) 见业务类型表 N string _input_charset = "utf-8"; //HttpContext.Current.Response.Redirect(baozhengjin_total + baozhengjin_back); string aliay_url = CreatUrl( gateway, service, partner, sign_type, out_order_no, out_trade_no, seller_nick, buyer_nick, _input_charset, out_order_dt, op_type, totle_fee, price, other_fee, old_out_order_no, order_from, goods_detail, royalty_type, royalty_parameters, key ); aliay_url = aliay_url.Replace("订舱保证金", "%e8%ae%a2%e8%88%b1%e4%bf%9d%e8%af%81%e9%87%91").Replace("返还订舱保证金", "%e8%bf%94%e8%bf%98%e8%ae%a2%e8%88%b1%e4%bf%9d%e8%af%81%e9%87%91"); //HttpContext.Current.Response.Redirect(aliay_url); XmlTextReader textReader = null; try { textReader = new XmlTextReader(aliay_url); textReader.Read(); textReader.WhitespaceHandling = WhitespaceHandling.None; returnValue = "AliBackSuccess"; } catch { returnValue = "AliBackFail"; } finally { if (textReader != null) { textReader.Close(); } } } }//订单成功后的处理 if (c2 == "7") { sql = "UPDATE TB_ORDER SET reject_reason = '" + ck.CheckInput(reject) + "' WHERE order_code = '" + order_code + "'"; cn.mdb_exe(sql); } string txt_jujueliyou = ""; //拒绝理由 string txt_gerenxinxi = ""; //个人信息 string txt_chongxinxuanze = ""; //重新选择 txt_jujueliyou = "<span style=\"color:red\">" + ck.CheckInput(reject) + "</span>"; //获得货代个人信息 string sql_gerenxinxi = "SELECT * FROM TB_USER WHERE userid = " + odetail[4]; DataSet ds_gerenxinxi = new DataSet(); ds_gerenxinxi = cn.mdb_ds(sql_gerenxinxi, "bid"); txt_gerenxinxi += "姓名:" + ds_gerenxinxi.Tables["bid"].Rows[0]["Realname"].ToString() + "<br/>"; txt_gerenxinxi += "电话:" + ds_gerenxinxi.Tables["bid"].Rows[0]["phone"].ToString() + "<br/>"; txt_gerenxinxi += "Email:" + ds_gerenxinxi.Tables["bid"].Rows[0]["useremail"].ToString() + "<br/>"; //获得货代个人信息 //获得重新选择 //txt_chongxinxuanze += "<a href=\"/fcl/list-" + txtstartport.Value + "-" + txtdestport.Value + "-" + txtcarrier_name.Value + "-0-0-0-------1.html\" target=\"_blank\">重新选择</a>"; //获得重新选择 string order_type_string = odetail[58]; string sql_pm = ""; sql_pm = "SELECT * FROM TB_ORDER_OPERATION WHERE op_code = " + op_code; DataSet ds_pm = new DataSet(); ds_pm = cn.mdb_ds(sql_pm, "pm"); pm p1 = new pm(); string op_sms_shipper = ds_pm.Tables["pm"].Rows[0]["op_sms_shipper"].ToString(); op_sms_shipper = op_sms_shipper.Replace("{1}", odetail[107]); op_sms_shipper = op_sms_shipper.Replace("{2}", odetail[102]); op_sms_shipper = op_sms_shipper.Replace("{3}", "<a href= \"/search/" + order_type_string + "_order.aspx?filter=view&role=shipper&orderid=" + order_code + "\">" + order_code + "</a>"); op_sms_shipper = op_sms_shipper.Replace("{4}", DateTime.Now.ToString()); op_sms_shipper = op_sms_shipper.Replace("{5}", txt_jujueliyou); op_sms_shipper = op_sms_shipper.Replace("{6}", txt_gerenxinxi); op_sms_shipper = op_sms_shipper.Replace("{7}", txt_chongxinxuanze); op_sms_shipper = op_sms_shipper.Replace("{8}", (base_fee / 2).ToString()); op_sms_shipper = op_sms_shipper.Replace("{9}", base_fee.ToString()); string op_sms_forward = ds_pm.Tables["pm"].Rows[0]["op_sms_forward"].ToString(); op_sms_forward = op_sms_forward.Replace("{1}", odetail[107]); op_sms_forward = op_sms_forward.Replace("{2}", odetail[102]); op_sms_forward = op_sms_forward.Replace("{3}", "<a href= \"/search/" + order_type_string + "_order.aspx?filter=view&role=forward&orderid=" + order_code + "\" target=\"_blank\">" + order_code + "</a>"); op_sms_forward = op_sms_forward.Replace("{4}", DateTime.Now.ToString()); op_sms_forward = op_sms_forward.Replace("{5}", txt_jujueliyou); op_sms_forward = op_sms_forward.Replace("{6}", txt_gerenxinxi); op_sms_forward = op_sms_forward.Replace("{7}", txt_chongxinxuanze); op_sms_forward = op_sms_forward.Replace("{8}", (base_fee / 2).ToString()); op_sms_forward = op_sms_forward.Replace("{9}", base_fee.ToString()); if (op_sms_shipper != "") { p1.sendpm("41", odetail[3], op_sms_shipper, "1"); } if (op_sms_forward != "") { p1.sendpm("41", odetail[4], op_sms_forward, "1"); } return returnValue; }
public void UpdateOrderPriceOk(string o) { data_conn cn = new data_conn(); string sql = ""; sql = "UPDATE TB_ORDER SET price20gpAppend=edit_price20gpAppend,price20gp=edit_price20gp,price40gp=edit_price40gp,price40hq=edit_price40hq,price45hq=edit_price45hq,pricegp=edit_pricegp,pricegpv=edit_pricegpv,PRICE_M=edit_PRICE_M,PRICE_N=edit_PRICE_N,PRICE_P45=edit_PRICE_P45,PRICE_P100=edit_PRICE_P100,PRICE_P300=edit_PRICE_P300,PRICE_P500=edit_PRICE_P500,PRICE_P1000=edit_PRICE_P1000,price_shipcompany=edit_price_shipcompany,edit_enabled = 0 WHERE order_code = '" + o + "'"; cn.mdb_exe(sql); string[] odetail; odetail = GetOrderDetail(o); pm pm1 = new pm(); pm1.sendpm("41", odetail[3], "您同意了承运方" + odetail[102] + "修改订单运费" + odetail[109] + "的请求!", "1"); pm1.sendpm("41", odetail[4], "委托方" + odetail[107] + "同意了您修改订单运费" + odetail[110] + "的请求!", "1"); }
public void OrderAddCreditOriginal(string u, string a, string t, string o, string ou, string p) { //参数说明 //u为用户id //a为价格调整数量 //t为价格调整事件类型 //o为订单号 //ou为客户id //p为是否增加预付款额度,1为增加,0为不增加,默认为0 data_conn conn = new data_conn(); DataSet ds = new DataSet(); string userid = u; string amount = a; //价格调整数量 string orderid = o; //订单号 string billtype = t; //账单事件类型 string billtypetext = ""; //账单事件类型 string otherid = ou; string pay = p; string pmtext = ""; //短消息内容 string role = ""; string sql = ""; if (p == "0") { sql = "UPDATE TB_ORDER_ACCOUNT SET overage = overage + " + amount + " WHERE userid = " + userid; } else { sql = "UPDATE TB_ORDER_ACCOUNT SET credit = credit + " + amount + ",overage = overage + " + amount + " WHERE userid = " + userid; } conn.mdb_exe(sql); //更新帐户信息 sql = "SELECT * FROM TB_ORDER_ACCOUNT WHERE userid = " + userid; ds = conn.mdb_ds(sql, "account"); double credit = 0; double overage = 0; int level = 0; if (ds.Tables["account"].Rows.Count > 0) { credit = Convert.ToDouble(ds.Tables["account"].Rows[0]["credit"].ToString()); overage = Convert.ToDouble(ds.Tables["account"].Rows[0]["overage"].ToString()); } if (0 < credit & credit <= 1999) { level = 1; } else if (2000 < credit & credit <= 4999) { level = 2; } else if (5000 < credit & credit <= 9999) { level = 3; } else if (10000 < credit & credit <= 19999) { level = 4; } else if (20000 < credit & credit <= 100000) { level = 5; } sql = "UPDATE TB_USER SET star_allin = " + level.ToString() + " WHERE userid = " + userid; conn.mdb_exe(sql); //更新安运通级别 switch (billtype) { case "1": billtypetext = "预存(支付宝)"; pmtext = "您已使用支付宝方式增加了" + amount + "元预存费,支付宝订单号<a href=\"/member/order/ali_order.aspx?orderid=" + orderid + "\" target=\"_blank\">" + orderid; break; case "2": billtypetext = "预存(银行汇款)"; break; case "3": billtypetext = "预存(网上银行)"; break; case "4": billtypetext = "订舱成功<br/>暂扣保证金加订舱费"; role = "forward"; break; case "5": billtypetext = "交易结束<br/>退还保证金"; role = "forward"; break; case "6": billtypetext = "交易结束<br/>奖励信息费"; role = "shipper"; break; case "7": billtypetext = "交易结束<br/>收取信息费"; role = "forward"; break; case "8": billtypetext = "交易中止<br/>退还保证金加订舱费"; role = "forward"; break; case "9": billtypetext = "订舱成功<br/>暂扣保证金加订舱费<br/>(支付宝)"; pmtext = "您已使用支付宝方式增加了" + amount + "元预存费,支付宝订单号<a href=\"/member/order/ali_order.aspx?orderid=" + orderid + "\" target=\"_blank\">" + orderid; break; } sql = "INSERT INTO TB_ORDER_ACCOUNT_DETAIL (detail_date,order_code,userid,otherid,status,fee,overage,ispay,role) "; sql = sql + " VALUES (getdate(),'" + orderid + "'," + userid + "," + ou + ",'" + billtypetext + "'," + amount + "," + overage + ",0,'" + role + "')"; conn.mdb_exe(sql); if (!string.IsNullOrEmpty(pmtext)) { pm pm1 = new pm(); //给支付宝支付的人发送一条短消息 pm1.sendpm("41", userid, pmtext, "1"); } }
public void UpdateOrderPriceCancel(string o) { data_conn cn = new data_conn(); string sql = ""; sql = "UPDATE TB_ORDER SET edit_enabled = 0 WHERE order_code = '" + o + "'"; cn.mdb_exe(sql); string[] odetail; odetail = GetOrderDetail(o); pm pm1 = new pm(); pm1.sendpm("41", odetail[3], "您拒绝了承运方" + odetail[102] + "修改订单运费" + odetail[109] + "的请求!", "1"); pm1.sendpm("41", odetail[4], "委托方" + odetail[107] + "拒绝了您修改订单运费" + odetail[110] + "的请求!", "1"); }
public void UpdateOrderPriceLcl(string o, string p1, string p2, string p3) { data_conn cn = new data_conn(); string sql = ""; sql = "UPDATE TB_ORDER SET edit_pricegp = '" + p1 + "',edit_pricegpv = '" + p2 + "',edit_price_shipcompany = '" + p3 + "',edit_enabled = 1 WHERE order_code = '" + o + "'"; cn.mdb_exe(sql); string[] odetail; odetail = GetOrderDetail(o); pm pm1 = new pm(); string pmtxt_shipper = ""; pmtxt_shipper += "<table border=\"1\" cellpadding=\"3\" cellspacing=\"1\" style=\"border-collapse: collapse; font-size:12px;\">"; pmtxt_shipper += "<tr><td></td><td>价格(按体积)</td><td>价格(按重量)</td><td>船公司</td></tr>"; pmtxt_shipper += "<tr><td>原运费</td><td>" + odetail[49] + "</td><td>" + odetail[50] + "</td><td>" + odetail[68] + "</td></tr>"; pmtxt_shipper += "<tr><td>修改后</td><td>" + odetail[137] + "</td><td>" + odetail[138] + "</td><td>" + odetail[146] + "</td></tr>"; pmtxt_shipper += "</table>"; pm1.sendpm("41", odetail[3], "承运方" + odetail[102] + "修改了订单" + odetail[109] + "的运费信息<br/>" + pmtxt_shipper + "<br/>以上修改等待您的确认!<br/><a href=\"/search/order_edit_confirm.aspx?type=ok&orderid=" + o + "\">同意</a> <a href=\"/search/order_edit_confirm.aspx?type=cancel&orderid=" + o + "\">不同意</a>", "1"); pm1.sendpm("41", odetail[4], "您修改了订单" + odetail[110] + "的运费信息<br/>" + pmtxt_shipper + "<br/>请等待委托方" + odetail[107] + "确认!", "1"); }
public void delete() { //删除信息 //要删除的纪录的ID,保存在delList隐藏控件内 if (txtMeno.Text == "" || txtdelete.Text == "") { MessageBox("opsuccess", "备注不能为空"); LoadRecord(lblCurrentPage.Text); } else { string id = delList.Text; if (id != "") { data_conn cn = new data_conn(); string body = "尊敬的用户:<br/>"; body += "感谢您参与我们的论坛.<br/>"; body += "由于您在发布的帖子违反本论坛协议而被管理员删除.敬请谅解详情请见<a herf=\"www.100allin.com\">www.100allin.com</a><br/>"; body += "您在使用过程中,如有任何问题或建议,请随时联系傲赢网客户服务人员,我们将热忱为您服务。顺颂商祺!"; DataSet dsBBS = cn.mdb_ds("select UserEmail from TB_User,TB_BBS where TB_User.Userid=TB_BBS.Userid and TB_BBS.id in (" + id + ")", "deleteBBSEmail"); EmailSend email = new EmailSend(); for (int i = 0; i <= dsBBS.Tables["deleteBBSEmail"].Rows.Count - 1; i++) { try { } catch (Exception e) { email.send((string)dsBBS.Tables["deleteBBSEmail"].Rows[i]["UserEmail"].ToString(), body); } } DataSet ds = new DataSet(); string sql = ""; //sql = sql + "delete from TB_BBS where id in (" + id + ")"; //cn.mdb_exe(sql); //sql = "delete from TB_Message where BBSID in (" + id + ")"; //cn.mdb_exe(sql); sql = sql + "update TB_BBS set DeleSign=1,DeleTime=getDate(),DeleAdmin=" + Request.Cookies["bbsadmin_id"].Value + " where id in (" + id + ")"; //Response.Write(sql); cn.mdb_exe(sql); string[] arrayId = id.Split(','); for (int i = 0; i < arrayId.Length; i++) { cn.mdb_exe("insert into TB_BBSAdminIncident (BBSID,AdminID,Meno,EditTime,Types) values (" + arrayId[i] + "," + Request.Cookies["bbsadmin_id"].Value + ",'" + this.txtMeno.Text + "',getDate(),0)"); } DataSet dsuser = cn.mdb_ds("select userid from TB_BBS where id in (" + id + ")", "userid"); for (int i = 0; i < dsuser.Tables["userid"].Rows.Count; i++) { pm pm = new pm(); pm.sendpm(Request.Cookies["bbsadmin_id"].Value, dsuser.Tables["userid"].Rows[i]["userid"].ToString(), txtdelete.Text, "1"); } MessageBox("opsuccess", "删除成功"); //清空delList delList.Text = ""; } else { //没有选择任何要删除的ID,弹出此对话框 MessageBox("opfail", "未选择任何要删除的项目"); } } }
public void UpdateOrderPriceAir(string o, string p1, string p2, string p3, string p4, string p5) { data_conn cn = new data_conn(); string sql = ""; sql = "UPDATE TB_ORDER SET edit_PRICE_P45 = '" + p1 + "',edit_PRICE_P100 = '" + p2 + "',edit_PRICE_P300 = '" + p3 + "',edit_PRICE_P500 = '" + p4 + "',edit_PRICE_P1000 = '" + p5 + "',edit_enabled = 1 WHERE order_code = '" + o + "'"; cn.mdb_exe(sql); string[] odetail; odetail = GetOrderDetail(o); pm pm1 = new pm(); string pmtxt_shipper = ""; pmtxt_shipper += "<table border=\"1\" cellpadding=\"3\" cellspacing=\"1\" style=\"border-collapse: collapse; font-size:12px;\">"; pmtxt_shipper += "<tr><td></td><td>45+</td<td>100+</td><td>300+</td><td>500+</td><td>1000+</td></tr>"; pmtxt_shipper += "<tr><td>原运费</td><td>" + odetail[53] + "</td><td>" + odetail[54] + "</td><td>" + odetail[55] + "</td><td>" + odetail[56] + "</td><td>" + odetail[57] + "</td></tr>"; pmtxt_shipper += "<tr><td>修改后</td><td>" + odetail[141] + "</td><td>" + odetail[142] + "</td><td>" + odetail[143] + "</td><td><td>" + odetail[144] + "</td><td><td>" + odetail[145] + "</td><td></tr>"; pmtxt_shipper += "</table>"; pm1.sendpm("41", odetail[3], "承运方" + odetail[102] + "修改了订单" + odetail[109] + "的运费信息<br/>" + pmtxt_shipper + "<br/>以上修改等待您的确认!<br/><a href=\"/search/order_edit_confirm.aspx?type=ok&orderid=" + o + "\">同意</a> <a href=\"/search/order_edit_confirm.aspx?type=cancel&orderid=" + o + "\">不同意</a>", "1"); pm1.sendpm("41", odetail[4], "您修改了订单" + odetail[110] + "的运费信息<br/>" + pmtxt_shipper + "<br/>请等待委托方" + odetail[107] + "确认!", "1"); }
protected void Button2_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); check ck = new check(); string u = ""; u = ck.CheckNumber(GetRequestCookies("user_id", "0")); data_conn cn = new data_conn(); DataSet ds = new DataSet(); DataSet ds1 = new DataSet(); string sql = ""; string sql1 = ""; string ping = ""; if (txtResultType.Value == "1") { sql = "SELECT order_forward,order_shipper,order_code,freight_type FROM TB_ORDER WHERE order_code = '" + txtResult.Value + "'"; } if (txtResultType.Value == "2") { sql = "SELECT order_shipper,order_forward,order_code,freight_type FROM TB_ORDER WHERE order_code = '" + txtResult.Value + "'"; } ds1 = cn.mdb_ds(sql, "person"); string userid = ds1.Tables["person"].Rows[0][0].ToString(); string complaintsid = ds1.Tables["person"].Rows[0][1].ToString(); string order_code = ds1.Tables["person"].Rows[0][2].ToString(); string order_type_string = ""; double base_fee = 0; switch (ds1.Tables["person"].Rows[0]["freight_type"].ToString()) { case "8": order_type_string = "fcl"; break; case "9": order_type_string = "lcl"; break; case "10": order_type_string = "air"; break; default: break; } sql = "INSERT INTO TB_ORDER_COMPLAINTS (order_code,userid,complaintsid,txt) VALUES ('" + txtResult.Value + "'," + userid + "," + complaintsid + ",'" + TextBox2.Text+ "')"; cn.mdb_exe(sql); sql = "SELECT * FROM TB_USER WHERE userid = " + complaintsid; ds = cn.mdb_ds(sql, "user"); pm p = new pm(); p.sendpm("41", userid, "在订单<a href=\"/search/" + order_type_string + "_order.aspx?filter=view&orderid=" + order_code + "\" target=\"_blank\">" + order_code + "</a>交易过程中," + "<a href=\"/company/" + setkey(complaintsid.ToString()) + "/\">" + ds.Tables["user"].Rows[0]["CompanyName"].ToString() + "</a>对您进行投诉,内容如下:<br/>" + TextBox2.Text, "1"); ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "提示", "alert('您对该商户的投诉成功,请等待系统处理');", true); }
protected void SetOrderDetail(string a, string c1, string c2) { //a是行为的角色,1为货主,2为货代,0为系统 //c1是操作之前的状态号 //c2是操作之后的状态号码 //数组中参数{x}将被具体角色替换,{1}将被货主公司名替换, //{2}将被货代公司名替换,{3}将被订单号替换,{4}将被操作时间替换, //{5}将被拒绝订舱的理由替换,{6}将被个人信息替换,{7}将被重新选择替换, //{8}货主信息费,{9}货代信息费 check ck = new check(); string order_code = ck.CheckInput(txtCode.Text); string op_code = ""; 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(); op_code = i.ToString(); } }//确认当前的状态数组 string sql = ""; sql += "SELECT "; sql += "TB_ORDER.freight_type, "; sql += "TB_ORDER.date_create, "; sql += "TB_ORDER.order_code, "; sql += "TB_ORDER.container_20gp, "; sql += "TB_ORDER.container_40gp, "; sql += "TB_ORDER.container_40hq, "; sql += "TB_ORDER.container_45hq, "; sql += "TB_ORDER.lcl_cbm, "; sql += "TB_ORDER.air_kgs, "; 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 + "'"; data_conn cn = new 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);//添加入操作历史 string order_type_string = ""; double base_fee = 0; switch (ds.Tables["order"].Rows[0]["freight_type"].ToString()) { case "8": base_fee = Convert.ToDouble(ds.Tables["order"].Rows[0]["container_20gp"].ToString()) * 50; base_fee += Convert.ToDouble(ds.Tables["order"].Rows[0]["container_40gp"].ToString()) * 50; base_fee += Convert.ToDouble(ds.Tables["order"].Rows[0]["container_40hq"].ToString()) * 50; base_fee += Convert.ToDouble(ds.Tables["order"].Rows[0]["container_45hq"].ToString()) * 50; order_type_string = "fcl"; break; case "9": base_fee = Convert.ToDouble(ds.Tables["order"].Rows[0]["lcl_cbm"].ToString()) * 10; order_type_string = "lcl"; break; case "10": base_fee = Convert.ToDouble(ds.Tables["order"].Rows[0]["air_kgs"].ToString()) * 10; order_type_string = "air"; break; default: break; } //短消息部分 if (c2 == "5") { //改变用户帐户表内帐户余额,b货代-,a货主+ sql = "UPDATE TB_ORDER_ACCOUNT SET overage = overage + " + base_fee + " WHERE userid = " + ds.Tables["order"].Rows[0]["aid"].ToString(); cn.mdb_exe(sql); sql = "UPDATE TB_ORDER_ACCOUNT SET overage = overage - " + base_fee * 2 + " WHERE userid = " + ds.Tables["order"].Rows[0]["bid"].ToString(); cn.mdb_exe(sql); DataSet ds_overage = new DataSet(); sql = "SELECT * FROM TB_ORDER_ACCOUNT WHERE userid = " + ds.Tables["order"].Rows[0]["aid"].ToString(); ds_overage = cn.mdb_ds(sql, "overage"); string overage_a = ds_overage.Tables["overage"].Rows[0]["overage"].ToString(); sql = "SELECT * FROM TB_ORDER_ACCOUNT WHERE userid = " + ds.Tables["order"].Rows[0]["bid"].ToString(); ds_overage = cn.mdb_ds(sql, "overage"); string overage_b = ds_overage.Tables["overage"].Rows[0]["overage"].ToString(); sql = "INSERT INTO TB_ORDER_ACCOUNT_DETAIL (detail_date,order_code,userid,otherid,status,fee,overage) VALUES "; sql += "(getdate(),'" + order_code + "'," + ds.Tables["order"].Rows[0]["aid"].ToString() + ", " + ds.Tables["order"].Rows[0]["bid"].ToString() + ",'订舱成功'," + (base_fee) + "," + overage_a + ")"; cn.mdb_exe(sql); sql = "INSERT INTO TB_ORDER_ACCOUNT_DETAIL (detail_date,order_code,userid,otherid,status,fee,overage) VALUES "; sql += "(getdate(),'" + order_code + "'," + ds.Tables["order"].Rows[0]["bid"].ToString() + ", " + ds.Tables["order"].Rows[0]["aid"].ToString() + ",'订舱成功'," + (0 - base_fee * 2) + "," + overage_b + ")"; cn.mdb_exe(sql); //pm p = new pm(); //string txt = ""; //txt = "订单<a href=\"/search/" + order_type_string + "_order.aspx?filter=view&orderid=" + order_code + "\" target=\"_blank\">" + order_code + "</a>交易完成,您的信息费增加" + base_fee.ToString() + "元。"; //p.sendpm("41", ds.Tables["order"].Rows[0]["aid"].ToString(), txt, "1"); //txt = "订单<a href=\"/search/" + order_type_string + "_order.aspx?filter=view&orderid=" + order_code + "\" target=\"_blank\">" + order_code + "</a>交易完成,您的信息费将扣除" + (base_fee * 2).ToString() + "元。"; //p.sendpm("41", ds.Tables["order"].Rows[0]["bid"].ToString(), txt, "1"); } string sql_pm = ""; sql_pm = "SELECT * FROM TB_ORDER_OPERATION WHERE op_code = " + op_code; DataSet ds_pm = new DataSet(); ds_pm = cn.mdb_ds(sql_pm, "pm"); pm p1 = new pm(); string op_sms_shipper = ds_pm.Tables["pm"].Rows[0]["op_sms_shipper"].ToString(); op_sms_shipper = op_sms_shipper.Replace("{1}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["aid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["aname"].ToString() + "</a>"); op_sms_shipper = op_sms_shipper.Replace("{2}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["bid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["bname"].ToString() + "</a>"); op_sms_shipper = op_sms_shipper.Replace("{3}", "<a href= \"/search/" + order_type_string + "_order.aspx?filter=view&orderid=" + order_code + "\">" + order_code + "</a>"); op_sms_shipper = op_sms_shipper.Replace("{4}", DateTime.Now.ToString()); op_sms_shipper = op_sms_shipper.Replace("{5}", DateTime.Now.ToString()); op_sms_shipper = op_sms_shipper.Replace("{6}", DateTime.Now.ToString()); op_sms_shipper = op_sms_shipper.Replace("{7}", DateTime.Now.ToString()); op_sms_shipper = op_sms_shipper.Replace("{8}", (base_fee).ToString()); op_sms_shipper = op_sms_shipper.Replace("{9}", (base_fee * 2).ToString()); string op_sms_forward = ds_pm.Tables["pm"].Rows[0]["op_sms_forward"].ToString(); op_sms_forward = op_sms_forward.Replace("{1}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["aid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["aname"].ToString() + "</a>"); op_sms_forward = op_sms_forward.Replace("{2}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["bid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["bname"].ToString() + "</a>"); op_sms_forward = op_sms_forward.Replace("{3}", "<a href= \"/search/" + order_type_string + "_order.aspx?filter=view&orderid=" + order_code + "\">" + order_code + "</a>"); op_sms_forward = op_sms_forward.Replace("{4}", DateTime.Now.ToString()); op_sms_shipper = op_sms_shipper.Replace("{5}", DateTime.Now.ToString()); op_sms_shipper = op_sms_shipper.Replace("{6}", DateTime.Now.ToString()); op_sms_shipper = op_sms_shipper.Replace("{7}", DateTime.Now.ToString()); op_sms_forward = op_sms_forward.Replace("{8}", (base_fee).ToString()); op_sms_forward = op_sms_forward.Replace("{9}", (base_fee * 2).ToString()); if (op_sms_shipper != "") { p1.sendpm("41", ds.Tables["order"].Rows[0]["aid"].ToString(), op_sms_shipper, "1"); } if (op_sms_forward != "") { p1.sendpm("41", ds.Tables["order"].Rows[0]["bid"].ToString(), op_sms_forward, "1"); } }
protected void SetOrderDetail(string a, string c1, string c2) { //a是行为的角色,1为货主,2为货代,0为系统 //c1是操作之前的状态号 //c2是操作之后的状态号码 //数组中参数{x}将被具体角色替换,{1}将被货主公司名替换, //{2}将被货代公司名替换,{3}将被订单号替换,{4}将被操作时间替换, //{5}将被拒绝理由替换,{6}将被个人信息替换,{7}将被重新选择替换, //{8}货主信息费,{9}货代信息费 check ck = new check(); string order_code = ck.CheckInput(txtCode.Value); 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} 不接受订舱,理由是 {5} ,申请系统审核"; 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 + "'"; //a是货主,b是货代 //Response.Write(sql); data_conn cn = new 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>"); detail_txt = detail_txt.Replace("{3}", txtRejectReason.Value); //生成交易记录 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]["lcl_cbm"].ToString()) * 10; //改变用户帐户表内帐户余额,货代-,货主+ sql = "UPDATE TB_ORDER_ACCOUNT SET overage = overage + " + base_fee + " WHERE userid = " + ds.Tables["order"].Rows[0]["aid"].ToString(); cn.mdb_exe(sql); sql = "UPDATE TB_ORDER_ACCOUNT SET overage = overage - " + base_fee * 2 + " WHERE userid = " + ds.Tables["order"].Rows[0]["bid"].ToString(); cn.mdb_exe(sql); sql = "INSERT INTO TB_ORDER_ACCOUNT_DETAIL (detail_date,order_code,userid,otherid,status,fee,overage) VALUES "; sql += "(getdate(),'" + order_code + "'," + ds.Tables["order"].Rows[0]["aid"].ToString() + ", " + ds.Tables["order"].Rows[0]["bid"].ToString() + ",'订舱成功'," + (base_fee) + ",0)"; cn.mdb_exe(sql); sql = "INSERT INTO TB_ORDER_ACCOUNT_DETAIL (detail_date,order_code,userid,otherid,status,fee,overage) VALUES "; sql += "(getdate(),'" + order_code + "'," + ds.Tables["order"].Rows[0]["bid"].ToString() + ", " + ds.Tables["order"].Rows[0]["aid"].ToString() + ",'订舱成功'," + (0 - base_fee * 2) + ",0)"; cn.mdb_exe(sql); pm p = new pm(); string txt = ""; txt = "订单<a href=\"/search/lcl_order.aspx?filter=view&orderid=" + order_code + "\" target=\"_blank\">" + order_code + "</a>交易完成,您的信息费增加" + base_fee.ToString() + "元。"; p.sendpm("41", ds.Tables["order"].Rows[0]["aid"].ToString(), txt, "1"); txt = "订单<a href=\"/search/lcl_order.aspx?filter=view&orderid=" + order_code + "\" target=\"_blank\">" + order_code + "</a>交易完成,您的信息费将扣除" + (base_fee * 2).ToString() + "元。"; p.sendpm("41", ds.Tables["order"].Rows[0]["bid"].ToString(), txt, "1"); } if (c1 == "2" & c2 == "3") { sql = "SELECT * FROM TB_USER WHERE userid = " + ds.Tables["order"].Rows[0]["bid"].ToString(); DataSet ds2 = new DataSet(); ds2 = cn.mdb_ds(sql, "bid"); pm p = new pm(); string txt = ""; txt = "<a href=\"/company/" + setkey(ds.Tables["order"].Rows[0]["bid"].ToString()) + "/\">" + ds.Tables["order"].Rows[0]["bname"].ToString() + "</a>已经接受您的订舱,订舱单号:<a href=\"/search/lcl_order.aspx?filter=view&orderid=" + order_code + "\" target=\"_blank\">" + order_code + "</a><br/>"; txt += "下列联系人将对您进行后续服务:<br/>"; txt += "姓名:" + ds2.Tables["bid"].Rows[0]["Realname"].ToString() + "<br/>"; txt += "电话:" + ds2.Tables["bid"].Rows[0]["phone"].ToString() + "<br/>"; txt += "Email:" + ds2.Tables["bid"].Rows[0]["useremail"].ToString() + "<br/>"; txt += "感谢您使用环球运费网解决您的物流需求,如遇对方商户高于原定报价进行收费,或货物未能及时出运,请及时联系客服中心。如情况属实,我们将按照200元/柜对您进行赔付。点此查看赔付相关说明"; p.sendpm("41", ds.Tables["order"].Rows[0]["aid"].ToString(), txt, "1"); } if (c2 == "6") { pm p = new pm(); string txt = ""; txt = "<a href=\"/company/" + setkey(ds.Tables["order"].Rows[0]["bid"].ToString()) + "/\">" + ds.Tables["order"].Rows[0]["bname"].ToString() + "</a>未接受您发出的<a href=\"/search/lcl_order.aspx?filter=view&orderid=" + order_code + "\" target=\"_blank\">" + order_code + "</a>订舱请求<br/>"; txt += "拒绝理由为:<br/>" + txtRejectReason.Value + "<br/>"; txt += "环球运费网根据您的订舱要求,为您推荐了其他优质服务商,建议您<a href=\"/fcl/list-" + txtstartport.Value + "-" + txtdestport.Value + "-" + txtcarrier_name.Value + "-0-0-0-------1.html\" target=\"_blank\">重新选择</a>"; p.sendpm("41", ds.Tables["order"].Rows[0]["aid"].ToString(), txt, "1"); } }
public void SaveRecord(int q) { check ck = new check(); data_conn cn = new data_conn(); DataSet ds = new DataSet(); string u = ck.CheckNumber(GetRequestCookies("user_id", "0")); string f = ck.CheckNumber(GetRequestQueryString("f", "0")); string yid = ck.CheckNumber(GetRequestQueryString("yid", "0")); string ydid = ck.CheckNumber(GetRequestQueryString("ydid", "0")); string sql = ""; string price20gp = "0"; string price40gp = "0"; string price40hq = "0"; if (txt20gp.Value != "") { price20gp = ck.CheckInput(txt20gp.Value); } if (txt40gp.Value != "") { price40gp = ck.CheckInput(txt40gp.Value); } if (txt40hq.Value != "") { price40hq = ck.CheckInput(txt40hq.Value); } sql = ""; sql += "INSERT INTO TB_ORDER "; sql += "( "; sql += "date_create, "; sql += "order_status, "; sql += "order_code, "; sql += "order_shipper, "; sql += "order_forward, "; sql += "freight_type, "; sql += "freight_code, "; sql += "freight_code1, "; sql += "Shipper, "; sql += "Consignee, "; sql += "NotifyParty, "; sql += "CompanyName, "; sql += "Email, "; sql += "Contactor, "; sql += "Mobile, "; sql += "Tel, "; sql += "Fax, "; sql += "startport, "; sql += "midport, "; sql += "destport, "; sql += "MarksNumbers, "; sql += "NumbersofPackages, "; sql += "Description, "; sql += "GrossWeight, "; sql += "Measurement, "; sql += "kaihangri, "; sql += "carrier_name, "; sql += "zhuangxiangri, "; sql += "jieguanri, "; sql += "lcl_cbm, "; sql += "beizhu "; sql += ") "; sql += "VALUES "; sql += "( "; sql += "GetDate(), "; sql += "" + q + ", "; sql += "'" + ck.CheckInput(txtCode.Value) + "', "; sql += "" + u + ", "; sql += "" + f + ", "; sql += "9, "; sql += "" + yid + ", "; sql += "" + ydid + ", "; sql += "'" + ck.CheckInput(txtShipper.Value) + "', "; sql += "'" + ck.CheckInput(txtConsignee.Value) + "', "; sql += "'" + ck.CheckInput(txtNotifyParty.Value) + "', "; sql += "'" + ck.CheckInput(txtCompanyName.Value) + "', "; sql += "'" + ck.CheckInput(txtEmail.Value) + "', "; sql += "'" + ck.CheckInput(txtContactor.Value) + "', "; sql += "'" + ck.CheckInput(txtMobile.Value) + "', "; sql += "'" + ck.CheckInput(txtTel.Value) + "', "; sql += "'" + ck.CheckInput(txtFax.Value) + "', "; sql += "'" + ck.CheckInput(txtstartport.Value) + "', "; sql += "'" + ck.CheckInput(txtmidport.Value) + "', "; sql += "'" + ck.CheckInput(txtdestport.Value) + "', "; sql += "'" + ck.CheckInput(txtMarksNumbers.Value) + "', "; sql += "'" + ck.CheckInput(txtNumbersofPackages.Value) + "', "; sql += "'" + ck.CheckInput(txtDescription.Value) + "', "; sql += "'" + ck.CheckInput(txtGrossWeight.Value) + "', "; sql += "'" + ck.CheckInput(txtMeasurement.Value) + "', "; sql += "'" + ck.CheckInput(txtkaihangri.Value) + "', "; sql += "'" + ck.CheckInput(txtcarrier_name.Value) + "', "; sql += "'" + ck.CheckInput(txtzhuangxiangri.Value) + "', "; sql += "'" + ck.CheckInput(txtjieguanri.Value) + "', "; sql += "" + price20gp + ", "; sql += "'" + ck.CheckInput(txtbeizhu.Value) + "' "; sql += ") "; if (q == 3) { sql = ""; sql += "UPDATE TB_ORDER SET "; sql += "Shipper = '" + ck.CheckInput(txtShipper.Value) + "', "; sql += "Consignee = '" + ck.CheckInput(txtConsignee.Value) + "', "; sql += "NotifyParty = '" + ck.CheckInput(txtNotifyParty.Value) + "', "; sql += "CompanyName = '" + ck.CheckInput(txtCompanyName.Value) + "', "; sql += "Email = '" + ck.CheckInput(txtEmail.Value) + "', "; sql += "Contactor = '" + ck.CheckInput(txtContactor.Value) + "', "; sql += "Mobile = '" + ck.CheckInput(txtMobile.Value) + "', "; sql += "Tel = '" + ck.CheckInput(txtTel.Value) + "', "; sql += "Fax = '" + ck.CheckInput(txtFax.Value) + "', "; sql += "startport = '" + ck.CheckInput(txtstartport.Value) + "', "; sql += "midport = '" + ck.CheckInput(txtmidport.Value) + "', "; sql += "destport = '" + ck.CheckInput(txtdestport.Value) + "', "; sql += "MarksNumbers = '" + ck.CheckInput(txtMarksNumbers.Value) + "', "; sql += "NumbersofPackages = '" + ck.CheckInput(txtNumbersofPackages.Value) + "', "; sql += "Description = '" + ck.CheckInput(txtDescription.Value) + "', "; sql += "GrossWeight = '" + ck.CheckInput(txtGrossWeight.Value) + "', "; sql += "Measurement = '" + ck.CheckInput(txtMeasurement.Value) + "', "; sql += "kaihangri = '" + ck.CheckInput(txtkaihangri.Value) + "', "; sql += "carrier_name = '" + ck.CheckInput(txtcarrier_name.Value) + "', "; sql += "zhuangxiangri = '" + ck.CheckInput(txtzhuangxiangri.Value) + "', "; sql += "jieguanri = '" + ck.CheckInput(txtjieguanri.Value) + "', "; sql += "lcl_cbm = " + price20gp + ", "; sql += "beizhu = '" + ck.CheckInput(txtbeizhu.Value) + "' "; } //Response.Write(sql); cn.mdb_exe(sql); sql = ""; sql += "UPDATE TB_ORDER_ACCOUNT SET "; sql += "bank = '" + ck.CheckInput(txtbank.Value) + "', "; sql += "bankname = '" + ck.CheckInput(txtbankname.Value) + "', "; sql += "bankaccount = '" + ck.CheckInput(txtbankaccount.Value) + "', "; sql += "otheraccount = '" + ck.CheckInput(txtotheraccount.Value) + "' "; sql += "WHERE userid = " + u; //Response.Write(sql); cn.mdb_exe(sql); if (q == 2) { pm p = new pm(); string txt = ""; txt = "<a href=\"/company/" + setkey(u) + "/\" target=\"_blank\">" + ck.CheckInput(txtCompanyName.Value) + "</a>给您发送了一份线上订舱委托书,订舱编号:<a href=\"/search/lcl_order.aspx?filter=view&orderid=" + txtCode.Value + "\" target=\"_blank\">" + ck.CheckInput(txtCode.Value) + "</a> ,请您尽快答复,以免错失商机!"; p.sendpm("41", f.ToString(), txt, "1"); } if (q == 3) { pm p = new pm(); string txt = ""; txt = "<a href=\"/company/" + setkey(u) + "/\" target=\"_blank\">" + ck.CheckInput(txtCompanyName.Value) + "</a>修改了订单<a href=\"/search/lcl_order.aspx?filter=view&orderid=" + txtCode.Value + "\" target=\"_blank\">" + ck.CheckInput(txtCode.Value) + "</a>,提醒您重新查看该订单!"; p.sendpm("41", txtPubf.Text, txt, "1"); } }
protected void SetOrderDetail(string a, string c1, string c2) { //a是行为的角色,1为货主,2为货代,0为系统 //c1是操作之前的状态号 //c2是操作之后的状态号码 //数组中参数{x}将被具体角色替换,{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 + "'"; data_conn cn = new 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); pm p = new pm(); string txt = ""; txt = "<img src=\"images/ico13.gif\" /> <a href=\"#\">上海启航物流有限公司</a>给您发送了一份线上订舱委托书订舱编号:<a href=\"#\">GX3001</a>提醒您尽快答复,以免错失商机!"; p.sendpm("41", ds.Tables["order"].Rows[0]["aid"].ToString(), "", "1"); } }
protected void Button1_Click(object sender, EventArgs e) { pm p = new pm(); check ck = new check(); string id = "0"; id = ck.CheckNumber(GetRequestCookies("user_id", "0")); string cid = "0"; cid = ck.CheckNumber(GetRequestQueryString("cid", "0")); if (TextBox1.Text.Length > 200) { Label2.Text = "一次发送不能超过200字哦"; Label2.Visible = true; } else { if (string.IsNullOrEmpty(TextBox1.Text)) { Label2.Text = "请输入留言内容"; Label2.Visible = true; TextBox1.Text = ""; } else { p.sendpm(id, cid, Encode(TextBox1.Text), "1"); //ScriptManager.RegisterStartupScript(Button1, Button1.GetType(), "Alert", "alert('" & Encode(TextBox1.Text) & "')", True) TextBox1.Text = ""; LoadRecord(); Label2.Visible = false; ScriptManager.RegisterStartupScript(Button1, Button1.GetType(), "Alert", "alert('留言成功');window.location.href='pm_detail_all.aspx?pid=" + GetRequestQueryString("pid", "0") + "&cid=" + GetRequestQueryString("cid", "0") + "'", true); } } }
protected void SetOrderDetail(string a, string c1, string c2) { //a是行为的角色,1为货主,2为货代,0为系统 //c1是操作之前的状态号 //c2是操作之后的状态号码 //数组中参数{x}将被具体角色替换,{1}将被货主公司名替换, //{2}将被货代公司名替换,{3}将被订单号替换,{4}将被操作时间替换, //{5}将被拒绝理由替换,{6}将被个人信息替换,{7}将被重新选择替换, //{8}货主信息费,{9}货代信息费 check ck = new check(); string order_code = ck.CheckInput(txtCode.Text); string op_code = ""; 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|订舱方 {2} 确认出运"; 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(); op_code = i.ToString(); } }//确认当前的状态数组 string sql = ""; sql += "SELECT "; sql += "TB_ORDER.freight_type, "; sql += "TB_ORDER.startport, "; sql += "TB_ORDER.destport, "; sql += "TB_ORDER.carrier_name, "; sql += "TB_ORDER.container_20gp, "; sql += "TB_ORDER.container_40gp, "; sql += "TB_ORDER.container_40hq, "; sql += "TB_ORDER.container_45hq, "; sql += "TB_ORDER.lcl_cbm, "; sql += "TB_ORDER.air_kgs, "; sql += "TB_ORDER.reject_reason, "; 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 + "'"; data_conn cn = new 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); //增加订单跟踪信息 double base_fee = 0; string order_type_string = "fcl"; switch (ds.Tables["order"].Rows[0]["freight_type"].ToString()) { case "8": base_fee = Convert.ToDouble(ds.Tables["order"].Rows[0]["container_20gp"].ToString()) * 50; base_fee += Convert.ToDouble(ds.Tables["order"].Rows[0]["container_40gp"].ToString()) * 50; base_fee += Convert.ToDouble(ds.Tables["order"].Rows[0]["container_40hq"].ToString()) * 50; base_fee += Convert.ToDouble(ds.Tables["order"].Rows[0]["container_45hq"].ToString()) * 50; order_type_string = "fcl"; break; case "9": base_fee = Convert.ToDouble(ds.Tables["order"].Rows[0]["lcl_cbm"].ToString()) * 10; order_type_string = "lcl"; break; case "10": base_fee = Convert.ToDouble(ds.Tables["order"].Rows[0]["air_kgs"].ToString()) * 10; order_type_string = "air"; break; default: break; }//确定运价类型和信息费 string txt_jujueliyou = ""; //拒绝理由 string txt_gerenxinxi = ""; //个人信息 string txt_chongxinxuanze = ""; //重新选择 //获得拒绝理由 txt_jujueliyou = ds.Tables["order"].Rows[0]["reject_reason"].ToString(); //获得拒绝理由 //获得重新选择 txt_chongxinxuanze += "<a href=\"/" + order_type_string + "/list-" + ds.Tables["order"].Rows[0]["startport"].ToString() + "-" + ds.Tables["order"].Rows[0]["destport"].ToString() + "-" + ds.Tables["order"].Rows[0]["carrier_name"].ToString() + "-0-0-0-------1.html\" target=\"_blank\">重新选择</a>"; //获得重新选择 string sql_pm = ""; sql_pm = "SELECT * FROM TB_ORDER_OPERATION WHERE op_code = " + op_code; DataSet ds_pm = new DataSet(); ds_pm = cn.mdb_ds(sql_pm, "pm"); pm p1 = new pm(); string op_sms_shipper = ds_pm.Tables["pm"].Rows[0]["op_sms_shipper"].ToString(); op_sms_shipper = op_sms_shipper.Replace("{1}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["aid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["aname"].ToString() + "</a>"); op_sms_shipper = op_sms_shipper.Replace("{2}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["bid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["bname"].ToString() + "</a>"); op_sms_shipper = op_sms_shipper.Replace("{3}", "<a href= \"/search/" + order_type_string + "_order.aspx?filter=view&orderid=" + order_code + "\">" + order_code + "</a>"); op_sms_shipper = op_sms_shipper.Replace("{4}", DateTime.Now.ToString()); op_sms_shipper = op_sms_shipper.Replace("{5}", txt_jujueliyou); op_sms_shipper = op_sms_shipper.Replace("{6}", txt_gerenxinxi); op_sms_shipper = op_sms_shipper.Replace("{7}", txt_chongxinxuanze); op_sms_shipper = op_sms_shipper.Replace("{8}", (base_fee).ToString()); op_sms_shipper = op_sms_shipper.Replace("{9}", (base_fee * 2).ToString()); string op_sms_forward = ds_pm.Tables["pm"].Rows[0]["op_sms_forward"].ToString(); op_sms_forward = op_sms_forward.Replace("{1}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["aid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["aname"].ToString() + "</a>"); op_sms_forward = op_sms_forward.Replace("{2}", "<a href= \"/company/" + setkey(ds.Tables["order"].Rows[0]["bid"].ToString()) + "/\" target=\"_blank\">" + ds.Tables["order"].Rows[0]["bname"].ToString() + "</a>"); op_sms_forward = op_sms_forward.Replace("{3}", "<a href= \"/search/" + order_type_string + "_order.aspx?filter=view&orderid=" + order_code + "\" target=\"_blank\">" + order_code + "</a>"); op_sms_forward = op_sms_forward.Replace("{4}", DateTime.Now.ToString()); op_sms_forward = op_sms_forward.Replace("{5}", txt_jujueliyou); op_sms_forward = op_sms_forward.Replace("{6}", txt_gerenxinxi); op_sms_forward = op_sms_forward.Replace("{7}", txt_chongxinxuanze); op_sms_forward = op_sms_forward.Replace("{8}", (base_fee).ToString()); op_sms_forward = op_sms_forward.Replace("{9}", (base_fee * 2).ToString()); if (op_sms_shipper != "") { p1.sendpm("41", ds.Tables["order"].Rows[0]["aid"].ToString(), op_sms_shipper, "1"); } if (op_sms_forward != "") { p1.sendpm("41", ds.Tables["order"].Rows[0]["bid"].ToString(), op_sms_forward, "1"); } //ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "提示", "alert('" + ds.Tables["order"].Rows[0]["aid"].ToString() + "_" + ds.Tables["order"].Rows[0]["bid"].ToString() + "');", true); }