Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        check check1 = new check();
        GetRequest GetRequest1 = new GetRequest();

        string u = "";
        u = check1.CheckNumber(GetRequest1.GetRequestCookies("user_id", "0"));

        if (u == "0")
        {
            PlaceHolder1.Visible = false;
            PlaceHolder2.Visible = true;
        }
        else
        {
            PlaceHolder1.Visible = true;
            PlaceHolder2.Visible = false;

                    string[] udetail;
        AllinUser AllinUser1 = new AllinUser();
        udetail = AllinUser1.GetUserDetail(u);

        string uhomeid = udetail[10];

        string name = udetail[3];

        Literal1.Text = "<A class=login_thumb href=\"/home/space.php?uid=" + udetail[10] + "\"><IMG height=20 alt=" + udetail[3] + " src=\"/uc/avatar.php?uid=" + udetail[10] + "&size=small&type=virtual\" width=20></A> <A class=loginName href=\"/home/space.php?uid=" + udetail[10] + "\">" + udetail[3] + "</A>";
        }
    }
Ejemplo n.º 2
0
    public void LoadEditOrder()
    {
        check ck = new check();
        data_conn cn = new data_conn();
        DataSet ds = new DataSet();
        GetRequest GetRequest1 = new GetRequest();

        string u = ck.CheckNumber(GetRequest1.GetRequestCookies("user_id", "0"));
        string orderid = ck.CheckInput(GetRequest1.GetRequestQueryString("orderid", "0"));
        string role = GetRequest1.GetRequestQueryString("role", "");

        AllinOrder AllinOrder1 = new AllinOrder();
        string[] odetail;
        odetail = AllinOrder1.GetOrderDetail(orderid);

        ltrHyf.Text = odetail[59];

        txtPubf.Text = odetail[4];
        txtCode.Value = odetail[0];
        txtShipper.Value = odetail[8];
        txtConsignee.Value = odetail[9];
        txtNotifyParty.Value = odetail[10];
        txtCompanyName.Value = odetail[11];
        txtEmail.Value = odetail[12];
        txtContactor.Value = odetail[13];
        txtMobile.Value = odetail[14];
        txtTel.Value = odetail[15];
        txtFax.Value = odetail[16];
        txtstartport.Value = odetail[17];
        txtmidport.Value = odetail[18];
        txtdestport.Value = odetail[19];
        txtMarksNumbers.Value = odetail[20];
        txtNumbersofPackages.Value = odetail[21];
        txtDescription.Value = odetail[22];
        txtGrossWeight.Value = odetail[23];
        txtMeasurement.Value = odetail[24];
        txtkaihangri.Value = odetail[27];
        txtzhuangxiangri.Value = odetail[28];
        txtjieguanri.Value = odetail[29];
        ltrEndDate.Text = odetail[105];
        txtcarrier_name.Value = odetail[26];

        ltrFreightTitle.Text = "<span style=\"font-weight:bold;font-size:14px\">" + odetail[75] + "</span>";

        txtgp.Value = odetail[34];

        if (odetail[44] != "")
        {
            ltrOrderFujiafei1.Text = "(附加费:" + odetail[44] + ")";
        }

        ltrFreightGP.Text = odetail[49];
        ltrFreightGPV.Text = odetail[50];
        ltrFreightAppend.Text = odetail[44];
        ltrFreightCarrier.Text = odetail[68];

        txtbeizhu.Value = odetail[36];
        SetStep(odetail[1], odetail[37], odetail[38]);

        ltrSMS.Text = "<a href=\"/member/pm_detail.aspx?cid=" + odetail[4] + "\" id=\"linkSMS\" target=\"_blank\"></a>";

        if (u != odetail[3])
        {
            Response.Redirect("/search/err.aspx");
        }//不是买方的用户无修改订单!

        if (odetail[1] != "2" & odetail[1] != "3" & odetail[1] != "7")
        {
            Response.Redirect("/search/err.aspx");
        }//排除不能修改的订单状态!

        ltrOrderStatus.Text = "<div style=\"padding:20px; margin-bottom:10px; font-size:14px; line-height:30px; text-align:center; background:#FFFCF3;border:1px solid #F7E4A5;\">修改订舱单</div>";

        AllinFreight AllinFreight1 = new AllinFreight();
        string[] fdetail;
        if (odetail[7] == "0")
        {
            fdetail = AllinFreight1.GetFreightDetail("9", ck.CheckNumber(odetail[6]), "0");
        }
        else
        {
            fdetail = AllinFreight1.GetFreightDetail("9", "0", ck.CheckNumber(odetail[7]));
        }

        ltrEndDate.Text = Convert.ToDateTime(fdetail[6]).ToString("yyyy-MM-dd");
        ltrFreightTitle.Text = "<span style=\"font-weight:bold;font-size:14px\">" + odetail[75] + "</span>";
        ltrFreightPostdate.Text = Convert.ToDateTime(odetail[65]).ToString("MM") + "/" + Convert.ToDateTime(odetail[65]).ToString("dd");
        ltrFreightEnddate.Text = Convert.ToDateTime(odetail[66]).ToString("MM") + "/" + Convert.ToDateTime(odetail[66]).ToString("dd");
        ltrFreightCompany.Text = fdetail[18];
        ltrFreightAllinStar.Text = fdetail[19];
        ltrFreightUserStar.Text = fdetail[20];
        ltrFreightLine.Text = odetail[69];
        ltrFreightStartport.Text = odetail[70];
        ltrFreightDestport.Text = odetail[71];
        ltrFreightAssuranceSpace.Text = odetail[100];
        ltrFreightAssurancePrice.Text = odetail[101];
        lblTousu.Text = fdetail[18];

        AllinUser AllinUser1 = new AllinUser();
        string[] udetail;
        udetail = AllinUser1.GetUserDetail(u);
        txtbank.Value = udetail[50];
        txtbankname.Value = udetail[51];
        txtbankaccount.Value = udetail[52];
        txtotheraccount.Value = udetail[53];
        txtaliaccount.Value = udetail[9];
    }
