Example #1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     string msg = "";
     if (this.txtTypeName.Text.Trim().Length == 0)
     {
         msg = msg + @"达人类型(如新晋达人不能为空!\n";
     }
     if (msg != "")
     {
         MessageBox.Show(this, msg);
     }
     else
     {
         string text = this.txtTypeName.Text;
         string str3 = this.txtCheckRule.Text;
         string str4 = this.txtRemark.Text;
         int num = Globals.SafeInt(this.radlStatus.SelectedValue, 0);
         Maticsoft.Model.SNS.StarType model = new Maticsoft.Model.SNS.StarType {
             TypeName = text,
             CheckRule = str3,
             Remark = str4,
             Status = new int?(num)
         };
         Maticsoft.BLL.SNS.StarType type2 = new Maticsoft.BLL.SNS.StarType();
         int num2 = 0;
         num2 = type2.Add(model);
         if (num2 > 0)
         {
             LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "增加达人类型(ID=" + num2 + ")成功", this);
             MessageBox.ShowSuccessTip(this, "保存成功!", "StarTypeList.aspx");
         }
     }
 }
Example #2
0
 protected string GetStarType(object target)
 {
     string str = string.Empty;
     if (StringPlus.IsNullOrEmpty(target))
     {
         return str;
     }
     Maticsoft.BLL.SNS.StarType type = new Maticsoft.BLL.SNS.StarType();
     int typeID = Globals.SafeInt(target.ToString(), 0);
     Maticsoft.Model.SNS.StarType model = type.GetModel(typeID);
     if (model != null)
     {
         return model.TypeName;
     }
     return "";
 }
Example #3
0
 public ActionResult StarType()
 {
     Maticsoft.BLL.SNS.StarType type = new Maticsoft.BLL.SNS.StarType();
     ((dynamic) base.ViewBag).StarType = base.Request.Params["StarType"];
     List<Maticsoft.Model.SNS.StarType> modelList = type.GetModelList("");
     if ((modelList != null) && (modelList.Count > 0))
     {
         return base.View("_StarType", modelList);
     }
     return base.View("_StarType");
 }
Example #4
0
 public ActionResult Pioneer(int pageIndex = 1, int StarType = 0)
 {
     ((dynamic) base.ViewBag).Title = "达人排行";
     Maticsoft.BLL.SNS.StarType type = new Maticsoft.BLL.SNS.StarType();
     Stars model = new Stars();
     if (StarType == 0)
     {
         ((dynamic) base.ViewBag).Type = "Index";
         ((dynamic) base.ViewBag).TypeName = "综合推荐";
         model.HotStarList = this.starRankBll.HotStarList(4);
     }
     else
     {
         Maticsoft.Model.SNS.StarType type2 = type.GetModel(StarType);
         ((dynamic) base.ViewBag).TypeName = type2.TypeName;
     }
     IPageSetting pageSetting = PageSetting.GetPageSetting("Star", ApplicationKeyType.SNS);
     ((dynamic) base.ViewBag).Title = pageSetting.Title;
     ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords;
     ((dynamic) base.ViewBag).Description = pageSetting.Description;
     model.StarNewList = this.starBll.GetStarNewList(StarType, 10);
     model.StarRankList = this.starRankBll.GetStarRankList(StarType, 10);
     int pageSize = this._basePageSize + this._waterfallSize;
     ((dynamic) base.ViewBag).BasePageSize = this._basePageSize;
     pageIndex = (pageIndex > 1) ? pageIndex : 1;
     int startIndex = (pageIndex > 1) ? (((pageIndex - 1) * pageSize) + 1) : 0;
     int endIndex = (pageIndex > 1) ? ((startIndex + this._basePageSize) - 1) : this._basePageSize;
     int countByType = 0;
     countByType = this.starBll.GetCountByType(StarType);
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int num5 = pageIndex * pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = (num5 > countByType) ? countByType : num5;
     int currentUserId = (base.currentUser != null) ? base.currentUser.UserID : 0;
     if ((countByType < 1) && (StarType != 0))
     {
         return base.RedirectToAction("Pioneer");
     }
     model.StarPagedList = this.starBll.GetListForPage(StarType, "", startIndex, endIndex, currentUserId).ToPagedList<ViewStar>(pageIndex, pageSize, new int?(countByType));
     if (base.Request.IsAjaxRequest())
     {
         return this.PartialView("StarList", model);
     }
     return base.View(model);
 }