Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = Request["type"];

            id = this.Request["id"];

            formField  = bllTableFieldMap.GetTableFieldMapByWebsite(bllTableFieldMap.WebsiteOwner, "ZCJ_JuActivityInfo", Request["type"], null, "0", null);
            typeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, type);

            string colName = "JuActivityID,UserLongitude,UserLatitude";

            if (formField.Count > 0)
            {
                colName = colName + "," + ZentCloud.Common.MyStringHelper.ListToStr(formField.Select(p => p.Field).Distinct().ToList(), "", ",");
            }

            if (id != "0")
            {
                nInfo = bll.GetColByKey <JuActivityInfo>("JuActivityID", id, colName);
                if (nInfo == null)
                {
                    this.Response.Redirect("List.aspx?type=" + type, true);
                }
            }
            nInfoJtoken = JToken.FromObject(nInfo);
            List <ArticleCategory> list = bllArticleCategory.GetList <ArticleCategory>(string.Format("WebsiteOwner='{0}' And CategoryType='{1}'", bllArticleCategory.WebsiteOwner, type));

            sbCategory.Append(new MySpider.MyCategories().GetSelectOptionHtml(list, "AutoID", "PreID", "CategoryName", cateRootId, "ddlCate", "width:200px", ""));
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            nCategoryTypeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, Request["type"]);
            MetaTable metaTable = DALEngine.GetMetas().Tables["ZCJ_JuActivityInfo"];

            fieldList = metaTable.Columns.Keys.Where(p => !limitForeach.Contains(p)).ToList();
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WebsiteInfo model = bllWeisite.GetWebsiteInfo();

            if (model != null && !string.IsNullOrEmpty(model.WeiXinBindDomain))
            {
                strDomain = model.WeiXinBindDomain;
            }

            formField  = bllTableFieldMap.GetTableFieldMapByWebsite(bllTableFieldMap.WebsiteOwner, "ZCJ_JuActivityInfo", Request["type"], null, "0", null);
            typeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, Request["type"]);
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            typeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, Request["type"]);
            List <TableFieldMapping> formField = bllTableFieldMap.GetTableFieldMapByWebsite(bllTableFieldMap.WebsiteOwner, "ZCJ_JuActivityInfo", Request["type"], null, "0", null);

            if (!string.IsNullOrWhiteSpace(typeConfig.Ex1))
            {
                searchField = formField.Where(p => !string.IsNullOrWhiteSpace(p.Options) && typeConfig.Ex1.Split(',').Contains(p.Field)).ToList();
            }
            if (!string.IsNullOrWhiteSpace(typeConfig.Ex4))
            {
                listField = formField.Where(p => typeConfig.Ex4.Split(',').Contains(p.Field)).ToList();
            }
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = Request["type"];
            string id   = this.Request["id"];

            List <TableFieldMapping> fields = bllTableFieldMap.GetTableFieldMapByWebsite(bllTableFieldMap.WebsiteOwner, "ZCJ_JuActivityInfo", type, null, "0", null);

            typeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, type);


            if (!string.IsNullOrWhiteSpace(typeConfig.Ex5))
            {
                formField = fields.Where(p => typeConfig.Ex5.Split(',').Contains(p.Field)).ToList();
            }
            if (typeConfig.TimeSetMethod == 1 || typeConfig.TimeSetMethod == 2)
            {
                formField.Add(new TableFieldMapping()
                {
                    Field = "UserLongitude"
                });
                formField.Add(new TableFieldMapping()
                {
                    Field = "UserLatitude"
                });
            }
            if (id != "0")
            {
                string colName = ZentCloud.Common.MyStringHelper.ListToStr(formField.Select(p => p.Field).Distinct().ToList(), "", ",");
                if (!colName.Contains("JuActivityID"))
                {
                    colName = "JuActivityID," + colName;
                }
                JuActivityInfo nInfo = bll.GetColByKey <JuActivityInfo>("JuActivityID", id, colName);
                if (nInfo == null)
                {
                    this.Response.Redirect("List.aspx?type=" + type, true);
                }
                JToken ttoken = JToken.FromObject(nInfo);
                foreach (var item in formField)
                {
                    nInfoJtoken[item.Field] = ttoken[item.Field];
                }
            }
        }