Ejemplo n.º 3
0
    public void LoadSavedOrder()
    {
        check ck = new check();
        data_conn cn = new data_conn();
        DataSet ds = new DataSet();
        GetRequest GetRequest1 = new GetRequest();

        string u = ck.CheckNumber(GetRequest1.GetRequestCookies("user_id", "0"));
        string orderid = ck.CheckInput(GetRequest1.GetRequestQueryString("orderid", "0"));
        string role = GetRequest1.GetRequestQueryString("role", "");

        AllinOrder AllinOrder1 = new AllinOrder();
        string[] odetail;
        odetail = AllinOrder1.GetOrderDetail(orderid);
        ltrOrderViewCode.Text = odetail[0];
        ltrOrderViewShipper.Text = odetail[8];
        ltrOrderViewConsignee.Text = odetail[9];
        ltrOrderViewNotifyParty.Text = odetail[10];
        ltrOrderViewCompanyName.Text = odetail[11];
        ltrOrderViewEmail.Text = odetail[12];
        ltrOrderViewContactor.Text = odetail[13];
        ltrOrderViewMobile.Text = odetail[14];
        ltrOrderViewTel.Text = odetail[15];
        ltrOrderViewFax.Text = odetail[16];
        ltrOrderViewStartport.Text = odetail[17];
        ltrOrderViewMidport.Text = odetail[18];
        ltrOrderViewDestport.Text = odetail[19];
        ltrOrderViewMarksNumbers.Text = odetail[20];
        ltrOrderViewNumbersofPackages.Text = odetail[21];
        ltrOrderViewDescription.Text = odetail[22];
        ltrOrderViewGrossWeight.Text = odetail[23];
        ltrOrderViewMeasurement.Text = odetail[24];
        ltrOrderViewCarrier.Text = odetail[26];
        ltrOrderViewKaihangri.Text = odetail[27];
        ltrOrderViewZhuangxiangri.Text = odetail[28];
        ltrOrderViewJieguanri.Text = odetail[29];
        ltrOrderViewGP.Text = odetail[34];
        ltrFreightGP.Text = odetail[49];
        ltrFreightGPV.Text = odetail[50];
        ltrFreightAppend.Text = odetail[44];
        ltrFreightCarrier.Text = odetail[68];
        ltrOrderViewHyf.Text = odetail[59];
        ltrOrderViewBeizhu.Text = odetail[36];
        ltrOverageThis.Text = odetail[62];
        txt_edit_pricegp.Text = odetail[49];
        txt_edit_pricegpv.Text = odetail[50];
        txt_edit_price_shipcompany.Text = odetail[68];

        if (odetail[44] != "")
        {
            ltrOrderFujiafei.Text = "(附加费:" + odetail[44] + ")";
        }

        SetStep(odetail[1], odetail[37], odetail[38]);

        if (u != odetail[3] & u != odetail[4])
        {
            Response.Redirect("/search/err.aspx");
        }//不是买卖双方的用户无法查看该订单!

        string order_type_string = odetail[58];

        if (role == "shipper")
        {
            PlaceHolder3.Visible = true;
            ltrOrderStatus.Text = "<div style=\"padding:20px; margin-bottom:10px; font-size:14px; line-height:30px; text-align:left; background:#FFFCF3;border:1px solid #F7E4A5;\">" + odetail[89].Replace("{1}", orderid).Replace("{9}", order_type_string) + "</div>";

            if (u != odetail[3])
            {
                Response.Redirect("/search/err.aspx");
            }//不是买卖双方的用户无法查看该订单!

        }//订舱方显示的文本

        if (role == "forward")
        {
            PlaceHolder4.Visible = true;
            ltrOrderStatus.Text = "<div style=\"padding:20px; margin-bottom:10px; font-size:14px; line-height:30px; text-align:left; background:#FFFCF3;border:1px solid #F7E4A5;\">" + odetail[90].Replace("{1}", orderid).Replace("{9}", order_type_string) + "</div>";

            if (u != odetail[4])
            {
                Response.Redirect("/search/err.aspx");
            }//不是买卖双方的用户无法查看该订单!

            if (odetail[1] != "2")
            {
                phEditDisabled.Visible = true;
                phEditEnabled.Visible = false;
            }
            else
            {
                phEditDisabled.Visible = false;
                phEditEnabled.Visible = true;
            }
        }//承运方显示的文本

        if (odetail[1] != "2")
        {
            PlaceHolder2.Visible = false;
            PlaceHolder1.Visible = false;
        }

        ltrSMS.Text = "<a href=\"/member/pm_detail.aspx?cid=" + odetail[4] + "\" id=\"linkSMS\" target=\"_blank\"></a>";

        AllinFreight AllinFreight1 = new AllinFreight();
        string[] fdetail;
        if (odetail[7] == "0")
        {
            fdetail = AllinFreight1.GetFreightDetail("9", ck.CheckNumber(odetail[6]), "0");
        }
        else
        {
            fdetail = AllinFreight1.GetFreightDetail("9", "0", ck.CheckNumber(odetail[7]));
        }

        ltrEndDate.Text = Convert.ToDateTime(fdetail[6]).ToString("yyyy-MM-dd");
        ltrFreightTitle.Text = "<span style=\"font-weight:bold;font-size:14px\">" + odetail[75] + "</span>";
        ltrFreightPostdate.Text = Convert.ToDateTime(odetail[65]).ToString("MM") + "/" + Convert.ToDateTime(odetail[65]).ToString("dd");
        ltrFreightEnddate.Text = Convert.ToDateTime(odetail[66]).ToString("MM") + "/" + Convert.ToDateTime(odetail[66]).ToString("dd");
        ltrFreightCompany.Text = fdetail[18];
        ltrFreightAllinStar.Text = fdetail[19];
        ltrFreightUserStar.Text = fdetail[20];
        ltrFreightLine.Text = odetail[69];
        ltrFreightStartport.Text = odetail[70];
        ltrFreightDestport.Text = odetail[71];
        ltrFreightAssuranceSpace.Text = odetail[100];
        ltrFreightAssurancePrice.Text = odetail[101];
        lblTousu.Text = fdetail[18];

        AllinUser AllinUser1 = new AllinUser();
        string[] udetail;
        udetail = AllinUser1.GetUserDetail(u);
        txtbank.Value = udetail[50];
        txtbankname.Value = udetail[51];
        txtbankaccount.Value = udetail[52];
        txtotheraccount.Value = udetail[53];
        ltrOverageTotal.Text = udetail[55];
        ltrOverageAvailable.Text = (Convert.ToInt32(ltrOverageTotal.Text) - Convert.ToInt32(ltrOverageThis.Text)).ToString();
        ltrPayJump.Text = "<a href=\"/member/order/pay_sel_single.aspx?orderid=" + orderid + "\">立即充值</a>";

        //if (Convert.ToInt32(ltrOverageTotal.Text) - Convert.ToInt32(ltrOverageThis.Text) >= 0)
        //{
        //    PlaceHolder8.Visible = true;
        //    PlaceHolder9.Visible = false;
        //    PlaceHolder10.Visible = true;
        //    PlaceHolder11.Visible = false;
        //}
        //else
        //{
        //    PlaceHolder8.Visible = false;
        //    PlaceHolder9.Visible = true;
        //    PlaceHolder10.Visible = false;
        //    PlaceHolder11.Visible = true;
        //}

        PlaceHolder8.Visible = true;
        PlaceHolder9.Visible = false;
        PlaceHolder10.Visible = true;
        PlaceHolder11.Visible = false;
    }
