Example #1
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            TableCell tc;

            tc = e.Row.Cells[5];
            string[]      ts = tc.Text.Split(';');
            StringBuilder sb = new StringBuilder();
            string        s, ss;
            int           index, barindex;
            for (int i = 0; i < ts.Length; i++)
            {
                index = ts[i].IndexOf('*');
                if (index <= 0)
                {
                    continue;
                }

                s  = ts[i].Substring(0, index);
                ss = ts[i].Substring(index, ts[i].Length - index);
                if (ss == "*0")
                {
                    continue;
                }
                sb.Append("<a target='_blank' href='/viewshopitem_multi.aspx?productID=" + s + "'>" +
                          pb.getname(s) + pb.getcategory(s));


                if (ss.Contains("|"))
                {
                    barindex = ss.IndexOf('|');
                    sb.Append(ss.Substring(0, barindex) + "</a><br />密码:");
                    sb.Append(ss.Substring(barindex + 1) + "<br />");
                }
                else
                {
                    sb.Append(ss + "</a><br />");
                }
                //sb.Append(",");
            }
            if (sb.Length > 1)
            {
                sb.Remove(sb.Length - 1, 1);
            }
            tc.Text = sb.ToString();
        }
    }
Example #2
0
    void init()
    {
        TextBox5.Text  = orders.orderID.ToString();
        TextBox31.Text = orders.orderDate.ToString();
        TextBox1.Text  = orders.customerName;
        TextBox2.Text  = modeCu.customerCompany;
        TextBox3.Text  = orders.examBill.ToString();
        //TextBox6.Text = orders.deliveryno;

        string[] ts = orders.ReportContent.Split(';');
        string   s, ss;
        int      index, barindex;

        for (int i = 0; i < ts.Length; i++)
        {
            index = ts[i].IndexOf('*');
            if (index <= 0)
            {
                continue;
            }

            s  = ts[i].Substring(0, index);
            ss = ts[i].Substring(index, ts[i].Length - index);
            if (ss == "*0")
            {
                continue;
            }

            TextBox4.Text += pb.getname(s) + pb.getcategory(s);


            if (ss.Contains("|"))
            {
                barindex       = ss.IndexOf('|');
                TextBox4.Text += ss.Substring(0, barindex) + "\n密码:";
                TextBox4.Text += "\n" + ss.Substring(barindex + 1);
            }
            else
            {
                TextBox4.Text += "\n";
            }
        }

        DropDownList2.SelectedValue = orders.orderStatus;
        TextBox8.Text  = orders.personAddress;
        TextBox25.Text = orders.Msg;
    }
    protected void GridView12_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            TableCell tc;

            tc = e.Row.Cells[1];
            string[]      ts = tc.Text.Split(';');
            StringBuilder sb = new StringBuilder();
            string        s, ss;
            int           index, barindex;
            for (int i = 0; i < ts.Length; i++)
            {
                index = ts[i].IndexOf('*');
                s     = ts[i].Substring(0, index);
                int count = int.Parse(dbsql.ExecuteSc("select count(*) from tab_products where productID=" + s).ToString());
                if (count == 0)
                {
                    dbsql.ExecuteNonQuery("delete from tab_orders where ReportContent like '%" + s + "%'");
                }
                if (Session["language"] != null && Session["language"].ToString() == "zh-cn")
                {
                    sb.Append("<a target='_blank' href='viewshopitem_multi.aspx?productID=" + s + "'>" +
                              pb.getname(s) + pb.getcategory(s));
                }
                else
                {
                    sb.Append("<a target='_blank' href='viewshopitem_multi.aspx?productID=" + s + "'>" +
                              pb.getname_eng(s) + pb.getcategory(s));
                }
                ss = ts[i].Substring(index, ts[i].Length - index);
                if (ss.Contains("|"))
                {
                    barindex = ss.IndexOf('|');
                    sb.Append(ss.Substring(0, barindex) + "</a><br />密码:");
                    sb.Append(ss.Substring(barindex + 1) + "<br />");
                }
                else
                {
                    sb.Append(ss + "</a><br />");
                }
                //sb.Append(",");
            }
            sb.Remove(sb.Length - 1, 1);
            tc.Text = sb.ToString();


            tc = e.Row.Cells[3];
            if (tc.Text == "待确认")
            {
                tc.Text = (string)GetGlobalResourceObject("GResource", "os_saved");
            }
            else if (tc.Text == "待付款")
            {
                tc.Text = (string)GetGlobalResourceObject("GResource", "os_waitpay");
            }
            else if (tc.Text == "待转账")
            {
                tc.Text = (string)GetGlobalResourceObject("GResource", "os_waittransfer");
            }
            else if (tc.Text == "约检成功")
            {
                tc.Text = (string)GetGlobalResourceObject("GResource", "os_paid");
            }
            else if (tc.Text == "已体检")
            {
                tc.Text = (string)GetGlobalResourceObject("GResource", "os_checked");
            }
            else if (tc.Text == "已完成")
            {
                tc.Text = (string)GetGlobalResourceObject("GResource", "os_finish");
            }
            else if (tc.Text == "已取消")
            {
                tc.Text = (string)GetGlobalResourceObject("GResource", "os_cancel");
            }
        }
    }