Exemplo n.º 1
0
 // 会员价
 private void OtherBind()
 {
     Price_Group_RPT.DataSource = gpBll.GetGroupList();
     Price_Group_RPT.DataBind();
     FareTlp_Rad.DataSource = fareBll.Sel();
     FareTlp_Rad.DataBind();
     FareTlp_Rad.Items.Insert(0, new ListItem("免费", "0"));
     FareTlp_Rad.SelectedValue = "0";
 }
Exemplo n.º 2
0
        private void BindUserPrice(M_Product pinfo)
        {
            switch (pinfo.UserType)
            {
            case 1:
                Price_Member_T.Text = DataConverter.CDouble(pinfo.UserPrice).ToString("f2");
                price_member_div.Attributes["style"] = "";
                break;

            case 2:
                price_group_div.Attributes["style"] = "";
                break;

            default:
                UserPri_L.Text = "未设置";
                break;
            }

            DataTable gpdt = gpBll.GetGroupList();

            //附加会员价,限购数,最低购买数等限制
            gpdt.Columns.Add(new DataColumn("price", typeof(string)));
            if (pinfo != null && pinfo.ID > 0)
            {
                if (pinfo.UserPrice.Contains("["))
                {
                    DataTable dt = JsonConvert.DeserializeObject <DataTable>(pinfo.UserPrice);
                    if (dt.Columns.Contains("price"))
                    {
                        dt.Columns["price"].ColumnName = "value";
                    }
                    foreach (DataRow dr in dt.Rows)
                    {
                        DataRow[] gps = gpdt.Select("GroupID='" + dr["gid"] + "'");
                        if (gps.Length > 0)
                        {
                            gps[0]["price"] = DataConverter.CDouble(dr["value"]).ToString("F2");
                        }
                    }
                }
            }
            Price_Group_RPT.DataSource = gpdt;
            Price_Group_RPT.DataBind();
        }
        // 会员价
        private void OtherBind(M_Product pinfo)
        {
            DataTable gpdt = gpBll.GetGroupList();

            //附加会员价,限购数,最低购买数等限制
            gpdt.Columns.Add(new DataColumn("price", typeof(string)));
            gpdt.Columns.Add(new DataColumn("quota", typeof(string)));
            gpdt.Columns.Add(new DataColumn("downquota", typeof(string)));
            if (pinfo != null && pinfo.ID > 0)
            {
                if (pinfo.UserPrice.Contains("["))
                {
                    DataTable dt = JsonConvert.DeserializeObject <DataTable>(pinfo.UserPrice);
                    if (dt.Columns.Contains("price"))
                    {
                        dt.Columns["price"].ColumnName = "value";
                    }
                    foreach (DataRow dr in dt.Rows)
                    {
                        DataRow[] gps = gpdt.Select("GroupID='" + dr["gid"] + "'");
                        if (gps.Length > 0)
                        {
                            gps[0]["price"] = DataConvert.CDouble(dr["value"]).ToString("F2");
                        }
                    }
                }
                if (pinfo.Quota_Json.Contains("["))
                {
                    DataTable dt = JsonConvert.DeserializeObject <DataTable>(pinfo.Quota_Json);
                    foreach (DataRow dr in dt.Rows)
                    {
                        DataRow[] gps = gpdt.Select("GroupID='" + dr["gid"] + "'");
                        if (gps.Length > 0)
                        {
                            gps[0]["quota"] = DataConvert.CLng(dr["value"]);
                        }
                    }
                }
                if (pinfo.DownQuota_Json.Contains("["))
                {
                    DataTable dt = JsonConvert.DeserializeObject <DataTable>(pinfo.DownQuota_Json);
                    foreach (DataRow dr in dt.Rows)
                    {
                        DataRow[] gps = gpdt.Select("GroupID='" + dr["gid"] + "'");
                        if (gps.Length > 0)
                        {
                            gps[0]["downquota"] = DataConvert.CLng(dr["value"]);
                        }
                    }
                }
            }
            Price_Group_RPT.DataSource = gpdt;
            Price_Group_RPT.DataBind();
            Quota_RPT.DataSource = gpdt;
            Quota_RPT.DataBind();
            DownQuota_RPT.DataSource = gpdt;
            DownQuota_RPT.DataBind();
            //-----------------------------------------------------------
            FareTlp_Rad.DataSource = fareBll.Sel();
            FareTlp_Rad.DataBind();
            FareTlp_Rad.Items.Insert(0, new ListItem("免费", "0"));
            FareTlp_Rad.SelectedValue = "0";
        }