public ActionResult Create(EAppsModels eappsmodels) { if (ModelState.IsValid) { db.EApps.Add(eappsmodels); db.SaveChanges(); return RedirectToAction("Index"); } return View(eappsmodels); }
public void updateEAppsTable(String Agent, String Subject, DateTime Received, DateTime Sent, Attachment Application) { // Create a new EAppsModel EAppsModels eapp = new EAppsModels(); eapp.Agent = Agent; eapp.Subject = Subject; eapp.Received = Received; eapp.Sent = Sent; eapp.Application = "C:\\Attachments\\" + Application.Name; // Submit the changes db.EApps.Add(eapp); db.SaveChanges(); // Save application to the directory SaveAs(Application); }
public ActionResult Edit(EAppsModels eappsmodels) { if (ModelState.IsValid) { if (eappsmodels.GroupAssigned == "CLTeamUsers") { // create model and get the values from the old model CLTeams CLTeams = new CLTeams(); CLTeams.Agent = eappsmodels.Agent; CLTeams.Application = eappsmodels.Application; CLTeams.Comments = eappsmodels.Comments; CLTeams.GroupAssigned = eappsmodels.GroupAssigned; CLTeams.Received = eappsmodels.Received; CLTeams.Sent = eappsmodels.Sent; CLTeams.Subject = eappsmodels.Subject; CLTeams.UserAssigned = eappsmodels.UserAssigned; // add data to database db.CLTeams.Add(CLTeams); db.SaveChanges(); // find the old record and remove EAppsModels eapp = db.EApps.Find(eappsmodels.ID); db.EApps.Remove(eapp); db.SaveChanges(); return RedirectToAction("Index"); } else { db.Entry(eappsmodels).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } } return View(eappsmodels); }
public ActionResult Edit(EAppsModels eappsmodels) { if (ModelState.IsValid) { db.Entry(eappsmodels).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(eappsmodels); }
public void updateEAppsTable(String Agent, String Subject, DateTime Received, DateTime Sent) { // Create a new EAppsModel EAppsModels eapp = new EAppsModels(); eapp.Agent = Agent; eapp.Subject = Subject; eapp.Received = Received; eapp.Sent = Sent; // Submit the changes db.EApps.Add(eapp); db.SaveChanges(); }