コード例 #1
0
ファイル: Add.cs プロジェクト: huaminglee/myyyyshop
 protected void btnSave_Click(object sender, EventArgs e)
 {
     string str = this.txtTypeName.Text.Trim();
     if (str.Length == 0)
     {
         MessageBox.ShowServerBusyTip(this, "专辑类型的名称不能为空!");
     }
     else
     {
         string str2 = this.txtRemark.Text.Trim();
         if (str2.Length > 200)
         {
             MessageBox.ShowServerBusyTip(this, "备注不能超过200个字符!");
         }
         else
         {
             Maticsoft.Model.SNS.AlbumType model = new Maticsoft.Model.SNS.AlbumType {
                 TypeName = str,
                 IsMenu = this.chkIsMenu.Checked,
                 MenuIsShow = this.chkMenuIsShow.Checked,
                 MenuSequence = Globals.SafeInt(this.txtMenuSequence.Text, 1),
                 AlbumsCount = new int?(Globals.SafeInt(this.txtAlbumsCount.Text, 1)),
                 Status = Globals.SafeInt(this.radlStatus.SelectedValue, 0),
                 Remark = str2
             };
             Maticsoft.BLL.SNS.AlbumType type2 = new Maticsoft.BLL.SNS.AlbumType();
             int num = type2.Add(model);
             if (num > 0)
             {
                 LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "添加专辑类型(id=" + num + ")成功", this);
                 MessageBox.ShowSuccessTip(this, Site.TooltipSaveOK, "TypeList.aspx");
             }
             else
             {
                 LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "添加专辑类型(id=" + num + ")失败", this);
                 MessageBox.ShowServerBusyTip(this, Site.TooltipSaveError);
             }
         }
     }
 }
コード例 #2
0
 public ActionResult TypeIndex(int AlbumType, int? pageIndex)
 {
     Maticsoft.Model.SNS.AlbumType model = new Maticsoft.BLL.SNS.AlbumType().GetModel(AlbumType);
     if (model == null)
     {
         return base.RedirectToAction("Index");
     }
     ((dynamic) base.ViewBag).TypeName = model.TypeName;
     int pageSize = this._basePageSize + this._waterfallSize;
     ((dynamic) base.ViewBag).BasePageSize = this._basePageSize;
     IPageSetting pageSetting = PageSetting.GetPageSetting("AblumList", ApplicationKeyType.SNS);
     pageSetting.Replace(new string[][] { new string[] { "{cname}", model.TypeName } });
     ((dynamic) base.ViewBag).Title = pageSetting.Title;
     ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords;
     ((dynamic) base.ViewBag).Description = pageSetting.Description;
     pageIndex = new int?((pageIndex.HasValue && (pageIndex.Value > 1)) ? pageIndex.Value : 1);
     int startIndex = (pageIndex.Value > 1) ? (((pageIndex.Value - 1) * pageSize) + 1) : 0;
     int endIndex = (pageIndex.Value > 1) ? ((startIndex + this._basePageSize) - 1) : this._basePageSize;
     int recordCount = 0;
     Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums();
     recordCount = albums.GetRecordCount(AlbumType);
     ((dynamic) base.ViewBag).CurrentPageAjaxStartIndex = endIndex;
     int num5 = pageIndex.Value * pageSize;
     ((dynamic) base.ViewBag).CurrentPageAjaxEndIndex = (num5 > recordCount) ? recordCount : num5;
     if (recordCount < 1)
     {
         return base.View();
     }
     int? nullable = pageIndex;
     PagedList<AlbumIndex> list = albums.GetListForPage(AlbumType, "", startIndex, endIndex, base.UserAlbumDetailType).ToPagedList<AlbumIndex>(nullable.HasValue ? nullable.GetValueOrDefault() : 1, pageSize, new int?(recordCount));
     if (base.Request.IsAjaxRequest())
     {
         return this.PartialView("AlbumList", list);
     }
     return base.View(list);
 }
コード例 #3
0
 public ActionResult Index()
 {
     List<Maticsoft.Model.SNS.AlbumType> indexList = new Maticsoft.BLL.SNS.AlbumType().GetIndexList();
     IPageSetting pageSetting = PageSetting.GetPageSetting("Ablum", ApplicationKeyType.SNS);
     ((dynamic) base.ViewBag).Title = pageSetting.Title;
     ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords;
     ((dynamic) base.ViewBag).Description = pageSetting.Description;
     return base.View(indexList);
 }
コード例 #4
0
 public ActionResult Create()
 {
     Action<Maticsoft.Model.SNS.AlbumType> action = null;
     ((dynamic) base.ViewBag).Title = "创建新专辑";
     CreateAlbum createAlbum = new CreateAlbum();
     List<Maticsoft.Model.SNS.AlbumType> modelListByCache = new Maticsoft.BLL.SNS.AlbumType().GetModelListByCache(Maticsoft.Model.SNS.EnumHelper.Status.Enabled);
     createAlbum.TypeList = new List<SelectListItem>();
     if (modelListByCache != null)
     {
         if (action == null)
         {
             action = delegate (Maticsoft.Model.SNS.AlbumType xx) {
                 SelectListItem item = new SelectListItem {
                     Text = xx.TypeName,
                     Value = xx.ID.ToString(),
                     Selected = false
                 };
                 createAlbum.TypeList.Add(item);
             };
         }
         modelListByCache.ForEach(action);
     }
     return base.View(createAlbum);
 }
