public async Task <ActionResult> DeleteConfirmed(int id) { ApplicConf applicConf = await db.ApplicConfs.FindAsync(id); db.ApplicConfs.Remove(applicConf); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
// GET: ApplicConfs/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ApplicConf applicConf = await db.ApplicConfs.FindAsync(id); if (applicConf == null) { return(HttpNotFound()); } return(View(applicConf)); }
public async Task <ActionResult> Create([Bind(Include = "Id,FileSystemUpload,ADActive,EmailConfirmation,ModifiedBy,Modified,AppAdmin,BackAdmin,LDAPConn,LDAPPath,ManageHREmail,ManageHREmailPass,SMTPHost,SMTPPort,EnableSSL")] ApplicConf applicConf) { if (ModelState.IsValid) { if ((applicConf.ADActive == true && (applicConf.LDAPConn == null || applicConf.LDAPPath == null) || (applicConf.EmailConfirmation == true && (applicConf.ManageHREmail == null || applicConf.ManageHREmailPass == null || applicConf.SMTPHost == null || applicConf.SMTPPort == null)) )) { TempData["msg"] = "<script>alert('If ADActive or Email Confirmation is true you must provide all other LDAP or EMAIL Server information');</script>"; } else { db.ApplicConfs.Add(applicConf); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } } return(View(applicConf)); }