示例#1
0
 public ActionResult SetStore(string ids)
 {
     if (!string.IsNullOrWhiteSpace(ids))
     {
         FileManageStoreBLL fms = new FileManageStoreBLL();
         var user = ERCHTMS.Code.OperatorProvider.Provider.Current();
         var list = ids.Split(',');
         foreach (var id in list)
         {
             var entity = fms.GetList(string.Format(" and userid='{0}' and FileManageId='{1}'", user.UserId, id)).FirstOrDefault();
             if (entity == null)
             {
                 entity = new FileManageStoreEntity()
                 {
                     UserId       = user.UserId,
                     FileManageId = id
                 };
                 fms.SaveForm("", entity);
             }
         }
         return(Success("收藏成功。"));
     }
     else
     {
         return(Error("收藏失败。"));
     }
 }
示例#2
0
 public ActionResult RemoveStore(string ids)
 {
     if (!string.IsNullOrWhiteSpace(ids))
     {
         FileManageStoreBLL fms = new FileManageStoreBLL();
         var user = ERCHTMS.Code.OperatorProvider.Provider.Current();
         var list = fms.GetList(string.Format(" and userid='{0}' and FileManageId in ('{1}')", user.UserId, ids.Replace(",", "','"))).ToList();
         fms.RemoveForm(list);
         return(Success("取消成功。"));
     }
     else
     {
         return(Error("取消失败。"));
     }
 }