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

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