static public void Save(HttpPostedFileBase template, Facult facult, out bool isValid) { isValid = IsValid(template); if (isValid) { Save(template, facult); } }
public static Facult Update(HttpPostedFileBase template, Facult facult) { if (template == null) return facult; Delete(facult); Save(template, facult); facult.IsReady = false; return facult; }
static public Facult Update(HttpPostedFileBase template, Facult facult) { if (template == null) { return(facult); } Delete(facult); Save(template, facult); facult.IsReady = false; return(facult); }
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); } }
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); } } }
public ActionResult Edit(Facult facult) { if (ModelState.IsValid) { _db.Facults.Edit(facult); _db.SaveChanges(); return RedirectToAction("Index"); } return View(facult); }
public static Facult Update(HttpPostedFileBase template, Facult facult, out bool isValid) { isValid = IsValid(template); return !isValid ? facult : Update(template, facult); }
public static void Save(HttpPostedFileBase template, Facult facult, out bool isValid) { isValid = IsValid(template); if (isValid) Save(template, facult); }
public static void Save(HttpPostedFileBase template, Facult facult) { template.SaveAs(Path(facult.FacultId)); }
static public Facult Update(HttpPostedFileBase template, Facult facult, out bool isValid) { isValid = IsValid(template); return(!isValid ? facult : Update(template, facult)); }
static public void Save(HttpPostedFileBase template, Facult facult) { template.SaveAs(Path(facult.FacultId)); }