Esempio n. 1
0
 static public void Save(HttpPostedFileBase template, Facult facult, out bool isValid)
 {
     isValid = IsValid(template);
     if (isValid)
     {
         Save(template, facult);
     }
 }
Esempio n. 2
0
 public static Facult Update(HttpPostedFileBase template, Facult facult)
 {
     if (template == null) return facult;
     Delete(facult);
     Save(template, facult);
     facult.IsReady = false;
     return facult;
 }
Esempio n. 3
0
 static public Facult Update(HttpPostedFileBase template, Facult facult)
 {
     if (template == null)
     {
         return(facult);
     }
     Delete(facult);
     Save(template, facult);
     facult.IsReady = false;
     return(facult);
 }
Esempio n. 4
0
 public static void Delete(Facult facult)
 {
     var path = new string[3];
     path[0] = Path(facult.FacultId);
     path[1] = Path(facult.FacultId, 1);
     path[2] = Path(facult.FacultId, 2);
     foreach (var p in path)
     {
         if (File.Exists(p))
             File.Delete(p);
     }
 }
Esempio n. 5
0
        static public void Delete(Facult facult)
        {
            var path = new string[3];

            path[0] = Path(facult.FacultId);
            path[1] = Path(facult.FacultId, 1);
            path[2] = Path(facult.FacultId, 2);
            foreach (var p in path)
            {
                if (File.Exists(p))
                {
                    File.Delete(p);
                }
            }
        }
Esempio n. 6
0
        public ActionResult Edit(Facult facult)
        {
            if (ModelState.IsValid)
            {
                _db.Facults.Edit(facult);
                _db.SaveChanges();

                return RedirectToAction("Index");
            }
            return View(facult);
        }
Esempio n. 7
0
 public static Facult Update(HttpPostedFileBase template, Facult facult, out bool isValid)
 {
     isValid = IsValid(template);
     return !isValid ? facult : Update(template, facult);
 }
Esempio n. 8
0
 public static void Save(HttpPostedFileBase template, Facult facult, out bool isValid)
 {
     isValid = IsValid(template);
     if (isValid)
         Save(template, facult);
 }
Esempio n. 9
0
 public static void Save(HttpPostedFileBase template, Facult facult)
 {
     template.SaveAs(Path(facult.FacultId));
 }
Esempio n. 10
0
 static public Facult Update(HttpPostedFileBase template, Facult facult, out bool isValid)
 {
     isValid = IsValid(template);
     return(!isValid ? facult : Update(template, facult));
 }
Esempio n. 11
0
 static public void Save(HttpPostedFileBase template, Facult facult)
 {
     template.SaveAs(Path(facult.FacultId));
 }