Beispiel #1
0
 public ActionResult EditFolder(WS_Folder folder)
 {
     try
     {
         // TODO: Add insert logic here
         //  _db.WS_Folders.Add(folder);
         _db.WS_Folders.Find(folder.Id).Name = folder.Name;
         _db.SaveChanges();
         return(View("Index"));
     }
     catch
     {
         return(View("Index"));
     }
 }
Beispiel #2
0
        public ActionResult _CreateFolder(int folderId)
        {
            WS_Folder model;

            if (folderId > 0)
            {
                model = _db.WS_Folders.Find(folderId);
            }
            else
            {
                model = new WS_Folder()
                {
                    Parent_Id = null
                };
            }
            return(PartialView(model));
        }
Beispiel #3
0
 public ActionResult CreateFolder(WS_Folder folder)
 {
     try
     {
         if (folder.Parent_Id == 0)
         {
             folder.Parent_Id = null;
         }
         // TODO: Add insert logic here
         _db.WS_Folders.Add(folder);
         _db.SaveChanges();
         return(View("Index"));
     }
     catch (Exception e)
     {
         return(View("Index"));
     }
 }