//********************************************************** //* Добавление новой задачи //********************************************************** public static void AddTask(Int32 researchId, Int32 taskType, String value) { using (SandBoxDataContext db = new SandBoxDataContext()) { Task task = new Task { ResearchId = researchId, Type = taskType, Value = value }; db.Tasks.InsertOnSubmit(task); db.SubmitChanges(); } }
private string GetConvertedTask(Task rschToCompareTask) { string res = string.Empty; if ((rschToCompareTask == null) || (rschToCompareTask.Value == null) || (rschToCompareTask.Value == String.Empty)) { return String.Empty; } else { int numberRoot; bool result = Int32.TryParse(rschToCompareTask.Value.Substring(0, 1), out numberRoot); if(result) { if(RootElementsCodes.Keys.Contains(numberRoot)) { res = RootElementsCodes[numberRoot]; if (rschToCompareTask.Value.Length == 1) return res; res+=("\\"+ rschToCompareTask.Value.Substring(1, (rschToCompareTask.Value.Length-1))); return res; } else return rschToCompareTask.Value; } return rschToCompareTask.Value; } }
partial void UpdateTask(Task instance);
partial void DeleteTask(Task instance);
partial void InsertTask(Task instance);