Ejemplo n.º 6
0
Archivo: Add.ashx.cs Proyecto: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            JuActivityInfo ninfo = new JuActivityInfo();

            ninfo.WebsiteOwner = bll.WebsiteOwner;
            ninfo.UserID       = currentUserInfo.UserID;
            ninfo.ArticleType  = context.Request["ArticleType"];

            #region 字段检查
            ArticleCategoryTypeConfig typeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, ninfo.ArticleType);
            if (typeConfig.TimeSetMethod == 1 || typeConfig.TimeSetMethod == 2)
            {
                ninfo.UserLongitude = context.Request["UserLongitude"];
                ninfo.UserLatitude  = context.Request["UserLatitude"];
            }

            List <TableFieldMapping> listFieldList = bllTableFieldMap.GetTableFieldMapByWebsite(bllTableFieldMap.WebsiteOwner, "ZCJ_JuActivityInfo", ninfo.ArticleType, null, "0", null);
            List <string>            DefFields     = new List <string>()
            {
                "JuActivityID"
            };
            JObject       jtCurUser     = JObject.FromObject(ninfo);
            List <string> listPropertys = jtCurUser.Properties().Select(p => p.Name).ToList();
            foreach (var item in listFieldList.Where(p => !DefFields.Contains(p.Field) && listPropertys.Contains(p.Field)).OrderBy(p => p.Sort))
            {
                string nValue = context.Request[item.Field];
                if (item.FieldIsNull == 1 && string.IsNullOrWhiteSpace(nValue))
                {
                    apiResp.code = (int)APIErrCode.OperateFail;
                    apiResp.msg  = "请完善" + item.MappingName;
                    bllTableFieldMap.ContextResponse(context, apiResp);
                    return;
                }
                if (!string.IsNullOrWhiteSpace(item.FormatValiFunc))
                {
                    #region 检查数据格式
                    //检查数据格式
                    if (item.FormatValiFunc == "number")
                    {
                        if (!MyRegex.IsNumber(nValue))
                        {
                            apiResp.code = (int)APIErrCode.OperateFail;
                            apiResp.msg  = string.Format("{0}格式不正确", item.MappingName);
                            bllTableFieldMap.ContextResponse(context, apiResp);
                            return;
                        }
                    }
                    if (item.FormatValiFunc == "phone")//email检查
                    {
                        if (!MyRegex.PhoneNumLogicJudge(nValue))
                        {
                            apiResp.code = (int)APIErrCode.OperateFail;
                            apiResp.msg  = string.Format("{0}格式不正确", item.MappingName);
                            bllTableFieldMap.ContextResponse(context, apiResp);
                            return;
                        }
                    }
                    if (item.FormatValiFunc == "email")//email检查
                    {
                        if (!MyRegex.EmailLogicJudge(nValue))
                        {
                            apiResp.code = (int)APIErrCode.OperateFail;
                            apiResp.msg  = string.Format("{0}格式不正确", item.MappingName);
                            bllTableFieldMap.ContextResponse(context, apiResp);
                            return;
                        }
                    }
                    if (item.FormatValiFunc == "url")                                                                                                             //url检查
                    {
                        System.Text.RegularExpressions.Regex regUrl = new System.Text.RegularExpressions.Regex(@"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"); //网址
                        System.Text.RegularExpressions.Match match  = regUrl.Match(nValue);
                        if (!match.Success)
                        {
                            apiResp.code = (int)APIErrCode.OperateFail;
                            apiResp.msg  = string.Format("{0}格式不正确", item.MappingName);
                            bllTableFieldMap.ContextResponse(context, apiResp);
                            return;
                        }
                    }
                    #endregion
                }

                ninfo = bll.ConvertToModel <JuActivityInfo>(ninfo, item.Field, nValue);
            }
            #endregion

            ninfo.JuActivityID = int.Parse(bll.GetGUID(BLLJIMP.TransacType.AddOutlets));

            if (bll.Add(ninfo))
            {
                apiResp.status = true;
                apiResp.msg    = "提交成功";
                apiResp.code   = (int)APIErrCode.IsSuccess;
            }
            else
            {
                apiResp.msg  = "提交失败";
                apiResp.code = (int)APIErrCode.OperateFail;
            }

            bll.ContextResponse(context, apiResp);
        }
Ejemplo n.º 7
0
Archivo: Set.aspx.cs Proyecto: uvbs/mmp
 protected void Page_Load(object sender, EventArgs e)
 {
     nCategoryTypeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, Request["type"]);
 }
