コード例 #1
0
        public static void CreateTask(string taskName, int listId)
        {
            LinqToSQLDataContext db = new LinqToSQLDataContext();

            //Create new Board

            TTask newTask = new TTask
            {
                TaskName = taskName,
                TaskList = listId
            };

            //Add new Board to database
            db.TTasks.InsertOnSubmit(newTask);

            //Save changes to Database.
            try
            {
                db.SubmitChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #2
0
        public static void DeleteTask(int taskId)
        {
            LinqToSQLDataContext db = new LinqToSQLDataContext();

            //Get Board to be deleted
            TTask taskToBeDeleted = db.TTasks.FirstOrDefault(t => t.TasktId.Equals(taskId));

            //Delete Board on database
            db.TTasks.DeleteOnSubmit(taskToBeDeleted);

            //Save changes to Database.
            try
            {
                db.SubmitChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #3
0
        public static void UpdateTask(int taskId, string taskDescription, DateTime taskDue, int taskWho, int taskStatus)
        {
            LinqToSQLDataContext db = new LinqToSQLDataContext();

            //Get Board to be deleted
            TTask taskToBeUpdated = db.TTasks.FirstOrDefault(t => t.TasktId.Equals(taskId));

            taskToBeUpdated.TaskDescription = taskDescription;
            taskToBeUpdated.TaskDue         = taskDue;
            taskToBeUpdated.TaskWho         = taskWho;
            taskToBeUpdated.TaskStatus      = taskStatus;

            //Save changes to Database.
            try
            {
                db.SubmitChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #4
0
 private void detach_TTasks(TTask entity)
 {
     this.SendPropertyChanging();
     entity.TStatus = null;
 }
コード例 #5
0
 private void attach_TTasks(TTask entity)
 {
     this.SendPropertyChanging();
     entity.TStatus = this;
 }
コード例 #6
0
 partial void DeleteTTask(TTask instance);
コード例 #7
0
 partial void UpdateTTask(TTask instance);
コード例 #8
0
 partial void InsertTTask(TTask instance);