예제 #1
0
 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();
     }
 }
예제 #2
0
        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();
        }
예제 #3
0
 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();
     }
 }
예제 #4
0
 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();
     }
 }