Ejemplo n.º 8
0
        public void ProcessRequest(HttpContext context)
        {
            Dictionary <string, string> equals   = new Dictionary <string, string>();
            Dictionary <string, string> contains = new Dictionary <string, string>();
            Dictionary <string, string> keywords = new Dictionary <string, string>();
            List <string> colFields = new List <string>()
            {
                "JuActivityID"
            };
            int    rows             = Convert.ToInt32(context.Request["rows"]);
            int    page             = Convert.ToInt32(context.Request["page"]);
            string type             = context.Request["type"];
            string onlyLngLatIsNull = context.Request["OnlyLngLatIsNull"];
            ArticleCategoryTypeConfig typeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, type);

            if (!string.IsNullOrWhiteSpace(typeConfig.ListFields))
            {
                foreach (var item in typeConfig.ListFields.Split(','))
                {
                    if (!string.IsNullOrWhiteSpace(item) && !string.IsNullOrWhiteSpace(context.Request[item]))
                    {
                        equals.Add(item, context.Request[item]);
                    }
                }
            }
            if (!string.IsNullOrWhiteSpace(typeConfig.EditFields))
            {
                foreach (var item in typeConfig.EditFields.Split(','))
                {
                    if (!string.IsNullOrWhiteSpace(item) && !string.IsNullOrWhiteSpace(context.Request[item]))
                    {
                        contains.Add(item, context.Request[item]);
                    }
                }
            }
            if (!string.IsNullOrWhiteSpace(typeConfig.NeedFields) && !string.IsNullOrWhiteSpace(context.Request["Keyword"]))
            {
                string keyword = context.Request["Keyword"];
                foreach (var item in typeConfig.NeedFields.Split(','))
                {
                    if (!string.IsNullOrWhiteSpace(item))
                    {
                        keywords.Add(item, keyword);
                    }
                }
            }
            int    total   = 0;
            string colName = typeConfig.Ex3;

            if (!colName.Contains("Sort"))
            {
                colName = "Sort," + colName;
            }
            if (typeConfig.TimeSetMethod == 1 || typeConfig.TimeSetMethod == 2)
            {
                if (!colName.Contains("UserLongitude"))
                {
                    colName = "UserLongitude," + colName;
                }
                if (!colName.Contains("UserLatitude"))
                {
                    colName = "UserLatitude," + colName;
                }
            }
            if (!colName.Contains("JuActivityID"))
            {
                colName = "JuActivityID," + colName;
            }
            List <JuActivityInfo> list = bll.GetCommOutletsList(rows, page, bll.WebsiteOwner, type, false, typeConfig.TimeSetMethod, equals, contains, keywords, null, null, null, colName, out total, onlyLngLatIsNull);

            apiResp.result = new {
                totalcount = total,
                list       = list
            };
            apiResp.status = true;
            apiResp.msg    = "查询完成";
            apiResp.code   = (int)APIErrCode.IsSuccess;
            bll.ContextResponse(context, apiResp);
        }
Ejemplo n.º 9
0
        public void ProcessRequest(HttpContext context)
        {
            Dictionary <string, string> equals   = new Dictionary <string, string>();
            Dictionary <string, string> contains = new Dictionary <string, string>();
            Dictionary <string, string> keywords = new Dictionary <string, string>();

            int    page = Convert.ToInt32(context.Request["page"]);
            int    rows = Convert.ToInt32(context.Request["rows"]);
            string type = context.Request["type"];
            ArticleCategoryTypeConfig typeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, type);

            if (!string.IsNullOrWhiteSpace(typeConfig.Ex1))
            {
                foreach (var item in typeConfig.Ex1.Split(','))
                {
                    if (!string.IsNullOrWhiteSpace(item) && !string.IsNullOrWhiteSpace(context.Request[item]))
                    {
                        equals.Add(item, context.Request[item]);
                    }
                }
            }
            if (!string.IsNullOrWhiteSpace(typeConfig.Ex2) && !string.IsNullOrWhiteSpace(context.Request["keyword"]))
            {
                string keyword = context.Request["keyword"];
                foreach (var item in typeConfig.Ex2.Split(','))
                {
                    if (!string.IsNullOrWhiteSpace(item))
                    {
                        keywords.Add(item, keyword);
                    }
                }
            }

            int    total   = 0;
            string colName = typeConfig.Ex4;

            if (!colName.Contains("JuActivityID"))
            {
                colName = "JuActivityID," + colName;
            }
            if (!colName.Contains("Sort"))
            {
                colName = colName + ",Sort";
            }
            if (typeConfig.TimeSetMethod == 1 || typeConfig.TimeSetMethod == 2)
            {
                colName = "UserLongitude,UserLatitude," + colName;
            }
            colName = colName.TrimStart(',').TrimEnd(',');
            List <JuActivityInfo> list = bll.GetCommOutletsList(rows, page, bll.WebsiteOwner, type, false, typeConfig.TimeSetMethod, equals, contains, keywords, context.Request["longitude"], context.Request["latitude"], null, colName, out total);

            JArray jrList = new JArray();

            if (list.Count > 0)
            {
                if (typeConfig.TimeSetMethod == 1 || typeConfig.TimeSetMethod == 2)
                {
                    colName = colName + ",Distance";
                }
                JArray        jList        = JArray.FromObject(list);
                List <string> colFieldList = colName.Split(',').ToList();
                foreach (JToken item in jList)
                {
                    JToken jr = new JObject();
                    foreach (var field in colFieldList)
                    {
                        jr[field] = item[field];
                    }
                    jrList.Add(jr);
                }
            }
            apiResp.result = new
            {
                totalcount = total,
                list       = jrList
            };
            apiResp.status = true;
            apiResp.msg    = "查询完成";
            apiResp.code   = (int)APIErrCode.IsSuccess;
            bll.ContextResponse(context, apiResp);
        }
