예제 #1
0
        private void Save()
        {
            var kid = WebUtility.GetRequestInt("kid", -1);
            var id = WebUtility.GetRequestInt("id", -1);
            if (kid == -1 || id == -1)
            {
                WebUtility.ShowAndGoBack(this, "参数有误!");
                return;
            }

            var result = "";
            if (LoginUser == null)
            {
                result = JsonConvert.SerializeObject(new { statue = false, msg = "请登录!" });
            }
            else
            {
                var selecttype = WebUtility.GetRequestStr("selecttype", "");
                var selectprice = WebUtility.GetRequestStr("selectprice", "");
                var selectsize = WebUtility.GetRequestStr("selectsize", "");
                var selecttypeid = WebUtility.GetRequestStr("selecttypeid", "");
                var selectpriceid = WebUtility.GetRequestStr("selectpriceid", "");
                var selectsizeid = WebUtility.GetRequestStr("selectsizeid", "");

                var key = new DAL.Key().GetEntity(kid);
                if (key == null) return;

                var dic = new Dictionary<string, string>();
                dic.Add("KID", kid.ToString());
                dic.Add("SelectType", selecttype);
                dic.Add("SelectPrice", selectprice);
                dic.Add("SelectSize", selectsize);
                dic.Add("SelectTypeID", selecttypeid);
                dic.Add("SelectPriceID", selectpriceid);
                dic.Add("SelectSizeID", selectsizeid);
                dic.Add("KName", key.Name);

                var poiBLL = new PoiBLL();
                var productPoi = poiBLL.Details<ADeeWu.HuoBi3J.Libary.LBSHelper.ProductPoi>(id, ConfigHelper.GeoProductTableID);
                if (productPoi.status != 0) return;
                try
                {
                    var tags = productPoi.poi.title+" "+key.Name;
                    if(!string.IsNullOrWhiteSpace(productPoi.poi.BName)) tags+=" "+productPoi.poi.BName;
                    poiBLL.Update(id, ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID, ADee.Project.LBS.Entity.CoordType.BaiduEncrypt, dic, "", tags);
                    result = JsonConvert.SerializeObject(new { statue = true });
                }
                catch
                {
                    result = JsonConvert.SerializeObject(new { statue = false, msg = "添加失败!" });
                }
            }

            Response.Write(result);
            Response.Flush();
            Response.End();
        }
예제 #2
0
        private string AddKey()
        {
            var name = WebUtility.GetRequestStr("name", "");
            if (string.IsNullOrWhiteSpace(name)) return "";

            DAL.Key keyDAL = new DAL.Key();

            if (keyDAL.Exist(string.Format(" name='{0}'", name)))
            {
                return JsonConvert.SerializeObject(new { statue = false, msg = "关键字已存在!" });
            }

            var key = new Model.Key
            {
                CreateTime = DateTime.Now,
                Name = name,
                IsDefault =false,
            };
            var keyid = keyDAL.Add(key);
            if (keyid > 0)
            {
                return JsonConvert.SerializeObject(new { statue = true });
            }
            else
            {
                return JsonConvert.SerializeObject(new { statue = false });
            }
        }
예제 #3
0
        private void Search()
        {
            var kid = WebUtility.GetRequestInt("kid", -1);
            var id = WebUtility.GetRequestInt("id", -1);
            if (kid == -1 || id == -1)
            {
                WebUtility.ShowAndGoBack(this, "参数有误!");
                return;
            }

            if (LoginUser == null)
            {
                WebUtility.ShowMsg(this, "请登录!", "/login.aspx?url=" + Request.RawUrl);
                return;
            }

            var productPoi = new PoiBLL().Details<ADeeWu.HuoBi3J.Libary.LBSHelper.ProductPoi>(id, ADee.Project.LBS.Common.ConfigHelper.GeoProductTableID).poi;
            litTitle.Text = productPoi.title;
            litPrice.Text = productPoi.Price.ToString("F2");

            var key = new DAL.Key().GetEntity(kid);
            litKey.Text = key.Name;

            var attributes = new DAL.Key_Attribute().GetEntityList("", new string[] { "kid" }, new object[] { kid });
            ddlType.DataSource = attributes.Where(p => p.DataType == "SelectType").Select(p => new { ID = p.ID, Value = p.DataValue });
            ddlType.DataTextField = "Value";
            ddlType.DataValueField = "ID";
            ddlType.DataBind();
            ddlType.AppendDataBoundItems = true;
            ddlType.Items.Insert(0, new ListItem(""));

            ddlPrice.DataSource = attributes.Where(p => p.DataType == "SelectPrice").Select(p => new { ID = p.ID, Value = p.DataValue });
            ddlPrice.DataTextField = "Value";
            ddlPrice.DataValueField = "ID";
            ddlPrice.DataBind();
            ddlPrice.AppendDataBoundItems = true;
            ddlPrice.Items.Insert(0, new ListItem(""));

            ddlSize.DataSource = attributes.Where(p => p.DataType == "SelectSize").Select(p => new { ID = p.ID, Value = p.DataValue });
            ddlSize.DataTextField = "Value";
            ddlSize.DataValueField = "ID";
            ddlSize.DataBind();
            ddlSize.AppendDataBoundItems = true;
            ddlSize.Items.Insert(0, new ListItem(""));

            var viewPrice = new DAL.Key_ViewPrice().GetEntity(new string[] { "KID" }, new object[] { kid });
            if (viewPrice != null && viewPrice.ID > 0)
                litmsg.Text = string.Format("该关键字每次点击扣费 {0} 元,每条信息当天点击 量达到 {1} 次后当日不再计费!", viewPrice.Price.Value.ToString("0.00"), viewPrice.Count);
            else
                litmsg.Text = "当前该关键字的报价点击免费";
        }