public WindowsTasksStatusModel(WindowsTask task) { if (task == null) { throw new ArgumentNullException(nameof(task)); } _taskExists = true; _taskPath = task.FullPath; _displayName = task.Name; _isTaskEnabled = task.Enabled; }
public IActionResult Edit(WindowsTasks task) { if (task.ActionFile.Length > 0) { // string filePath = $@"\\{localIP}\c$" + _folderPath; string filePath = "C:\\WAM\\Uploads\\" + task.ActionFile.FileName; using (var stream = new FileStream(filePath, FileMode.Create)) { task.ActionFile.CopyToAsync(stream); task.ActionFilePath = $@"\\{localIP}" + _folderPath + task.ActionFile.FileName; } } //string server, string username, string domain, string password, string folder, string description, string cronString AM_TaskScheduler.TaskSchedulerManager tm = new AM_TaskScheduler.TaskSchedulerManager(); WindowsTask mTasks = new WindowsTask(task); tm.UpdateTask(mTasks); return(RedirectToAction("Index")); }