コード例 #5
0
 public ActionResult AlbumEdit(int AlbumId)
 {
     ((dynamic) base.ViewBag).Title = "编辑专辑";
     Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums();
     Maticsoft.BLL.SNS.UserAlbumsType type = new Maticsoft.BLL.SNS.UserAlbumsType();
     Maticsoft.BLL.SNS.AlbumType type2 = new Maticsoft.BLL.SNS.AlbumType();
     Maticsoft.Model.SNS.UserAlbums model = albums.GetModel(AlbumId);
     List<Maticsoft.Model.SNS.AlbumType> modelList = type2.GetModelList("Status=1");
     List<SelectListItem> list2 = new List<SelectListItem>();
     SelectListItem item2 = new SelectListItem {
         Value = "0",
         Text = "请选择"
     };
     list2.Add(item2);
     if ((modelList != null) && (modelList.Count > 0))
     {
         foreach (Maticsoft.Model.SNS.AlbumType type3 in modelList)
         {
             SelectListItem item = new SelectListItem {
                 Value = type3.ID.ToString(),
                 Text = type3.TypeName
             };
             list2.Add(item);
         }
         ((dynamic) base.ViewBag).TypeList = list2;
     }
     if (model == null)
     {
         return new EmptyResult();
     }
     Maticsoft.Model.SNS.UserAlbumsType modelByUserId = type.GetModelByUserId(model.AlbumID, base.currentUser.UserID);
     model.TypeId = 0;
     if (modelByUserId != null)
     {
         model.TypeId = modelByUserId.TypeID;
     }
     return base.View(model);
 }
コード例 #6
0
 public ActionResult AjaxGetAlbumsType()
 {
     List<Maticsoft.Model.SNS.AlbumType> modelListByCache = new Maticsoft.BLL.SNS.AlbumType().GetModelListByCache(Maticsoft.Model.SNS.EnumHelper.Status.Enabled);
     return base.Content(base.jss.Serialize(modelListByCache));
 }
コード例 #7
0
 public ActionResult AjaxCreateAlbums()
 {
     List<Maticsoft.Model.SNS.AlbumType> modelList = new Maticsoft.BLL.SNS.AlbumType().GetModelList("");
     return base.View(base.CurrentThemeViewPath + "/UserProfile/AjaxCreateAlbums.cshtml", modelList);
 }
コード例 #8
0
ファイル: List.cs プロジェクト: huaminglee/myyyyshop
 public string GetCategoryName(object target)
 {
     string str = string.Empty;
     if (StringPlus.IsNullOrEmpty(target))
     {
         return str;
     }
     int albumId = Globals.SafeInt(target.ToString(), 0);
     if (albumId <= 0)
     {
         return str;
     }
     List<Maticsoft.Model.SNS.AlbumType> typeList = new Maticsoft.BLL.SNS.AlbumType().GetTypeList(albumId);
     if ((typeList == null) || (typeList.Count <= 0))
     {
         return str;
     }
     foreach (Maticsoft.Model.SNS.AlbumType type2 in typeList)
     {
         str = str + type2.TypeName + ",";
     }
     return str.Substring(0, str.LastIndexOf(","));
 }
コード例 #9
0
 public ActionResult Albums(int? uid, string IsFav)
 {
     if (!this.LoadUserInfo(!uid.HasValue ? 0 : uid.Value))
     {
         if (Maticsoft.Components.MvcApplication.MainAreaRoute == AreaRoute.SNS)
         {
             return this.Redirect("/Account/Login");
         }
         return this.Redirect("/SNS/Account/Login");
     }
     Maticsoft.BLL.SNS.AlbumType type = new Maticsoft.BLL.SNS.AlbumType();
     Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums();
     List<AlbumIndex> model = new List<AlbumIndex>();
     if (!string.IsNullOrEmpty(IsFav))
     {
         model = albums.GetUserFavAlbum(this.UserID, -1);
         ((dynamic) base.ViewBag).IsFav = true;
     }
     else
     {
         model = albums.GetListByUserId(this.UserID, base.UserAlbumDetailType);
     }
     ((dynamic) base.ViewBag).AlbumTypeList = type.GetModelListByCache(Maticsoft.Model.SNS.EnumHelper.Status.Enabled);
     ((dynamic) base.ViewBag).IsCurrentUser = this.IsCurrentUser;
     ((dynamic) base.ViewBag).NickName = this.NickName;
     IPageSetting pageSetting = PageSetting.GetPageSetting("Base", ApplicationKeyType.SNS);
     ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords;
     ((dynamic) base.ViewBag).Description = pageSetting.Description;
     if (<Albums>o__SiteContainer48.<>p__Site4f == null)
     {