Ejemplo n.º 10
0
        public void ProcessRequest(HttpContext context)
        {
            string type    = context.Request["type"];
            string cate_id = context.Request["cate_id"];
            string keyword = context.Request["keyword"];
            string sort    = context.Request["sort"];
            string rows    = context.Request["rows"];
            string page    = context.Request["page"];
            int    total   = 0;
            var    data    = bllMall.GetProductList(keyword, cate_id, null, sort,
                                                    page, rows, null, null, null, null, null, null, null, null, null, null,
                                                    null, null, null, null, null, out total, 0, false, type);

            bool isAdded = type.Contains("Added");
            ArticleCategoryTypeConfig nCategoryTypeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, type);

            if (nCategoryTypeConfig == null)
            {
                nCategoryTypeConfig = new ArticleCategoryTypeConfig();
            }
            List <dynamic> list = new List <dynamic>();

            foreach (var item in data)
            {
                List <WXMallProductInfo> relList = new List <WXMallProductInfo>();
                if (!string.IsNullOrWhiteSpace(item.RelationProductId))
                {
                    string pIDStrings = "'" + item.RelationProductId.Replace(",", "','") + "'";
                    relList = bllMall.GetColMultListByKey <WXMallProductInfo>(int.MaxValue, 1, "PID", pIDStrings, "PID,PName,Price,Unit");
                }
                List <ProductSku> skuList = bllMall.GetColList <ProductSku>(int.MaxValue, 1, string.Format("ProductId={0}", item.PID), "SkuId,ProductId,PropValueIdEx1,PropValueIdEx2,PropValueIdEx3,Price");
                list.Add(new
                {
                    product_id        = item.PID,
                    category_name     = bllMall.GetArticleCategoryName(item.CategoryId),
                    title             = item.PName,
                    summary           = item.Summary,
                    access_level      = item.AccessLevel,
                    count             = item.Stock,
                    price             = item.Price,
                    img               = item.RecommendImg,
                    imgs              = item.ShowImage,
                    unit              = item.Unit,
                    relation_products = from p in relList
                                        select new {
                        product_id = p.PID,
                        title      = p.PName,
                        price      = p.Price,
                        unit       = p.Unit,
                        sku_id     = bllMall.GetProductSkuId(p.PID)
                    },
                    sku_list = from p in skuList.Where(p => checkEx(isAdded, nCategoryTypeConfig.TimeSetMethod, p)).OrderBy(p => p.PropValueIdEx1)
                               select new
                    {
                        sku_id     = p.SkuId,
                        product_id = p.ProductId,
                        price      = p.Price,
                        ex1        = p.PropValueIdEx1,
                        ex2        = p.PropValueIdEx2,
                        ex3        = p.PropValueIdEx3
                    },
                    sku_id = skuList.Count == 0? 0: skuList[0].SkuId
                });
            }
            apiResp.result = new
            {
                totalcount = total,
                list       = list
            };
            apiResp.status = true;
            apiResp.code   = (int)APIErrCode.IsSuccess;
            bllMall.ContextResponse(context, apiResp);
        }