public void RemoveTask(int id) { using (TDList list = new TDList()) { var removeTask = list.Tasks.SingleOrDefault(t => t.Id == id); list.Tasks.Remove(removeTask); list.SaveChanges(); } }
public void Edit() { var task = list.Tasks.Where(t => t.Id == Id).FirstOrDefault(); task.Name = Fields[1]; task.Objective = Fields[2]; task.IdPriority = Int32.Parse(Fields[3]); task.IdCategory = Int32.Parse(Fields[4]); list.SaveChanges(); }
public void Registration(AccountSignUp ASU) { using (TDList list = new TDList()) { Account account = new Account { Login = ASU.Login, Password = CryptoProvider.GetMD5Hash(ASU.Password) }; list.Accounts.Add(account); list.SaveChanges(); } }
public void Record(HttpRequestBase Request, ref AnalyzeTaskView AT) { using (TDList list = new TDList()) { HttpCookie cookie = Request.Cookies["UserId"]; Task task = new Task { Name = AT.Name, Objective = AT.Objective, StartDate = AT.StartDate, EndDate = AT.EndDate, IdAccount = int.Parse(cookie.Value), IdCategory = AT.selectCategoryItems, IdPriority = AT.selectPriorityItems, }; list.Tasks.Add(task); list.SaveChanges(); } }