public TaskClass getTask() { TaskClass task = new TaskClass(); task.serviceVisitID = this.serviceVisitID; task.lastService = this.lastService; task.thisResult = (TaskResultStatus)Enum.Parse(typeof(TaskResultStatus), this.thisResult); task.lastResult = (TaskResultStatus)Enum.Parse(typeof(TaskResultStatus), this.lastResult); task.taskType = this.taskType; task.serviceVisitItemNumber = this.serviceVisitItemNumber; task.taskName = this.taskName; task.siteEquipmentLineNumber = this.siteEquipmentLineNumber; task.siteID = this.siteID; TaskInformation taskInfo = new TaskInformation(); taskInfo.contractor = this.contractor; taskInfo.taskTypeDescription = this.taskTypeDescription; taskInfo.location = this.location; taskInfo.barcode = this.barcode; taskInfo.opNumber = this.opNumber; taskInfo.isMoving2012Standard = this.isMoving2012Standard; taskInfo.maintainedStandard = this.maintainedStandard; taskInfo.lastServicedBy = this.lastServicedBy; task.taskInformation = taskInfo; return(task); }
private ERR_RESULT inner_CreateTest(TaskClass tskObj, XElement objectsNode) { ERR_RESULT result = new ERR_RESULT(); XElement testNode = null; XElement imgRefNode = null; try { testNode = new XElement("test"); foreach (UInt32 key in tskObj.p_ImageFileKeys) { TaskClass.IMAGEFILEPATH img = tskObj.p_ImageFileMaps[key]; imgRefNode = new XElement("ImgRef", new XAttribute("Ref", img.id)); testNode.Add(imgRefNode); } objectsNode.Add(testNode); return(result); } catch (_XmlException err) { result = ErrProcess.SetErrResult(err); return(result); } catch (Exception err) { result = ErrProcess.SetErrResult(err); return(result); } }
public void CanInjectAndExtractWithClasses() { IInjectionContext injection = new InjectionClass(); injection.State = 1; IBuildContext context = new BuildContext(); context.SetContextObject(injection); TaskClass task = new TaskClass(2); Assert.IsNull(task.InjectedObject); ContextInjector.Inject(context, task); Assert.IsNotNull(task.InjectedObject); Assert.AreEqual(1, task.InjectedObject.State); ReturnCode result = task.Run(); Assert.AreEqual(ReturnCode.Success, result); ContextInjector.Extract(context, task); IInjectionContext modifiedInjection = context.GetContextObject <IInjectionContext>(); Assert.AreEqual(task.NewState, modifiedInjection.State); }
public async void UpdateTask() { if (Singleton.GetTaskId() != 0) { var updatedItem = new TaskClass( Singleton.GetTaskId(), Tvm.SelectedItem.TaskName = Singleton.GetTaskName(), Tvm.SelectedItem.TaskSchedule = Singleton.GetTaskSchedule(), null, Tvm.SelectedItem.TaskType = Singleton.GetTaskType(), Dc.ConvertToDate(_updateVm.DueDate), null, null, Tvm.SelectedItem.DoneVar = Singleton.GetDoneVar(), Tvm.SelectedItem.EquipmentId = Singleton.GetEquipmentId() ); await _update.Update(updatedItem, "Tasks", Singleton.GetTaskId()); GoTask(); var msg = new MessageDialog("Task updated"); await msg.ShowAsync(); } else { var msg = new MessageDialog("Please select item"); await msg.ShowAsync(); } }
public static void CreateTaskModel(object obj) { // mktaskmodel -n 7 1(classId) 等待到達量 掛文號 印兩份一份存查 等繳費證明 掃描繳費證明 拿黏貼憑證 給承辦人 object[] args = (object[])obj; short stepCount = Convert.ToInt16(args[0]); int classId = Convert.ToInt32(args[1]); TaskClass tc = (from t in db.TaskClass where t.TCID == classId select t).FirstOrDefault(); TaskModel tm = new TaskModel(); tm.StepCount = stepCount; tm.TCID = tc.TCID; db.TaskModel.Add(tm); for (short i = 0; i < stepCount; i++) { TaskModelDetail tmd = new TaskModelDetail(); tmd.TMID = tm.TMID; tmd.Step = i; tmd.Description = (string)args[i + 2]; db.TaskModelDetail.Add(tmd); } db.SaveChanges(); }
private TaskClass PostDoneTask(DateTime newDate, string doneVariable) { if (SelectedTask.TaskId != 0) { TaskClass newReSchedule = new TaskClass( TaskVm.SelectedItem.TaskId, TaskVm.SelectedItem.TaskName, TaskVm.SelectedItem.TaskSchedule, TaskVm.SelectedItem.Registration, TaskVm.SelectedItem.TaskType, TaskVm.SelectedItem.DueDate, newDate, TaskVm.SelectedItem.Comment, doneVariable, TaskVm.SelectedItem.EquipmentId ); _savedTaskClass.Save(newReSchedule, "Tasks"); ReScheduleTask(); _frameNavigation.ActivateFrameNavigation(typeof(MenuPage)); var msg = new MessageDialog("Task saved"); msg.ShowAsync(); return(newReSchedule); } else { var msg = new MessageDialog("Please select the task!"); msg.ShowAsync(); } return(null); }
private List <ImageItem> inner_SetCommonImageItem(TaskClass tsk) { TaskClass.IMAGEFILEPATH path; List <ImageItem> items = new List <ImageItem>(); ImageItem item = null; String fileName = null; try { foreach (UInt32 key in tsk.p_ImageFileKeys) { path = tsk.p_ImageFileMaps[key]; item = new ImageItem(); item.p_Image_uri = path.targetPath; fileName = ExtractDropFileName(path.targetPath);//파일네임 추출 item.p_FileName = fileName; item.p_ImgId = uint.Parse(path.id.Split('_')[1]); items.Add(item); } return(items); } catch (Exception ex) { MessageBox.Show(ex.Message); return(null); } }
/* * *constructor */ public Img_PicBoxData() { m_PicBoxs = new Dictionary <String, PictureBox>(); m_DectedPicBoxs = new Dictionary <String, PictureBox>(); m_ImgFileName = null; m_TskObj = null; }
public void BeforeTest() { CreateTask = new TaskClass(90, "new name", "Every week", null, "check", DateTime.Now, null, null, "N", 4); Cvm = new CreateTaskVm(); CreateTaskHandler = new CreateTaskHandler(Cvm); Collections = new Collections(); }
private void CreateNewSolution() { //Workspace m_WorkspaceDoc = new WorkSpaceClass(); MAINTREE_UI.ItemsSource = m_WorkspaceDoc.p_Solutions; ProjectClass prj = new ProjectClass { p_Name = "Project1", p_Pareants = m_WorkspaceDoc.p_Solutions[0] }; TaskClass tsk = new TaskClass { p_Name = "Task1", p_Pareants = prj }; ToolClass tl = new ToolClass { p_Name = "Tool1", p_Pareants = tsk }; m_WorkspaceDoc.p_Solutions[0].p_Projects.Add(prj); prj.p_Tasks.Add(tsk); tsk.p_Tools.Add(tl); m_convTreeviewItem = new ConvTreeViewItem(); }
public MainWindowModel() { _taskList = new ObservableCollection <TaskClass>(); _taskClass = new TaskClass(); _taskClass.TaskName = "Task1"; _taskClass.TaskDate = DateTime.Now.ToShortDateString(); _taskClass.TaskTime = DateTime.Now.ToShortTimeString(); _taskList.Add(_taskClass); }
/// <summary> /// 新增、修改任务信息 /// </summary> /// <param name="userID"></param> /// <param name="taskClass"></param> /// <param name="taskNum"></param> /// <returns></returns> public static void SaveUserTask(string userID, TaskClass taskClass, int taskNum) { var taskList = new ConfigCacheSet <TaskInfo>().FindAll(s => s.TaskClass == taskClass); foreach (var info in taskList) { SaveUserTask(userID, info.TaskID, taskNum); } }
public void AddTask() { TaskClass newClass = new TaskClass(); newClass.TaskName = "NewTask"; newClass.TaskDate = DateTime.Now.ToShortDateString(); newClass.TaskTime = DateTime.Now.ToShortTimeString(); TaskList.Add(newClass); }
public void SetData(string name, float timer, long collectID, TaskProgressBarType taskPBType, FubenTaskData data, TaskClass taskclass) { operateNameS = name; dutiaoTime = timer; this.collectgoodsID = collectID; this.taskPBType = taskPBType; fubenTaskData = data; taskClass = taskclass; }
//////////////////////may cause error public IActionResult AddTaskByCourseId(int CourseId, TaskClass newTask) { if (!ModelState.IsValid) { return(BadRequest("enter the whole data please")); } var addedtask = taskClass.AddTask(CourseId, newTask); return(Ok(addedtask)); }
//////////////////////may cause error public IActionResult EditTask(TaskClass EditedTask) { if (!ModelState.IsValid) { return(BadRequest("enter the whole data please")); } var editedTaskInDB = taskClass.EditTask(EditedTask); return(Ok(editedTaskInDB)); }
public void Edit(TaskClass editTask) { Guid guid = editTask.Id; int index = taskMemoryClass.collectionClasses.IndexOf(taskMemoryClass.collectionClasses.FirstOrDefault(c => c.Id == guid)); taskMemoryClass.collectionClasses.RemoveAt(index); TaskClass taskClassEdit = editTask; taskMemoryClass.collectionClasses.Add(taskClassEdit); }
private void OnComletedTaskCommanExecute(object para) { TaskClass taskListView = (TaskClass)para; taskListView.CheckTask = !CheckTask; taskManager.Edit(taskListView); taskManager.Save(); Tasks.Clear(); Tasks = new ObservableCollection <TaskClass>(taskManager.GetAll()); }
protected override void SetUI(params object[] uiParams) { operateNameS = (string)uiParams[0]; dutiaoTime = (float)uiParams[1]; this.collectgoodsID = (long)uiParams[2]; this.taskPBType = (TaskProgressBarType)uiParams[3]; fubenTaskData = (FubenTaskData)uiParams[4]; taskClass = (TaskClass)uiParams[5]; base.SetUI(); }
public async Task <IActionResult> Edit(TaskClass nc) { if (ModelState.IsValid) { _db.Update(nc); await _db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(nc)); }
static void Main(string[] args) { TaskClass task1 = new TaskClass("FirstTask"); TaskClass task2 = new TaskClass("SecondTask"); TaskAction action = new TaskAction(); action.Add(task1); action.Add(task2); action.Delete("FirstTask"); }
private void inner_CopyImagePathToTaskClass(string[] dropFiles, TaskClass task) { string[] tempPath = new string[dropFiles.Length]; string fileName = null; TaskClass.IMAGEFILEPATH path; int i = 0; foreach (string dropfile in dropFiles) { path = new TaskClass.IMAGEFILEPATH(); string dropFileName = ExtractDropFileName(dropfile); string newPath = m_WorkspaceDoc.localPath + "\\" + task.p_Pareants.p_Pareants.p_Name + "\\" + task.p_Pareants.p_Name + "\\" + task.p_Name + "\\" + dropFileName; tempPath[i] = newPath; //Doc → taskClass path.targetPath = tempPath[i]; path.originPath = dropfile; path.FileName = dropFileName; path.id = "IMG_" + ((UInt32)path.GetHashCode()).ToString(); task.p_ImageFileKeys.Add((UInt32)path.GetHashCode()); task.p_ImageFileMaps[(UInt32)path.GetHashCode()] = path; // List <ImageItem> items = new List <ImageItem>(); foreach (UInt32 key in task.p_ImageFileKeys) { path = task.p_ImageFileMaps[key]; ImageItem item = new ImageItem(); string filename = ExtractDropFileName(path.targetPath); item.p_FileName = filename; item.p_ImgId = uint.Parse(path.id.Split('_')[1]); items.Add(item); } //if (IMG_LSTVIEW_UI.ILV_GetImgItems().Count != 0) // IMG_LSTVIEW_UI.ILV_Clearitem(); //foreach (ImageItem item in items) //{ // IMG_LSTVIEW_UI.ILV_insertitem(item); //} i++; } }
public IEnumerable <TaskClass> AddTask(int CourseId, TaskClass NewTask) { var Tasks = DB.Tasks.FromSqlRaw("EXEC dbo.usp_Tasks_Insert {0},{1},{2},{3}" , NewTask.TaskName , CourseId , NewTask.Description , NewTask.DueDate ).ToList <TaskClass>(); return(Tasks); }
/// <summary> /// Записує нову задачу в xml file and List<TasksClass> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonSave_Click(object sender, EventArgs e) { TaskClass taskClass = new TaskClass(); taskClass.Title = textBoxTitle.Text; taskClass.Description = textBoxDescriprion.Text; taskClass.Deadline = DateTime.Parse(textBoxDeadLine.Text); taskClass.Writer(@"Tasks.xml"); Tasks.AddTask(taskClass); ShowListAgain(listBox1, Tasks); }
public IEnumerable <TaskClass> EditTask(TaskClass EditedTask) { var Tasks = DB.Tasks.FromSqlRaw("EXEC dbo.usp_Tasks_Update {0},{1},{2},{3}" , EditedTask.TaskId , EditedTask.TaskName , EditedTask.Description , EditedTask.DueDate ).ToList <TaskClass>(); return(Tasks); }
public bool GetTaskClass(ref TaskClass tc, bool refreshClass = false) { bool isFill = false; if (_tc == null || refreshClass) { _tc = new TaskClass(); isFill = true; } tc = _tc; return(isFill); }
public static void CreateTaskClass(object obj) { object[] args = (object[])obj; string className = (string)args[0]; // Create model class TaskClass tc = new TaskClass(); tc.Name = className; db.TaskClass.Add(tc); db.SaveChanges(); }
private ERR_RESULT inner_CreateImgFilesNode(XElement tskNode, TaskClass tskObj) { ERR_RESULT result = new ERR_RESULT(); XElement imageNode = null; try { //tsk FilePath String tskPath = Environment.CurrentDirectory + "\\" + tskObj.p_Pareants.p_Pareants.p_Name; //solution tskPath += "\\" + tskObj.p_Pareants.p_Name; //Project tskPath += "\\" + tskObj.p_Name; //task int fileCount = tskObj.p_ImageFileMaps.Count(); //1. ImageFile 노드 생성 XElement imgFilesNode = new XElement("ImageFiles"); XAttribute countAtt = new XAttribute("Count", fileCount); XAttribute pathAtt = new XAttribute("Path", tskPath);// imgFilesNode.Add(countAtt); imgFilesNode.Add(pathAtt); String idName = null; for (int index = 0; index < fileCount; index++) { UInt32 key = tskObj.p_ImageFileKeys[index]; //2. Image 노드 생성 //Name att idName = "IMG_" + ((UInt32)key).ToString(); imageNode = new XElement("Image", new XAttribute("Name", idName)); //LDH9999 type att 속성은 추후 imageNode.Value = tskObj.p_ImageFileMaps[key].FileName; imgFilesNode.Add(imageNode); } //tsk노드에 추가 tskNode.Add(imgFilesNode); return(result); } catch (_XmlException err) { result = ErrProcess.SetErrResult(err); return(result); } catch (Exception err) { result = ErrProcess.SetErrResult(err); return(result); } }
public void TestMethod1() { TaskList tasklist = new TaskList(); TaskClass t = new TaskClass(); t.Name = "name"; t.Description = "sdfsdf"; t.Date = DateTime.Now; var addWindow = new ToDoLIst.AddTask(t, tasklist); Assert.Equals(tasklist.AllTasksList.Count , 1); }
private void AddTaskCreate_Click(object sender, RoutedEventArgs e) { TaskClass newTask = new TaskClass { userID = ((Employee)AddTaskUser.SelectedItem).ID, clientID = ((Client)AddTaskClient.SelectedItem).ID, title = AddTaskTitle.Text, subtitle = AddTaskContent.Text.Replace("'", ""), createdDate = DateTime.Now, deadlineDate = AddTaskDeadline.SelectedDate.Value, category = ((Category)AddTaskCategory.SelectedItem).ID, }; Query.Insert.Task(newTask); }
private void changeState() { if (MODE == Mode.SubjectEdit) { PropsPanel.Show(); TaskInfoPanel.Hide(); } if (MODE == Mode.TaskEdit) { PropsPanel.Hide(); TaskInfoPanel.Show(); if (selectednode.Text != "Добавить задание") { foreach (TaskClass tsk in subject.Tasks) { if (selectednode.Text == tsk.Label) { runtime = tsk; } } HeaderTask.Text = runtime.Label; TextTaskBox.Text = runtime.Text; ImageList imglist = new ImageList(); ImageView.View = View.LargeIcon; ImageView.Items.Clear(); int counter = 0; foreach (KeyValuePair <Image, string> img in runtime.Images) { imglist.Images.Add(img.Key); ListViewItem item = new ListViewItem(); item.Tag = img.Value; if (img.Key.Tag != null) { item.Text = (string)img.Key.Tag; } else { item.Text = "В ресурсах"; } item.ImageIndex = counter; counter++; ImageView.Items.Add(item); } imglist.ImageSize = new Size(80, 80); ImageView.LargeImageList = imglist; } } }
protected void OnTaskUpdated(ref Server vcServer, JobClass vcJob, TaskClass vcTask) { UpdateMonitoringTimeMessage(vcServer); if (vcTask.Stats.Status == TaskStatsClass.TaskStatusT.Waiting) { Debug.WriteLine(vcTask.Name); Debug.WriteLine("ExecutionTime: " + vcTask.Stats.ExecutionTime); Debug.WriteLine(vcTask.Stats.Status); var task = new Task(ref vcServer, vcJob, vcTask); var tasks = DbHandler.UpdateTask(task); VisualCronHubHandler.UpdateClients(tasks); } }
public Task(ref Server server, JobClass job, TaskClass task) { Name = task.Name; Group = job.Group; Server = server.IP.ToUpper().Replace(".AD.METASOURCE.COM", "").Replace("DRPR-", ""); JobName = job.Name; CurrentSuccess = task.Stats.Result == "Success" ? 1 : 0; CurrentRunTime = task.Stats.DateLastExecution; CurrentExectutionTimeDuration = task.Stats.ExecutionTime; CurrentStandardOutput = GetStandardOutput(ref server, job, task); RunTimeFrequencyMinutes = Math.Ceiling((job.Stats.DateNextExecution - job.Stats.DateLastExecution).TotalMinutes); if (task.Execute != null) { CommandLine = task.Execute.CmdLine; Arguments = task.Execute.Arguments; WorkingDirectory = task.Execute.WorkingDirectory; } }
private void AddTaskForm_Load(object sender, EventArgs e) { if (NewTask == null) { isNewTask = true; btnComplete.Visible = false; NewTask = new TaskClass(); ordernumber = TaskDBHelper.GetMaxNumber(); txtorderNumber.Text = ordernumber.ToString(); dtStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 8, 30, 0); dtEnd.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 30, 0); }else { ordernumber = NewTask.orderNumber; txtorderNumber.Text = ordernumber.ToString(); txttaskName.Text = NewTask.taskName; dtStart.Value = NewTask.dtStart; dtEnd.Value = NewTask.dtEnd; txtprogresss.Text = NewTask.progresss.ToString(); } }
//插入一些数据 public static int AddTask(TaskClass NewTask) { string sql = @"insert into Task (taskid, orderNumber,taskName,dtStart,dtEnd,progresss,taskContent) values ( '" + NewTask.taskid + @"'," + NewTask.orderNumber + @", '" + NewTask.taskName + @"', '" + NewTask.dtStart.ToString("yyyy-MM-dd HH:mm:ss") + @"', '" + NewTask.dtEnd.ToString("yyyy-MM-dd HH:mm:ss") + @"', '" + NewTask.progresss + @"', '" + NewTask.taskContent + @"')"; int i = 0; DbProviderFactory fact = DbProviderFactories.GetFactory("System.Data.SQLite"); using (DbConnection cnn = fact.CreateConnection()) { cnn.ConnectionString = sqlPath; cnn.Open(); SQLiteCommand command = new SQLiteCommand(sql, (SQLiteConnection)cnn); i = command.ExecuteNonQuery(); } return i; }
private void dtDotask_CellClick(object sender, DataGridViewCellEventArgs e) { DataTable dt = this.dtDotask.DataSource as DataTable; if (dt.Rows.Count == 0) return; string buttonText = this.dtDotask.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); if (buttonText == "更新进度") { string orderNumber = this.dtDotask.Rows[e.RowIndex].Cells["任务序号"].Value.ToString(); string taskName = this.dtDotask.Rows[e.RowIndex].Cells["任务名称"].Value.ToString(); string dtStart = this.dtDotask.Rows[e.RowIndex].Cells["开始时间"].Value.ToString(); string dtEnd = this.dtDotask.Rows[e.RowIndex].Cells["结束时间"].Value.ToString(); string progresss = this.dtDotask.Rows[e.RowIndex].Cells["进度"].Value.ToString(); TaskClass task = new TaskClass(); task.orderNumber = int.Parse(orderNumber); task.taskName = taskName; task.dtStart = DateTime.Parse(dtStart); task.dtEnd = DateTime.Parse(dtEnd); task.progresss = double.Parse(progresss); AddTaskForm FormTask = new AddTaskForm(); FormTask.NewTask = task; FormTask.TopMost = true; FormTask.StartPosition = FormStartPosition.CenterScreen; FormTask.Show(); FormTask.addComplete += FormTask_addComplete; } if (buttonText == "删除") { string orderNumber = this.dtDotask.Rows[e.RowIndex].Cells["任务序号"].Value.ToString(); string taskName = this.dtDotask.Rows[e.RowIndex].Cells["任务名称"].Value.ToString(); TaskClass task = new TaskClass(); task.orderNumber = int.Parse(orderNumber); task.taskName = taskName; if (MessageBox.Show("确定删除任务: " + taskName+" ?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { TaskDBHelper.DeleteTask(task); loadData(); } } }
public static int UpdateTask(TaskClass NewTask) { string sql = @"update Task set taskName= '" + NewTask.taskName + @"',dtStart='" + NewTask.dtStart.ToString("yyyy-MM-dd HH:mm:ss") + @"',dtEnd='" + NewTask.dtEnd.ToString("yyyy-MM-dd HH:mm:ss") + @"',progresss='"+ NewTask.progresss + @"',taskContent='"+ NewTask.taskContent + @"' where orderNumber='" + NewTask.orderNumber + @"'"; int i = 0; try { DbProviderFactory fact = DbProviderFactories.GetFactory("System.Data.SQLite"); using (DbConnection cnn = fact.CreateConnection()) { cnn.ConnectionString = sqlPath; cnn.Open(); SQLiteCommand command = new SQLiteCommand(sql, (SQLiteConnection)cnn); i = command.ExecuteNonQuery(); } }catch(Exception ex) { } return i; }
public static int DeleteTask(TaskClass NewTask) { string sql = @"delete from Task where orderNumber='" + NewTask.orderNumber + @"'"; int i = 0; try { DbProviderFactory fact = DbProviderFactories.GetFactory("System.Data.SQLite"); using (DbConnection cnn = fact.CreateConnection()) { cnn.ConnectionString = sqlPath; cnn.Open(); SQLiteCommand command = new SQLiteCommand(sql, (SQLiteConnection)cnn); i = command.ExecuteNonQuery(); } } catch (Exception ex) { } return i; }
//使用sql查询语句,并显示结果 public static List<TaskClass> GetAllTastList() { DbProviderFactory fact = DbProviderFactories.GetFactory("System.Data.SQLite"); List<TaskClass> taskList = new List<TaskClass>(); using (DbConnection cnn = fact.CreateConnection()) { cnn.ConnectionString = sqlPath; cnn.Open(); string sql = "select * from Task order by dtStart desc"; SQLiteCommand command = new SQLiteCommand(sql, (SQLiteConnection)cnn); SQLiteDataReader reader = command.ExecuteReader(); while (reader.Read()) { TaskClass task = new TaskClass(); task.taskid = reader["taskid"].ToString(); task.orderNumber = int.Parse(reader["orderNumber"].ToString()); task.taskName = reader["taskName"].ToString(); task.dtStart = DateTime.Parse(reader["dtStart"].ToString()); task.dtEnd = DateTime.Parse(reader["dtEnd"].ToString()); task.progresss = double.Parse(reader["progresss"].ToString()); taskList.Add(task); } } return taskList; }
protected override object this[string index] { get { #region switch (index) { case "TaskID": return _taskID; case "TaskName": return _taskName; case "TaskType": return _taskType; case "TaskClass": return _taskClass; case "RestraintNum": return _restraintNum; case "AchieveID": return _achieveID; case "GameCoin": return _gameCoin; case "TaskDesc": return _taskDesc; default: throw new ArgumentException(string.Format("TaskInfo index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "TaskID": _taskID = value.ToInt(); break; case "TaskName": _taskName = value.ToNotNullString(); break; case "TaskType": _taskType = value.ToEnum<TaskType>(); break; case "TaskClass": _taskClass = value.ToEnum<TaskClass>(); break; case "RestraintNum": _restraintNum = value.ToInt(); break; case "AchieveID": _achieveID = value.ToInt(); break; case "GameCoin": _gameCoin = value.ToInt(); break; case "TaskDesc": _taskDesc = value.ToNotNullString(); break; default: throw new ArgumentException(string.Format("TaskInfo index[{0}] isn't exist.", index)); } #endregion } }
/// <summary> /// 新增、修改任务信息 /// </summary> /// <param name="userID"></param> /// <param name="taskClass"></param> /// <param name="taskNum"></param> /// <returns></returns> public static void SaveUserTask(string userID, TaskClass taskClass, int taskNum) { var taskList = new ConfigCacheSet<TaskInfo>().FindAll(s => s.TaskClass == taskClass); foreach (var info in taskList) { SaveUserTask(userID, info.TaskID, taskNum); } }
private string GetStandardOutput(ref Server server, JobClass job, TaskClass task) { var stdOutput = ""; try { if (task.Stats.StandardOutput != null) { stdOutput = Encoding.Default.GetString(task.Stats.StandardOutput); //try //{ // stdOutput = server.Jobs.Tasks.GetOutputString(OutputInfoClass.OutputT.StandardOutput, job.Id, task.Id, true); //} //catch (Exception) //{ // stdOutput = Encoding.Default.GetString(task.Stats.StandardOutput); //} } return stdOutput; } catch (Exception ex) { var stdOutputErrorMessage = string.Format("Unable to retrieve Standard Message with message: {0}", ex.Message); return stdOutputErrorMessage; } }