public ActionResult EditStep(string dbServer, Guid jobID, int stepID) { JobSteps jobSteps = new JobSteps(); PopulateDropDowns dropdown = new PopulateDropDowns(); JobStepDetailsModel step = new JobStepDetailsModel(); List <SelectListItem> databaseList = new List <SelectListItem>(); List <SelectListItem> proxyList = new List <SelectListItem>(); List <SelectListItem> actionList = new List <SelectListItem>(); databaseList = dropdown.getDatabases(dbServer); ViewBag.DatabaseList = databaseList; proxyList = dropdown.getProxies(dbServer, AgentSubSystem.TransactSql); ViewBag.ProxyList = proxyList; actionList = dropdown.getActions(dbServer, jobID, stepID); ViewBag.ActionList = actionList; ViewBag.ServerName = dbServer; ViewBag.JobID = jobID; step = jobSteps.getStepDetails(dbServer, jobID, stepID); return(View(step)); }
public ActionResult EditStep(JobStepDetailsModel step) { if (ModelState.IsValid) { JobSteps jobSteps = new JobSteps(); jobSteps.saveStepDetails(step); ViewBag.ServerName = step.ServerName; ViewBag.JobID = step.JobID; LogActivity log = new LogActivity(); log.Add(User.Identity.Name, step.ServerName, step.JobID, "Edit Step"); return(RedirectToAction("Steps", "Edit", new { dbServer = step.ServerName, jobID = step.JobID })); } else { PopulateDropDowns dropdown = new PopulateDropDowns(); List <SelectListItem> databaseList = new List <SelectListItem>(); List <SelectListItem> proxyList = new List <SelectListItem>(); List <SelectListItem> actionList = new List <SelectListItem>(); databaseList = dropdown.getDatabases(step.ServerName); ViewBag.DatabaseList = databaseList; proxyList = dropdown.getProxies(step.ServerName, AgentSubSystem.TransactSql); ViewBag.ProxyList = proxyList; actionList = dropdown.getActions(step.ServerName, step.JobID, step.StepNo); ViewBag.ActionList = actionList; ViewBag.ServerName = step.ServerName; ViewBag.JobID = step.JobID; return(View(step)); } }