protected override GetTagsByTypeNameRD ProcessRequest(DTO.Base.APIRequest <GetTagsByTypeNameRP> pRequest) { var rd = new GetTagsByTypeNameRD(); var para = pRequest.Parameters; var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; //登录状态信息 var tagsTypeBLL = new TagsTypeBLL(loggingSessionInfo); //标签分类业务对象实例化 var tagsBLL = new TagsBLL(loggingSessionInfo); //标签业务对象实例化 //获取标签类型对象 var tagsTypeEntity = tagsTypeBLL.QueryByEntity(new TagsTypeEntity() { TypeName = para.TypeName }, null).FirstOrDefault(); if (tagsTypeEntity != null) { //排序字段 var orderBy = new OrderBy[] { new OrderBy() { FieldName = "CreateTime", Direction = OrderByDirections.Asc } }; //获取标签列表 var tagsList = tagsBLL.QueryByEntity(new TagsEntity() { TypeId = tagsTypeEntity.TypeId }, orderBy); //返回数据转换 rd.TagsList = tagsList.Select(t => new TagsInfo() { TagsID = t.TagsId, TagsName = t.TagsName }).ToList(); } return(rd); }
/// <summary> /// 获取门店类型列表 /// </summary> public string GetCityTypeListData() { var service = new TagsBLL(new SessionManager().CurrentUserLoginInfo); //IList<TagsEntity> data = new List<TagsEntity>(); string content = string.Empty; string key = string.Empty; var orderBy = new OrderBy[] { new OrderBy { FieldName = "TagsName", Direction = OrderByDirections.Asc } }; var data = service.QueryByEntity(new TagsEntity() { CustomerId = this.CurrentUserInfo.CurrentUser.customer_id }, orderBy); var jsonData = new JsonData(); jsonData.totalCount = data.Length.ToString(); jsonData.data = data; content = jsonData.ToJSON(); return(content); }
public static string Generate_Auto_Tag_Links(ApplicationDbContext context, string text) { var _lst = TagsBLL.LoadItems(context, new TagEntity() { type = TagsBLL.Types.Blogs }).Result; if (_lst.Count == 0) { return(text); } if (_lst.Count > 0) { int i = 0; string keywords = ""; for (i = 0; i <= _lst.Count - 1; i++) { if (_lst[i].title.Length > 3) { keywords = @"(?<hrefurl><a[^>]*>.*?</a>)|(?<term>(\b" + _lst[i].title.Trim().ToLower() + @"\b))"; text = Regex.Replace(text, keywords, new MatchEvaluator(AutoTagLink)); } } } return(text); }
protected void Page_Load(object sender, EventArgs e) { ((Label)Master.FindControl("lblTitle")).Text = "Photos"; Userid = SessionClass.getUserIdOrTempUserId(); Session["PhotoAlbumId"] = null; Session["HighResoultion"] = null; LoadDataListMediaAlbum(); LoadDataListTagPhotos(); LoadDataListTagAlbums(); // for counting tag photo by friend if not found any then hide label List <Tags> lstphoto = TagsBLL.getTagsListbyFriendsId(Global.PHOTO, Userid); if (lstphoto.Count == 0) { tagphoto_Label.Visible = false; } // for counting tag album by friend if not found any then hide label List <Tags> lstalbum = TagsBLL.getTagsListbyFriendsId(Global.PHOTO_ALBUM, Userid); if (lstalbum.Count == 0) { Tags_Album_label.Visible = false; } List <MediaAlbum> for_more_album_count = MediaAlbumBLL.getMediaAlbumTop6(Userid, Global.PHOTO); if (for_more_album_count.Count < 5) { lbtnMore.Visible = false; } }
/// <summary> /// 获取列表 /// </summary> public string GetListData() { var service = new TagsBLL(new SessionManager().CurrentUserLoginInfo); string content = string.Empty; string key = string.Empty; IList <BillStatusModel> data = new List <BillStatusModel>(); data.Add(new BillStatusModel() { Id = "1", Description = "且" }); data.Add(new BillStatusModel() { Id = "2", Description = "或" }); data.Add(new BillStatusModel() { Id = "3", Description = "无" }); var jsonData = new JsonData(); jsonData.totalCount = data.Count.ToString(); jsonData.data = data; content = jsonData.ToJSON(); return(content); }
public ActionResult proc() { var json = new StreamReader(Request.Body).ReadToEnd(); var data = JsonConvert.DeserializeObject <JGN_Tags>(json); if (data.title.Length < 3) { return(Ok(new { status = "error", message = SiteConfig.generalLocalizer["_invalid_title"].Value })); } if (UtilityBLL.isLongWordExist(data.title) || UtilityBLL.isLongWordExist(data.title)) { return(Ok(new { status = "error", message = SiteConfig.generalLocalizer["_invalid_title"].Value })); } dynamic CategoryContentType = 1; if (data.id > 0) { // Update Operation TagsBLL.Update(_context, data); } else { // Add Operation TagsBLL.Add(_context, data.title, (TagsBLL.Types)data.type, data.records, data.term); } return(Ok(new { status = "success", id = data.id, message = SiteConfig.generalLocalizer["_records_processed"].Value })); }
/// <summary> /// 查询标签 /// </summary> public string GetTagsListData() { var form = Request("form").DeserializeJSONTo <TagsQueryEntity>(); var tagsBLL = new TagsBLL(CurrentUserInfo); IList <TagsEntity> tagsList; string content = string.Empty; int pageIndex = Utils.GetIntVal(FormatParamValue(Request("page"))) - 1; TagsEntity queryEntity = new TagsEntity(); queryEntity.TagsName = FormatParamValue(form.TagsName); queryEntity.TagsDesc = FormatParamValue(form.TagsDesc); queryEntity.TypeId = FormatParamValue(form.TypeId); queryEntity.StatusId = FormatParamValue(form.StatusId); tagsList = tagsBLL.GetWebTags(queryEntity, pageIndex, PageSize); var dataTotalCount = tagsBLL.GetWebTagsCount(queryEntity); var jsonData = new JsonData(); jsonData.totalCount = dataTotalCount.ToString(); jsonData.data = tagsList; content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}", jsonData.data.ToJSON(), jsonData.totalCount); return(content); }
public void AddTags(ref string result) { int queryString = RequestHelper.GetQueryString <int>("ProductID"); string str = CookiesHelper.ReadCookieValue("TagsCookies" + queryString.ToString()); if ((ShopConfig.ReadConfigInfo().AddTagsRestrictTime > 0) && (str != string.Empty)) { result = "Ç벻ҪƵ·±Ìá½»"; } else { TagsInfo tags = new TagsInfo(); tags.ProductID = queryString; tags.Word = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Word")); tags.Color = "#4C5A62"; tags.Size = 12; tags.IsTop = 0; tags.UserID = base.UserID; tags.UserName = base.UserName; TagsBLL.AddTags(tags); if (ShopConfig.ReadConfigInfo().AddTagsRestrictTime > 0) { CookiesHelper.AddCookie("TagsCookies" + queryString.ToString(), "TagsCookies" + queryString.ToString(), ShopConfig.ReadConfigInfo().AddTagsRestrictTime, TimeType.Second); } } }
/// <summary> /// 页面加载 /// </summary> protected override void PageLoad() { base.PageLoad(); TagsSearchInfo tagsSearch = new TagsSearchInfo(); tagsSearch.UserID = base.UserID; tagsList = TagsBLL.SearchTagsList(tagsSearch); }
public async Task <ActionResult> getinfo() { var json = new StreamReader(Request.Body).ReadToEnd(); var data = JsonConvert.DeserializeObject <List <TagEntity> >(json); var _posts = await TagsBLL.LoadItems(_context, data[0]); return(Ok(new { post = _posts[0] })); }
protected void load_cbltags() { tags = new TagsBLL(); cbltags.DataSource = tags.ListAllTags(); cbltags.DataTextField = "TagsName"; cbltags.DataValueField = "ID"; cbltags.DataBind(); }
protected void txtFriendSearch_TextChanged(object sender, EventArgs e) { string fid = HiddenField1.Value; if (fid.Length > 20) { UserBO objFriend = new UserBO(); objFriend = UserBLL.getUserByUserId(fid); UserBO objUser = new UserBO(); objUser = UserBLL.getUserByUserId(Userid); //Response.Write(fid); TagsBO objTags = new TagsBO(); objTags.AtId = Photoid; objTags.Type = Global.PHOTO; objTags.UserId = Userid; objTags.FirstName = objUser.FirstName; objTags.LastName = objUser.LastName; objTags.FriendId = fid; objTags.FriendFName = objFriend.FirstName; objTags.FriendLName = objFriend.LastName; TagsBLL.insertTags(objTags); LoadDataListTags(); List <string> lst = new List <string>(); lst = TagsBLL.getTagsFriendId(Global.PHOTO, Photoid); LoadDataListComments(); if (Isfollow == true) { foreach (string item in lst) { UserBO objUserNotify = new UserBO(); objUserNotify = UserBLL.getUserByUserId(item); NotificationBO objNotify = new NotificationBO(); objNotify.MyNotification = "<a href=\"ViewProfile.aspx?UserId=" + Userid + "\">" + objUser.FirstName + " " + objUser.LastName + "</a> tags on <a href=\"ViewPhoto.aspx?PhotoId=" + Photoid + "\">photo</a>"; objNotify.AtId = Photoid; objNotify.Type = Global.PHOTO; objNotify.UserId = item; objNotify.FirstName = objUserNotify.FirstName; objNotify.LastName = objUserNotify.LastName; objNotify.FriendId = Userid; objNotify.FriendFName = objUser.FirstName; objNotify.FriendLName = objUser.LastName; msgtext = "Dear Pyramid Plus user," + objUser.FirstName + " " + objUser.LastName + " tags you photo "; // ThreadPool.QueueUserWorkItem(new WaitCallback(sendEmail), (object)objUserNotify.Email); NotificationBLL.insertNotification(objNotify); } } } }
private void SetCopyTags() { LoggingSessionInfo loggingSessionInfo = new LoggingSessionInfo(); loggingSessionInfo = new CLoggingSessionService().GetLoggingSessionInfo("29E11BDC6DAC439896958CC6866FF64E", "00078c78c22b4e7696391ed32f011255"); TagsBLL tagsServer = new TagsBLL(loggingSessionInfo); bool bReturnTags = tagsServer.setCopyTag("111"); }
public ActionResult action() { var json = new StreamReader(Request.Body).ReadToEnd(); var data = JsonConvert.DeserializeObject <List <TagEntity> >(json); TagsBLL.ProcessAction(_context, data); return(Ok(new { status = "success", message = SiteConfig.generalLocalizer["_records_processed"].Value })); }
// GET: blogs/search public async Task <IActionResult> search(string term) { if (term == null) { return(Redirect("/blogs")); } var _sanitize = new HtmlSanitizer(); term = _sanitize.Sanitize(UtilityBLL.ReplaceHyphinWithSpace(term)); /* ***************************************/ // Process Page Meta & BreaCrumb /* ***************************************/ var _meta = PageMeta.returnPageMeta(new PageQuery() { controller = ControllerContext.ActionDescriptor.ControllerName, index = ControllerContext.ActionDescriptor.ActionName, pagenumber = 1, matchterm = term }); if (Jugnoon.Settings.Configs.GeneralSettings.store_searches) { //********************************************* // User Search Tracking Script //******************************************** if (!TagsBLL.Validate_Tags(term.Trim()) && !term.Trim().Contains("@")) { // check if tag doesn't exist var count_tags = await TagsBLL.Count(_context, new TagEntity() { type = TagsBLL.Types.General, tag_type = TagsBLL.TagType.UserSearches, isenabled = EnabledTypes.Enabled }); if (count_tags == 0) { TagsBLL.Add(_context, term.Trim(), TagsBLL.Types.General, 0, TagsBLL.TagType.UserSearches, EnabledTypes.Enabled, term.Trim()); } } } /* List Initialization */ var ListEntity = new BlogListViewModel() { QueryOptions = new BlogEntity() { term = term, }, BreadItems = _meta.BreadItems }; return(View(ListEntity)); }
protected Boolean CheckExistTagsName(string name) { tags = new TagsBLL(); List <Tags> lst = tags.getTagsWithName(name); Tags tg = lst.FirstOrDefault(); if (tg != null) { return(false); } return(true); }
protected void DeleteButton_Click(object sender, EventArgs e) { base.CheckAdminPower("DeleteTags", PowerCheckType.Single); string intsForm = RequestHelper.GetIntsForm("SelectID"); if (intsForm != string.Empty) { TagsBLL.DeleteTags(intsForm, 0); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("Tags"), intsForm); ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), RequestHelper.RawUrl); } }
protected void txtFriendSearch_TextChanged(object sender, EventArgs e) { string fid = HiddenField1.Value; if (fid.Length > 20) { UserBO objFriend = new UserBO(); objFriend = UserBLL.getUserByUserId(fid); UserBO objUser = new UserBO(); objUser = UserBLL.getUserByUserId(Userid); //Response.Write(fid); TagsBO objTags = new TagsBO(); objTags.AtId = Albumid; objTags.Type = Global.PHOTO_ALBUM; objTags.UserId = Userid; objTags.FirstName = objUser.FirstName; objTags.LastName = objUser.LastName; objTags.FriendId = fid; objTags.FriendFName = objFriend.FirstName; objTags.FriendLName = objFriend.LastName; TagsBLL.insertTags(objTags); LoadDataListTags(); List <string> lst = new List <string>(); lst = TagsBLL.getTagsFriendId(Global.PHOTO_ALBUM, Albumid); LoadDataListComments(); foreach (string item in lst) { UserBO objUserNotify = new UserBO(); objUserNotify = UserBLL.getUserByUserId(item); NotificationBO objNotify = new NotificationBO(); objNotify.MyNotification = "<a href=\"ViewProfile.aspx?UserId=" + Userid + "\">" + objUser.FirstName + " " + objUser.LastName + "</a> tags on <a href=\"ViewPhotoAlbum.aspx?AlbumId=" + Albumid + "\">photo album</a>"; objNotify.AtId = Albumid; objNotify.Type = Global.VIDEO; objNotify.UserId = item; objNotify.FirstName = objUserNotify.FirstName; objNotify.LastName = objUserNotify.LastName; objNotify.FriendId = Userid; objNotify.FriendFName = objUser.FirstName; objNotify.FriendLName = objUser.LastName; msgtext = "Dear Pyramid Plus user," + objUser.FirstName + " " + objUser.LastName + " tags you video "; NotificationBLL.insertNotification(objNotify); } } }
public async Task <ActionResult> load() { var json = new StreamReader(Request.Body).ReadToEnd(); var data = JsonConvert.DeserializeObject <TagEntity>(json); var _posts = await TagsBLL.LoadItems(_context, data); var _records = 0; if (data.id == 0) { _records = await TagsBLL.Count(_context, data); } return(Ok(new { posts = _posts, records = _records })); }
/// <summary> /// 销售(服务)订单 /// </summary> public string GetTagTypeAndTags(string pRequest) { var rp = pRequest.DeserializeJSONTo <APIRequest <GetTagTypeAndTagsRP> >();//不需要参数 string userId = rp.UserID; string customerId = rp.CustomerID; var pageSize = rp.Parameters.PageSize; var pageIndex = rp.Parameters.PageIndex; LoggingSessionInfo loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID); //var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; TagsTypeBLL bll = new TagsTypeBLL(loggingSessionInfo); var rd = new GetTagTypeAndTagsRD(); var ds = bll.GetAll2(pageIndex ?? 1, pageSize ?? 15, rp.Parameters.OrderBy, rp.Parameters.OrderType); List <TagsTypeEntity> tagTypeList = new List <TagsTypeEntity>(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { tagTypeList = DataTableToObject.ConvertToList <TagsTypeEntity>(ds.Tables[1]);//直接根据所需要的字段反序列化 rd.TotalCount = ds.Tables[0].Rows.Count; rd.TotalPages = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(ds.Tables[0].Rows.Count * 1.00 / (pageSize ?? 15) * 1.00))); } //标签 TagsBLL _TagsBLL = new TagsBLL(loggingSessionInfo); List <TagsTypeInfo> ls = new List <TagsTypeInfo>(); if (tagTypeList != null && tagTypeList.Count() > 0) { foreach (TagsTypeEntity en in tagTypeList) { TagsTypeInfo _TagsTypeInfo = new TagsTypeInfo(); _TagsTypeInfo.TypeId = en.TypeId; _TagsTypeInfo.TypeName = en.TypeName; var ds2 = _TagsBLL.GetTagsList(en.TypeId, rp.CustomerID); if (ds2 != null && ds2.Tables.Count > 0 && ds2.Tables[0].Rows.Count > 0) { _TagsTypeInfo.TagsList = DataTableToObject.ConvertToList <TagsInfo>(ds2.Tables[0]);//直接根据所需要的字段反序列化 } ls.Add(_TagsTypeInfo); } } rd.TagTypesAndTags = ls; var rsp = new SuccessResponse <IAPIResponseData>(rd); return(rsp.ToJSON()); }
/// <summary> /// 保存标签 /// </summary> public string SaveTagsData() { var service = new TagsBLL(CurrentUserInfo); TagsEntity tags = new TagsEntity(); string content = string.Empty; var responseData = new ResponseData(); string key = string.Empty; string tags_id = string.Empty; if (Request("tags") != null && Request("tags") != string.Empty) { key = Request("tags").ToString().Trim(); } if (Request("TagsId") != null && Request("TagsId") != string.Empty) { tags_id = Request("TagsId").ToString().Trim(); } tags = key.DeserializeJSONTo <TagsEntity>(); if (tags.TagsName == null || tags.TagsName.Trim().Length == 0) { responseData.success = false; responseData.msg = "标签名称不能为空"; return(responseData.ToJSON()); } bool status = true; string message = "保存成功"; if (tags.TagsId.Trim().Length == 0) { tags.TagsId = Utils.NewGuid(); tags.CustomerId = this.CurrentUserInfo.CurrentUser.customer_id; service.Create(tags); } else { tags.TagsId = tags_id; service.Update(tags, false); } responseData.success = status; responseData.msg = message; content = responseData.ToJSON(); return(content); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadTags", PowerCheckType.Single); TagsSearchInfo tags = new TagsSearchInfo(); tags.ProductName = RequestHelper.GetQueryString <string>("ProductName"); tags.Word = RequestHelper.GetQueryString <string>("Word"); tags.IsTop = RequestHelper.GetQueryString <int>("IsTop"); this.ProductName.Text = tags.ProductName; this.Word.Text = tags.Word; this.IsTop.Text = tags.IsTop.ToString(); base.BindControl(TagsBLL.SearchTagsList(base.CurrentPage, base.PageSize, tags, ref this.Count), this.RecordList, this.MyPager); } }
/// <summary> /// 根据标签ID获取标签信息 /// </summary> public string GetTagsInfoById() { var service = new TagsBLL(CurrentUserInfo); TagsEntity tags = new TagsEntity(); string content = string.Empty; string key = string.Empty; if (Request("TagsID") != null && Request("TagsID") != string.Empty) { key = Request("TagsID").ToString().Trim(); } tags = service.GetByID(key); var jsonData = new JsonData(); jsonData.totalCount = tags == null ? "0" : "1"; jsonData.data = tags; content = jsonData.ToJSON(); return(content); }
protected void btnAddTags_Click(object sender, EventArgs e) { try { tags = new TagsBLL(); string[] lsttags = txttagsname.Text.Split(','); int i = 0; while (i < lsttags.Length) { if (CheckExistTagsName(lsttags[i])) { tags.newTagsName(lsttags[i]); } i++; } this.load_cbltags(); string script = "window.onload = function() { calltagspanelClickEvent(); };"; ClientScript.RegisterStartupScript(this.GetType(), "calltagspanelClickEvent", script, true); } catch (Exception ex) { this.AlertPageValid(true, ex.ToString(), alertPageValid, lblPageValid); } }
protected void btnPostNew_Click(object sender, EventArgs e) { try { post_category_relationships = new Post_Category_RelationshipsBLL(); category = new CategoryBLL(); images = new ImagesBLL(); tags = new TagsBLL(); tags_relationships = new Tags_relationshipsBLL(); string dateString = DateTime.Now.ToString("MM-dd-yyyy"); string PostCode = RandomName + "-" + dateString; if (NewPost(PostCode)) { this.New_Post_Category_relationships(PostCode); this.New_Tags_relationships(PostCode); Response.Redirect("http://" + Request.Url.Authority + "/Admin/Pages/Post-Update.aspx?PostCode=" + PostCode); } } catch (Exception ex) { this.AlertPageValid(true, ex.ToString(), alertPageValid, lblPageValid); } }
protected void LoadDataListTagAlbums() { DataListTagAlbums.DataSource = TagsBLL.getTagsListbyFriendsId(Global.PHOTO_ALBUM, Userid); DataListTagAlbums.DataBind(); }
protected void LoadDataListTagPhotos() { DataListTagPhotos.DataSource = TagsBLL.getTagsListbyFriendsId(Global.PHOTO, Userid); DataListTagPhotos.DataBind(); }
protected override void PageLoad() { base.PageLoad(); int queryString = RequestHelper.GetQueryString <int>("ID"); this.product = ProductBLL.ReadProduct(queryString); if (this.product.IsSale == 0) { ScriptHelper.Alert("该产品未上市,不能查看"); } ProductBLL.ChangeProductViewCount(queryString, 1); this.userGradeList = UserGradeBLL.ReadUserGradeCacheList(); this.memberPriceList = MemberPriceBLL.ReadMemberPriceByProduct(queryString); this.currentMemberPrice = (this.product.MarketPrice * UserGradeBLL.ReadUserGradeCache(base.GradeID).Discount) / 100M; foreach (MemberPriceInfo info in this.memberPriceList) { if (info.GradeID == base.GradeID) { this.currentMemberPrice = info.Price; break; } } this.currentMemberPrice = Math.Round(this.currentMemberPrice, 2); ProductPhotoInfo item = new ProductPhotoInfo(); item.Name = this.product.Name; item.Photo = this.product.Photo; this.productPhotoList.Add(item); this.productPhotoList.AddRange(ProductPhotoBLL.ReadProductPhotoByProduct(queryString)); this.strHistoryProduct = base.Server.UrlDecode(CookiesHelper.ReadCookieValue("HistoryProduct")); string strProductID = (this.product.RelationProduct + "," + this.product.Accessory + "," + this.strHistoryProduct).Replace(",,", ","); if (strProductID.StartsWith(",")) { strProductID = strProductID.Substring(1); } if (strProductID.EndsWith(",")) { strProductID = strProductID.Substring(0, strProductID.Length - 1); } ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductID = strProductID; this.tempProductList = ProductBLL.SearchProductList(productSearch); if (strProductID != string.Empty) { this.tempMemberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID); } this.attributeRecordList = AttributeRecordBLL.ReadAttributeRecordByProduct(queryString); TagsSearchInfo tags = new TagsSearchInfo(); tags.ProductID = queryString; this.productTagsList = TagsBLL.SearchTagsList(tags); if (this.product.RelationArticle != string.Empty) { ArticleSearchInfo articleSearch = new ArticleSearchInfo(); articleSearch.InArticleID = this.product.RelationArticle; this.productArticleList = ArticleBLL.SearchArticleList(articleSearch); } this.standardRecordList = StandardRecordBLL.ReadStandardRecordByProduct(this.product.ID, this.product.StandardType); if ((this.standardRecordList.Count > 0) && (this.product.StandardType == 1)) { string[] strArray = this.standardRecordList[0].StandardIDList.Split(new char[] { ',' }); for (int i = 0; i < strArray.Length; i++) { StandardInfo info6 = StandardBLL.ReadStandardCache(Convert.ToInt32(strArray[i])); string[] strArray2 = info6.ValueList.Split(new char[] { ',' }); string[] strArray3 = info6.PhotoList.Split(new char[] { ',' }); string str2 = string.Empty; string str3 = string.Empty; for (int j = 0; j < strArray2.Length; j++) { foreach (StandardRecordInfo info7 in this.standardRecordList) { string[] strArray4 = info7.ValueList.Split(new char[] { ',' }); if (strArray2[j] == strArray4[i]) { str2 = str2 + strArray2[j] + ","; str3 = str3 + strArray3[j] + ","; goto Label_043B; } } Label_043B :; } if (str2 != string.Empty) { str2 = str2.Substring(0, str2.Length - 1); str3 = str3.Substring(0, str3.Length - 1); } info6.ValueList = str2; info6.PhotoList = str3; this.standardList.Add(info6); } foreach (StandardRecordInfo info7 in this.standardRecordList) { object standardRecordValueList = this.standardRecordValueList; this.standardRecordValueList = string.Concat(new object[] { standardRecordValueList, info7.ProductID, ",", info7.ValueList, "|" }); } } if (ShopConfig.ReadConfigInfo().ProductStorageType == 1) { this.leftStorageCount = this.product.TotalStorageCount - this.product.OrderCount; } else { this.leftStorageCount = this.product.ImportVirtualStorageCount; } base.Title = this.product.Name; base.Keywords = (this.product.Keywords == string.Empty) ? this.product.Name : this.product.Keywords; base.Description = (this.product.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(this.product.Introduction), 200) : this.product.Summary; }
public void ProcessRequest(HttpContext context) { var json = new StreamReader(context.Request.InputStream).ReadToEnd(); var responseMsg = new Dictionary <string, string>(); long ContentID = 0; int tagType = 0; int Type = 0; int PageNumber = 1; string Order = "tagname asc"; bool isCache = true; int Status = 0; string Value = ""; string FieldName = ""; int Records = 0; if ((context.Request.Params["action"] != null)) { switch (context.Request.Params["action"]) { case "add": // Authentication if (!context.User.Identity.IsAuthenticated) { responseMsg["status"] = "error"; responseMsg["message"] = "Authentication Failed"; context.Response.Write(responseMsg); return; } var _addobj = JsonConvert.DeserializeObject <Tags_Struct>(json); if (context.Request.Params["ttype"] != null) { tagType = Convert.ToInt32(context.Request.Params["ttype"]); } if (context.Request.Params["cid"] != null) { ContentID = Convert.ToInt64(context.Request.Params["cid"]); } TagsBLL.Process_Tags(_addobj.TagName, _addobj.Type, tagType, ContentID); responseMsg["status"] = "success"; responseMsg["message"] = "Operation Commit"; context.Response.Write(responseMsg); break; case "delete": var _rem_forum = JsonConvert.DeserializeObject <Tags_Struct>(json); TagsBLL.Delete(_rem_forum.TagID); break; case "load_tags": tagType = 0; if (context.Request.Params["ttype"] != null) { tagType = Convert.ToInt32(context.Request.Params["ttype"]); } if (context.Request.Params["records"] != null) { Records = Convert.ToInt32(context.Request.Params["records"]); } if (context.Request.Params["p"] != null) { PageNumber = Convert.ToInt32(context.Request.Params["p"]); } if (context.Request.Params["o"] != null) { Order = context.Request.Params["o"].ToString(); } if (context.Request.Params["iscache"] != null) { isCache = Convert.ToBoolean(context.Request.Params["iscache"]); } var _ld_json = JsonConvert.DeserializeObject <Tags_Struct>(json); _ld_json.Tag_Level = 100; var _vObject = new TagsObject() { Data = TagsBLL.Cache_FetchRecentTags_V2(_ld_json.Term, _ld_json.Type, tagType, _ld_json.Tag_Level, 1, Records, PageNumber, Order, isCache), Count = TagsBLL.CountRecentTags_V2(_ld_json.Term, _ld_json.Type, tagType, _ld_json.Tag_Level, 1) }; var _ld_tag_data = new Dictionary <string, TagsObject>(); _ld_tag_data["data"] = _vObject; context.Response.Write(_ld_tag_data); break; } } else { // No action found responseMsg["status"] = "error"; responseMsg["message"] = "No action found"; context.Response.Write(JsonConvert.SerializeObject(responseMsg)); } }
protected override GetMemberInfoRD ProcessRequest(DTO.Base.APIRequest <GetMemberInfoRP> pRequest) { GetMemberInfoRD rd = new GetMemberInfoRD(); rd.MemberInfo = new MemberInfo(); var vipLoginBLL = new VipBLL(base.CurrentUserInfo); //如果有一个查询标识非空,就用查询标识查,发现没有会员就报错 if (!string.IsNullOrEmpty(pRequest.Parameters.SearchFlag)) { List <IWhereCondition> complexCondition = new List <IWhereCondition> { }; complexCondition.Add(new EqualsCondition() { FieldName = "ClientID", Value = CurrentUserInfo.ClientID }); var cond1 = new LikeCondition() { FieldName = "VipName", Value = "%" + pRequest.Parameters.SearchFlag + "%" }; var cond2 = new LikeCondition() { FieldName = "VipRealName", Value = "%" + pRequest.Parameters.SearchFlag + "%" }; var com1 = new ComplexCondition() { Left = cond1, Right = cond2, Operator = LogicalOperators.Or }; var cond3 = new EqualsCondition() { FieldName = "Phone", Value = pRequest.Parameters.SearchFlag }; var com2 = new ComplexCondition() { Left = com1, Right = cond3, Operator = LogicalOperators.Or }; complexCondition.Add(com2); complexCondition.Add(new DirectCondition("(WeiXinUserId!='' Or WeiXinUserId IS NOT NULL)")); var tempVipList = vipLoginBLL.Query(complexCondition.ToArray(), null); if (tempVipList != null && tempVipList.Length != 0) { pRequest.UserID = pRequest.Parameters.MemberID = tempVipList[0].VIPID; } } string m_MemberID = ""; if (!string.IsNullOrWhiteSpace(pRequest.Parameters.OwnerVipID)) { m_MemberID = string.IsNullOrWhiteSpace(pRequest.Parameters.OwnerVipID) ? pRequest.UserID : pRequest.Parameters.OwnerVipID; } else { m_MemberID = string.IsNullOrWhiteSpace(pRequest.Parameters.MemberID) ? pRequest.UserID : pRequest.Parameters.MemberID; } string UserID = m_MemberID; var VipLoginInfo = vipLoginBLL.GetByID(UserID); if (VipLoginInfo == null) { throw new APIException("用户不存在") { ErrorCode = 330 } } ; #region 20140909 kun.zou 发现状态为0,改为1 if (VipLoginInfo.Status.HasValue && VipLoginInfo.Status == 0) { VipLoginInfo.Status = 1; vipLoginBLL.Update(VipLoginInfo, false); var log = new VipLogEntity() { Action = "更新", ActionRemark = "vip状态为0的改为1.", CreateBy = UserID, CreateTime = DateTime.Now, VipID = VipLoginInfo.VIPID, LogID = Guid.NewGuid().ToString("N") }; var logBll = new VipLogBLL(base.CurrentUserInfo); logBll.Create(log); } #endregion int couponCount = vipLoginBLL.GetVipCoupon(UserID); rd.MemberInfo.Mobile = VipLoginInfo.Phone; //手机号码 rd.MemberInfo.Name = VipLoginInfo.UserName; //姓名 rd.MemberInfo.VipID = VipLoginInfo.VIPID; //组标识 rd.MemberInfo.VipName = VipLoginInfo.VipName; //会员名 rd.MemberInfo.ImageUrl = VipLoginInfo.HeadImgUrl; //会员头像 add by Henry 2014-12-5 rd.MemberInfo.VipRealName = VipLoginInfo.VipRealName; rd.MemberInfo.VipNo = VipLoginInfo.VipCode; rd.MemberInfo.IsDealer = VipLoginInfo.Col48 != null?int.Parse(VipLoginInfo.Col48) : 0; //超级分销体系配置表 为判断是否存在分销体系使用 var T_SuperRetailTraderConfigbll = new T_SuperRetailTraderConfigBLL(CurrentUserInfo); //获取分销体系信息 var T_SuperRetailTraderConfigInfo = T_SuperRetailTraderConfigbll.QueryByEntity(new T_SuperRetailTraderConfigEntity() { IsDelete = 0, CustomerId = CurrentUserInfo.CurrentUser.customer_id }, null).FirstOrDefault(); if (T_SuperRetailTraderConfigInfo != null) { rd.MemberInfo.CanBeSuperRetailTrader = 1; } else { rd.MemberInfo.CanBeSuperRetailTrader = 0; } rd.MemberInfo.SuperRetailTraderID = VipLoginInfo.Col26; //rd.MemberInfo.Integration = VipLoginInfo.Integration ?? 0;//会员积分 #region 会员有效积分 var vipIntegralBLL = new VipIntegralBLL(CurrentUserInfo); var vipIntegralInfo = vipIntegralBLL.QueryByEntity(new VipIntegralEntity() { VipID = UserID, VipCardCode = VipLoginInfo.VipCode }, null).FirstOrDefault(); if (vipIntegralInfo != null) { rd.MemberInfo.Integration = vipIntegralInfo.ValidIntegral != null ? vipIntegralInfo.ValidIntegral.Value : 0; } #endregion //会员等级 //rd.MemberInfo.VipLevelName = string.IsNullOrEmpty(vipLoginBLL.GetVipLeave(UserID)) ? null : vipLoginBLL.GetVipLeave(UserID); #region 会员卡名称 var vipCardVipMappingBLL = new VipCardVipMappingBLL(CurrentUserInfo); var vipCardBLL = new VipCardBLL(CurrentUserInfo); var vipCardTypeBLL = new SysVipCardTypeBLL(CurrentUserInfo); var vipCardRuleBLL = new VipCardRuleBLL(CurrentUserInfo); var vipT_InoutBLL = new T_InoutBLL(CurrentUserInfo); VipAmountBLL vipAmountBLL = new VipAmountBLL(CurrentUserInfo); ShoppingCartBLL service = new ShoppingCartBLL(CurrentUserInfo); ShoppingCartEntity queryEntity = new ShoppingCartEntity(); queryEntity.VipId = UserID; int totalQty = service.GetListQty(queryEntity); rd.MemberInfo.ShopCartCount = totalQty; //定义当前自定义等级 int?CurVipLevel = 0; var vipCardMappingInfo = vipCardVipMappingBLL.QueryByEntity(new VipCardVipMappingEntity() { VIPID = UserID, CustomerID = CurrentUserInfo.ClientID }, new OrderBy[] { new OrderBy() { FieldName = "CreateTime", Direction = OrderByDirections.Desc } }).FirstOrDefault(); if (vipCardMappingInfo != null) { var vipCardInfo = vipCardBLL.QueryByEntity(new VipCardEntity() { VipCardID = vipCardMappingInfo.VipCardID, VipCardStatusId = 1 }, null).FirstOrDefault(); if (vipCardInfo != null) { var vipCardTypeInfo = vipCardTypeBLL.QueryByEntity(new SysVipCardTypeEntity() { VipCardTypeID = vipCardInfo.VipCardTypeID }, null).FirstOrDefault(); if (vipCardTypeInfo != null) { rd.MemberInfo.VipLevelName = vipCardTypeInfo.VipCardTypeName != null ? vipCardTypeInfo.VipCardTypeName : ""; rd.MemberInfo.CardTypeImageUrl = vipCardTypeInfo.PicUrl != null ? vipCardTypeInfo.PicUrl : ""; rd.MemberInfo.CardTypePrice = vipCardTypeInfo.Prices != null ? vipCardTypeInfo.Prices.Value : 0; rd.MemberInfo.IsExtraMoney = vipCardTypeInfo.IsExtraMoney != null ? vipCardTypeInfo.IsExtraMoney : 0; CurVipLevel = vipCardTypeInfo.VipCardLevel; rd.MemberInfo.IsPrepaid = vipCardTypeInfo.Isprepaid; if (CurVipLevel > 1) { var VipCardTypeSysInfo = vipCardTypeBLL.GetBindVipCardTypeInfo(CurrentUserInfo.ClientID, VipLoginInfo.Phone, pRequest.UserID, CurVipLevel); if (VipCardTypeSysInfo == null || VipCardTypeSysInfo.Tables[0].Rows.Count == 0) { rd.MemberInfo.IsNeedCard = 2; } } else { rd.MemberInfo.IsNeedCard = 1; } //因为卡等级不能重复,知道当前等级后查找相应的下一级是否是自动升级(消费升级) var NextVipCardTypeInfo = vipCardTypeBLL.QueryByEntity(new SysVipCardTypeEntity() { VipCardLevel = CurVipLevel + 1, CustomerID = CurrentUserInfo.ClientID }, null).FirstOrDefault(); if (NextVipCardTypeInfo != null) { //获取当前会员的消费金额信息 decimal CurVipConsumptionAmount = 0; decimal VipConsumptionInfo = vipT_InoutBLL.GetVipSumAmount(UserID); if (VipConsumptionInfo > 0) { CurVipConsumptionAmount = Convert.ToDecimal(Convert.ToDecimal(VipConsumptionInfo).ToString("0.00")); } //知道下一等级后要判断,升级条件是否是消费升级 //定义累积消费金额 decimal AccumulatedAmount = 0; var vipCardTypeUpGradeInfo = vipCardTypeBLL.GetVipCardTypeUpGradeInfo(CurrentUserInfo.ClientID, CurVipLevel); if (vipCardTypeUpGradeInfo != null && vipCardTypeUpGradeInfo.Tables[0].Rows.Count > 0) { //判断拉取的所有卡等级里的最近的一级满足条件即可返回提示所需的值 int flag = 0; foreach (DataRow dr in vipCardTypeUpGradeInfo.Tables[0].Rows) { AccumulatedAmount = Convert.ToDecimal(Convert.ToDecimal(dr["BuyAmount"].ToString()).ToString("0.00")); //获取消费升级还需多少钱 if (AccumulatedAmount > CurVipConsumptionAmount && flag == 0) { flag = 1; rd.MemberInfo.UpGradeNeedMoney = AccumulatedAmount - CurVipConsumptionAmount; if (rd.MemberInfo.UpGradeNeedMoney > 0) { rd.MemberInfo.UpgradePrompt = "还需要消费" + rd.MemberInfo.UpGradeNeedMoney + "元可以升级啦,快点通知会员!"; } } } } } var VipCardRuleInfo = vipCardRuleBLL.QueryByEntity(new VipCardRuleEntity() { CustomerID = CurrentUserInfo.ClientID, VipCardTypeID = vipCardTypeInfo.VipCardTypeID }, null).FirstOrDefault(); if (VipCardRuleInfo != null) { rd.MemberInfo.CardDiscount = Convert.ToDecimal(Convert.ToDecimal((VipCardRuleInfo.CardDiscount / 10)).ToString("0.00")); } } } } else { //表示需要领卡,并展示等级为1的默认卡 rd.MemberInfo.IsNeedCard = 0; var VipCardTypeData = vipCardTypeBLL.QueryByEntity(new SysVipCardTypeEntity() { VipCardLevel = 1, CustomerID = CurrentUserInfo.ClientID }, null).FirstOrDefault(); if (VipCardTypeData != null) { rd.MemberInfo.CardTypeImageUrl = VipCardTypeData.PicUrl != null ? VipCardTypeData.PicUrl : ""; } } //获取红利/// decimal[0]=总收入(红利) decimal[2]=支出余额 decimal[1]=总提现金额 decimal[] array = vipAmountBLL.GetVipSumAmountByCondition(UserID, CurrentUserInfo.ClientID, true); if (array[0] != null) { rd.MemberInfo.ProfitAmount = array[0]; } //是否有付费的会员卡 List <IWhereCondition> freeCardCon = new List <IWhereCondition> { }; freeCardCon.Add(new EqualsCondition() { FieldName = "CustomerID", Value = CurrentUserInfo.ClientID }); freeCardCon.Add(new DirectCondition("Prices>0")); var freeCardTypeInfo = vipCardTypeBLL.Query(freeCardCon.ToArray(), null).FirstOrDefault(); if (freeCardTypeInfo != null) { rd.MemberInfo.IsCostCardType = 1; } else { rd.MemberInfo.IsCostCardType = 0; } #endregion rd.MemberInfo.Status = VipLoginInfo.Status.HasValue ? VipLoginInfo.Status.Value : 1; rd.MemberInfo.CouponsCount = couponCount; rd.MemberInfo.IsActivate = (VipLoginInfo.IsActivate.HasValue && VipLoginInfo.IsActivate.Value == 1 ? true : false); var customerBasicSettingBll = new CustomerBasicSettingBLL(CurrentUserInfo); rd.MemberInfo.MemberBenefits = customerBasicSettingBll.GetMemberBenefits(pRequest.CustomerID); //获取标签信息 TagsBLL TagsBLL = new TagsBLL(base.CurrentUserInfo); var dsIdentity = TagsBLL.GetVipTagsList("", UserID);//“车主标签” 传7 if (dsIdentity != null && dsIdentity.Tables.Count > 0 && dsIdentity.Tables[0].Rows.Count > 0) { rd.IdentityTagsList = DataTableToObject.ConvertToList <TagsInfo>(dsIdentity.Tables[0]).ToArray(); //“年龄段” 传8 } #region 获取注册表单的列明和值 var vipEntity = vipLoginBLL.QueryByEntity(new VipEntity() { VIPID = UserID }, null); if (vipEntity == null || vipEntity.Length == 0) { return(rd); } else { var ds = vipLoginBLL.GetVipColumnInfo(CurrentUserInfo.ClientID, "online005"); var vipDs = vipLoginBLL.GetVipInfo(UserID); if (ds.Tables[0].Rows.Count > 0) { var temp = ds.Tables[0].AsEnumerable().Select(t => new MemberControlInfo() { ColumnName = t["ColumnName"].ToString(), ControlType = Convert.ToInt32(t["ControlType"]), ColumnValue = vipDs.Tables[0].Rows[0][t["ColumnName"].ToString()].ToString(), ColumnDesc = t["columnDesc"].ToString() }); rd.MemberControlList = temp.ToArray(); } } //var vipamountBll = new VipAmountBLL(this.CurrentUserInfo); //var vipAmountEntity = vipamountBll.GetByID(UserID); var unitBll = new UnitBLL(this.CurrentUserInfo); //Hashtable htPara = new Hashtable(); //htPara["MemberID"] = UserID; //htPara["CustomerID"] = CurrentUserInfo.ClientID; //htPara["PageIndex"] = 1; //htPara["PageSize"] = 10; //DataSet dsMyAccount = unitBll.GetMyAccount(htPara); //if (dsMyAccount.Tables[0].Rows.Count > 0) //{ // //rd.AccountList = DataTableToObject.ConvertToList<AccountInfo>(dsMyAccount.Tables[0]); // //rd.MemberInfo.Balance = Convert.ToDecimal(dsMyAccount.Tables[0].Rows[0]["Total"].ToString()); // //rd.TotalPageCount = int.Parse(dsMyAccount.Tables[0].Rows[0]["PageCount"].ToString()); //} //else // rd.MemberInfo.Balance = 0; //返现 add by Henry 2015-4-15 var vipAmountBll = new VipAmountBLL(CurrentUserInfo); //var vipAmountInfo = vipAmountBll.GetByID(UserID); var vipAmountInfo = vipAmountBll.QueryByEntity(new VipAmountEntity() { VipId = UserID, VipCardCode = VipLoginInfo.VipCode }, null).FirstOrDefault(); decimal returnAmount = 0; decimal amount = 0; if (vipAmountInfo != null) { returnAmount = vipAmountInfo.ValidReturnAmount == null ? 0 : vipAmountInfo.ValidReturnAmount.Value; amount = vipAmountInfo.EndAmount == null ? 0 : vipAmountInfo.EndAmount.Value; } rd.MemberInfo.ReturnAmount = returnAmount; //返现 rd.MemberInfo.Balance = amount; //余额 #endregion //获取订单的日期和订单的里的商品名称、商品单价、商品数量 //先获取订单列表,再获取订单详细信息 int? pageSize = 3; //rp.Parameters.PageSize;,只取三条记录 int? pageIndex = 1; //rp.Parameters.PageIndex; string OrderBy = ""; string OrderType = ""; T_InoutBLL T_InoutBLL = new T_InoutBLL(CurrentUserInfo); InoutService InoutService = new InoutService(CurrentUserInfo); //只取状态为700的 //根据订单列表取订单详情 DataSet dsOrder = T_InoutBLL.GetOrdersByVipID(rd.MemberInfo.VipID, pageIndex ?? 1, pageSize ?? 15, OrderBy, OrderType);//获取会员信息 if (dsOrder != null && dsOrder.Tables.Count != 0 && dsOrder.Tables[0].Rows.Count != 0) { List <JIT.CPOS.DTO.Module.VIP.Login.Response.OrderInfo> orderList = DataTableToObject.ConvertToList <JIT.CPOS.DTO.Module.VIP.Login.Response.OrderInfo>(dsOrder.Tables[1]); foreach (JIT.CPOS.DTO.Module.VIP.Login.Response.OrderInfo oi in orderList) { IList <InoutDetailInfo> detailList = InoutService.GetInoutDetailInfoByOrderId(oi.order_id); oi.DetailList = detailList; } rd.OrderList = orderList; } MessageInfo message = new MessageInfo(); InnerGroupNewsBLL InnerGroupNewsService = new InnerGroupNewsBLL(CurrentUserInfo); SetoffToolsBLL setofftoolsService = new SetoffToolsBLL(CurrentUserInfo); //1=微信用户 2=APP员工 int UnReadInnerMessageCount = InnerGroupNewsService.GetVipInnerGroupNewsUnReadCount(CurrentUserInfo.UserID, pRequest.CustomerID, 1, null, Convert.ToDateTime(VipLoginInfo.CreateTime)); var setofftoolsMessageCount = setofftoolsService.GetUnReadSetoffToolsCount(CurrentUserInfo.UserID, pRequest.CustomerID, 1, 1); message.InnerGroupNewsCount = UnReadInnerMessageCount; message.SetoffToolsCount = setofftoolsMessageCount; var VipUpNewsInfo = InnerGroupNewsService.GetVipInnerNewsInfo(CurrentUserInfo.ClientID, 2, 1, 3, 0); if (VipUpNewsInfo != null && VipUpNewsInfo.Tables[0].Rows.Count > 0) { message.UpGradeSucess = VipUpNewsInfo.Tables[0].Rows[0]["Text"] != null ? VipUpNewsInfo.Tables[0].Rows[0]["Text"].ToString() : ""; //获取通知信息 并更新已读状态 数据如果不是一条进行更新所有数据 var newsUserMappingBLL = new NewsUserMappingBLL(CurrentUserInfo); if (VipUpNewsInfo.Tables[0].Rows.Count > 1)//数据如果不是一条进行更新所有数据 { foreach (DataRow VipNewsdr in VipUpNewsInfo.Tables[0].Rows) { var vipNewsInfo = newsUserMappingBLL.QueryByEntity(new NewsUserMappingEntity() { CustomerId = CurrentUserInfo.ClientID, MappingID = VipNewsdr["MappingID"].ToString() }, null).FirstOrDefault(); if (vipNewsInfo != null) { vipNewsInfo.HasRead = 1; newsUserMappingBLL.Update(vipNewsInfo); } } } else { var vipNewsInfo = newsUserMappingBLL.QueryByEntity(new NewsUserMappingEntity() { CustomerId = CurrentUserInfo.ClientID, MappingID = VipUpNewsInfo.Tables[0].Rows[0]["MappingID"].ToString() }, null).FirstOrDefault(); if (vipNewsInfo != null) { vipNewsInfo.HasRead = 1; newsUserMappingBLL.Update(vipNewsInfo); } } } else { message.UpGradeSucess = ""; } rd.MessageInfo = message; return(rd); } }