public async Task <ActionResult> Post(MachinesNotificationsViewModel viewmodel, int credId, string dataSetId, string dataSetIndexId) { await viewmodel.AddMachineNotification(Session, credId); if (viewmodel.errorOccurred == true) { return(Redirect("/MachineNotification/Index?credId=" + credId + "&dataSetIndexId=" + dataSetIndexId + "&dataSetId=" + dataSetId)); } return(Redirect("/MachineNotification/Index?credId=" + credId + "&dataSetIndexId=" + dataSetIndexId + "&dataSetId=" + dataSetId)); }
public async Task <ActionResult> Delete(string id, string dataSetIndexId, string dataSetId, int credId) { MachinesNotificationsViewModel vmview = new MachinesNotificationsViewModel(); await vmview.DeleteViewMachine(Session, id); if (vmview.errorOccurred == true) { return(Redirect("/MachineNotification/Index?credId=" + credId + "&dataSetIndexId=" + dataSetIndexId + "&dataSetId=" + dataSetId)); } return(Redirect("/MachineNotification/Index?credId=" + credId + "&dataSetIndexId=" + dataSetIndexId + "&dataSetId=" + dataSetId)); }
public async Task <ActionResult> Add(int credId, string dataSetIndexId, string dataSetId) { MachinesNotificationsViewModel viewModel = new MachinesNotificationsViewModel(); ViewBag.dataSetId = dataSetId; ViewBag.credId = credId; ViewBag.dataSetIndexId = dataSetIndexId; await viewModel.dataSetName(Session, dataSetId); //await viewModel.AddMachineNotification(Session, credId); viewModel.notificationPost = new MachineNotificationPost(); return(View(viewModel)); }
public async Task <ActionResult> Edit(string id, int credId, string dataSetIndexId, string dataSetId) { MachinesNotificationsViewModel viewModel = new MachinesNotificationsViewModel(); ViewBag.dataSetId = dataSetId; ViewBag.credId = credId; ViewBag.dataSetIndexId = dataSetIndexId; ViewBag.id = id; await viewModel.dataSetName(Session, dataSetId); await viewModel.GetViewMachineNotification(Session, id, credId); if (viewModel.errorOccurred == true) { return(Redirect("/MachineNotification/Index?credId=" + credId + "&dataSetIndexId=" + dataSetIndexId + "&dataSetId=" + dataSetId)); } return(View(viewModel)); }
public async Task <ActionResult> Index(int credId, string dataSetIndexId, string dataSetId) { MachinesNotificationsViewModel viewModel = new MachinesNotificationsViewModel(); ViewBag.dataSetId = dataSetId; ViewBag.dataSetIndexId = dataSetIndexId; await viewModel.dataSetName(Session, dataSetId); await viewModel.GetAllMachineEmailRecipients(Session, credId); if (viewModel.errorOccurred) { return(RedirectToAction("Index", "Authenticate")); } else { return(View(viewModel)); } }