Exemplo n.º 1
0
 // 会员价
 private void OtherBind()
 {
     repGroup.DataSource = bgroup.GetGroupList();
     repGroup.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 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";
 }
        // 会员价
        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";
        }