Exemplo n.º 1
0
 static public void Save(HttpPostedFileBase template, Facult facult, out bool isValid)
 {
     isValid = IsValid(template);
     if (isValid)
     {
         Save(template, facult);
     }
 }
Exemplo 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;
 }
Exemplo 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);
 }
Exemplo 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);
     }
 }
Exemplo 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);
                }
            }
        }
Exemplo n.º 6
0
        public ActionResult Edit(Facult facult)
        {
            if (ModelState.IsValid)
            {
                _db.Facults.Edit(facult);
                _db.SaveChanges();

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