Ejemplo n.º 4
0
    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;
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        login lg = new login();
        lg.login();
        order order1 = new order();
        check ck = new check();
        string u = ck.CheckNumber(order1.GetRequestQueryString("u", "0"));
        string myu = ck.CheckNumber(order1.GetRequestCookies("user_id", ""));

        data_conn cn = new data_conn();
        DataSet ds = new DataSet();

        string sql = "SELECT * FROM TB_USER WHERE userid = " + u;

        ds = cn.mdb_ds(sql, "user");

        Label1.Text = ds.Tables["user"].Rows[0]["companyname"].ToString();
        Label9.Text = ds.Tables["user"].Rows[0]["postnumber"].ToString();
        Label11.Text = ds.Tables["user"].Rows[0]["address"].ToString();

        Label4.Text = "<span><a href=\"/company/" + setkey(u) + "\" style='font-size:14px; font-weight:bold; color:#FF6600;' target=\"_blank\">" + ds.Tables["user"].Rows[0]["realname"].ToString() + "</a></span>";
        Literal25.Text = "<a href=\"/member/pm_detail.aspx?pid=1&cid=" + u + "\" target=\"_blank\"><img src=\"/images/fcl/bot_1.jpg\"  border=\"0\" style= 'margin-top: 12px;'/></a>";

        if ((bool)ds.Tables["user"].Rows[0]["HeadURL"] == true)
        {
            imghead.Src = "/member/Head/" + ds.Tables["user"].Rows[0]["UserID"].ToString() + ".jpg";
        }
        else
        {
            imghead.Src = "/member/Head/default.jpg";
        }

        LtrStars1.Text = Star1(ds.Tables["user"].Rows[0]["star_allin"].ToString());
        LtrStars2.Text = Star2(ds.Tables["user"].Rows[0]["star_user"].ToString());

        try
        {
            ImageButton1.ImageUrl = "/images/get/company_tel.aspx?u=" + setkey(u);
            ImageButton3.ImageUrl = "/images/get/company_email.aspx?u=" + setkey(u);
            ImageButton4.ImageUrl = "/images/get/company_mobile.aspx?u=" + setkey(u);
        }
        catch
        {

        }

        AllinUser AllinUser1 = new AllinUser();

        mysqldata_conn mycn = new mysqldata_conn();
        sql = "SELECT uid FROM uc_friends WHERE uid = " + AllinUser1.GetUserDetail(myu)[10] + " AND friendid = " + ds.Tables["user"].Rows[0]["UCenterHomeUid"].ToString();
        //Response.Write(sql);
        DataSet dsu = new DataSet();
        dsu = mycn.mdb_ds(sql, "ufriend");

        if (dsu.Tables["ufriend"].Rows.Count > 0)
        {
            ImageButton2.Visible = false;
            Label2.Visible = true;
        }
    }
