Пример #1
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);
 }