Ejemplo n.º 6
0
    protected void submitbtn_ServerClick(object sender, EventArgs e)
    {
        check check1 = new check();
        GetRequest GetRequest1 = new GetRequest();

        string u = "";
        u = check1.CheckNumber(GetRequest1.GetRequestCookies("user_id", "0"));

        data_conn cn = new data_conn();
        DataSet ds = new DataSet();
        DataSet ds1 = new DataSet();
        DataSet ds2 = new DataSet();
        string sql = "";

        string surl = url2.Value.Trim();
        string vurl = "";

        if (surl.IndexOf("http://") == -1)
        {
            surl = "http://" + surl;
        }

        sql = "SELECT * FROM TB_REPASTE_VIDEO WHERE '" + check1.CheckRecord(surl) + "' LIKE '%' + vtag + '%'";

        ds = cn.mdb_ds(sql, "video");

        if (ds.Tables["video"].Rows.Count > 0)
        {

            string regexp1 = ds.Tables["video"].Rows[0]["surl"].ToString();
            string regexp2 = ds.Tables["video"].Rows[0]["durl"].ToString();

            Match TitleMatch = Regex.Match(surl, regexp1, RegexOptions.IgnoreCase | RegexOptions.Multiline);

            string urlkey = TitleMatch.Groups[1].Value.ToString();
            if (urlkey != "")
            {
                vurl = Regex.Replace(regexp2, "urlkey", urlkey);
            }

        }

        sql = "INSERT INTO TB_REPASTE_TOPIC (topic,txt,userid,url) VALUES ('" + check1.CheckInput(title.Value) + "','" + vurl + "<br/>" + check1.CheckRecord(HiddenField1.Value) + "'," + u + ",'" + check1.CheckInput(url2.Value) + "'); SELECT @@identity ";

        ds1 = cn.mdb_ds(sql, "topic");

        string redirect_tid = ds1.Tables["topic"].Rows[0][0].ToString();//获得转贴主记录的id号

        sql = "INSERT INTO TB_REPASTE_REPASTE (tid,userid) VALUES ('" + ds1.Tables["topic"].Rows[0][0].ToString() + "'," + u + "); SELECT @@identity ";

        ds2 = cn.mdb_ds(sql, "paste");

        string redirect_rid = ds2.Tables["paste"].Rows[0][0].ToString();//获得转贴的id号

        sql = "SELECT TOP 4 * FROM V_REPASTE_INDEX WHERE userid2 = " + u + " ORDER BY rid DESC";

        ds2 = cn.mdb_ds(sql, "index");

        string body_template = "";

        for (int i = 0; i < ds2.Tables["index"].Rows.Count; i++)
        {
            body_template = body_template + "<a href=\"/club/repaste/detail.aspx?rid=" + ds2.Tables["index"].Rows[i]["rid"].ToString() + "\">" + check1.CheckRecord(ds2.Tables["index"].Rows[i]["topic"].ToString()) + "</a><br/>";
            if (i == ds2.Tables["index"].Rows.Count - 1)
            {
                body_template += "<div style=\"width:98%;text-align:right;\"><a href=\"/club/repaste/other.aspx?uid=" + u + "\">查看TA的全部转贴>></a></div>";
            }
        }

        string[] udetail;
        AllinUser AllinUser1 = new AllinUser();
        udetail = AllinUser1.GetUserDetail(u);

        string uhomeid = udetail[10];

        mysqldata_conn mysqlcn = new mysqldata_conn();

        sql = "select uc_members.uid,uc_members.username,uchome_space.name from uc_members left join uchome_space on uc_members.uid = uchome_space.uid where uc_members.uid = " + uhomeid;

        ds2 = mysqlcn.mdb_ds(sql, "uc");

        string uhomename = "";

        if (ds2.Tables["uc"].Rows[0]["name"].ToString() == "")
        {
            uhomename = ds2.Tables["uc"].Rows[0]["username"].ToString();
        }
        else
        {
            uhomename = ds2.Tables["uc"].Rows[0]["name"].ToString();
        }

        sql = "DELETE FROM uchome_feed WHERE appid = 1 AND icon = 'repaste' AND uid = " + uhomeid + ";INSERT INTO uchome_feed (appid,icon,uid,username,dateline,friend,hash_data,title_template,body_template) VALUES (1,'repaste'," + uhomeid + ",'" + uhomename + "'," + UnixTimestamp() + ",0,'" + UnixTimestamp() + "','<b>{actor}</b> 转贴给大家','" + body_template + "')";

        //Response.Write(sql);
        mysqlcn.mdb_exe(sql);

        if (Radio2.Checked == true)
        {
            sql = "";
            if (answer1.Value != "")
            {
                DataSet ds_v = new DataSet();
                sql = "INSERT INTO TB_REPASTE_VOTE (txt,vcount,tid) VALUES ('" + check1.CheckInput(answer1.Value) + "',1," + redirect_tid + ");SELECT @@identity ";
                ds_v = cn.mdb_ds(sql,"vote");
                sql = "INSERT INTO TB_REPASTE_VIEW (userid,tid,voteid) VALUES (" + u + "," + redirect_tid + "," + ds_v.Tables["vote"].Rows[0][0].ToString() + ");";
            }

            if (answer2.Value != "")
            {
                sql += "INSERT INTO TB_REPASTE_VOTE (txt,vcount,tid) VALUES ('" + check1.CheckInput(answer2.Value) + "',0," + redirect_tid + ");";
            }

            if (answer3.Value != "")
            {
                sql += "INSERT INTO TB_REPASTE_VOTE (txt,vcount,tid) VALUES ('" + check1.CheckInput(answer3.Value) + "',0," + redirect_tid + ");";
            }

            if (answer4.Value != "")
            {
                sql += "INSERT INTO TB_REPASTE_VOTE (txt,vcount,tid) VALUES ('" + check1.CheckInput(answer4.Value) + "',0," + redirect_tid + ");";
            }

            if (answer5.Value != "")
            {
                sql += "INSERT INTO TB_REPASTE_VOTE (txt,vcount,tid) VALUES ('" + check1.CheckInput(answer5.Value) + "',0," + redirect_tid + ");";
            }

            if (answer6.Value != "")
            {
                sql += "INSERT INTO TB_REPASTE_VOTE (txt,vcount,tid) VALUES ('" + check1.CheckInput(answer6.Value) + "',0," + redirect_tid + ");";
            }

            if (answer7.Value != "")
            {
                sql += "INSERT INTO TB_REPASTE_VOTE (txt,vcount,tid) VALUES ('" + check1.CheckInput(answer7.Value) + "',0," + redirect_tid + ");";
            }

            if (answer8.Value != "")
            {
                sql += "INSERT INTO TB_REPASTE_VOTE (txt,vcount,tid) VALUES ('" + check1.CheckInput(answer8.Value) + "',0," + redirect_tid + ");";
            }
            cn.mdb_exe(sql);
        }

        Response.Redirect("detail.aspx?rid=" + redirect_rid);
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        login login1 = new login();
        login1.login();

        check check1 = new check();
        GetRequest GetRequest1 = new GetRequest();
        string p = "";
        p = check1.CheckNumber(GetRequest1.GetRequestQueryString("p", "1"));

        string u = "";
        u = check1.CheckNumber(GetRequest1.GetRequestQueryString("uid", "0"));

        int item = 0;
        item = (Convert.ToInt32(p) - 1) * 10;

        data_conn cn = new data_conn();
        DataSet ds = new DataSet();
        string sql = "";
        sql += "SELECT TOP 10 * ";
        sql += "FROM (SELECT * FROM V_REPASTE_INDEX WHERE userid2 = " + u + ") AS T WHERE rid NOT IN ";
        sql += "(SELECT TOP " + item.ToString() + " rid FROM V_REPASTE_INDEX WHERE userid2 = " + u + " ORDER BY rid DESC) ORDER BY rid DESC";

        ds = cn.mdb_ds(sql, "repaste");
        Repeater1.DataSource = ds.Tables["repaste"].DefaultView;
        Repeater1.DataBind();

        sql = "SELECT rid as c FROM V_REPASTE_INDEX WHERE userid2 = " + u;
        ds = cn.mdb_ds(sql, "repaste");

        string base_url = "other.aspx?uid=" + u + "&p=";

        string end_url = "";

        int cp = Convert.ToInt32(p);
        int tp = 1;
        int count = 0;
        count = ds.Tables["repaste"].Rows.Count;

        if (count % 10 > 0 || count == 0)
        {
            tp = count / 10 + 1;
        }
        else
        {
            tp = count / 10;
        }

        string s = "";
        if (cp == 1)
        {
            //s = s + " <span class=\"selected2\">首页</span> ";
            //s = s + " <span class=\"selected2\">上一页</span> ";
            s = s + " <span class=\"selected2\">1</span> ";
            for (int i = 2; i <= (tp < 10 ? tp : 10); i++)
            {
                s = s + " <a href=\"" + base_url + "" + i + end_url + "\"><span>" + i + "</span></a> ";
            }
        }
        else
        {
            s = s + " <a href=\"" + base_url + "1" + end_url + "\"><span>首页</span></a> ";
            s = s + " <a href=\"" + base_url + (cp - 1) + end_url + "\"><span>上一页</span></a> ";
            for (int i = (cp <= 5 ? 1 : (tp - cp < 5 ? (tp - 9 < 1 ? 1 : tp - 9) : cp - 4)); i <= cp - 1; i++)
            {
                s = s + " <a href=\"" + base_url + i + end_url + "\"><span>" + i + "</span></a> ";
            }

            s = s + " <span class=\"selected2\">" + cp + "</span> ";

            for (int i = cp + 1; i <= (cp + 5 >= tp ? tp : (cp <= 5 ? (tp >= 10 ? 10 : tp) : cp + 5)); i++)
            {
                s = s + " <a href=\"" + base_url + i + end_url + "\"><span>" + i + "</span></a> ";
            }
        }

        if (cp == tp)
        {
            //s = s + " <span class=\"selected2\">下一页</span> ";
            //s = s + " <span class=\"selected2\">尾页</span> ";
        }
        else
        {
            s = s + " <a href=\"" + base_url + (cp + 1) + end_url + "\">下一页</a> ";
            s = s + " <a href=\"" + base_url + tp + end_url + "\">尾页</a> ";
        }
        pagecontrol_string = s;

        string[] udetail;
        AllinUser AllinUser1 = new AllinUser();
        udetail = AllinUser1.GetUserDetail(u);

        Literal1.Text = udetail[3];
    }