Пример #1
0
        public override INote CreateNote(string text)
        {
            Logger.Debug("Creating New Note Object : {0} (id={1})", text, id);
            text = backend.SanitizeText(text);
            string command = String.Format("INSERT INTO Notes (Task, Text) VALUES ('{0}','{1}'); SELECT last_insert_rowid();", id, text);
            int    taskId  = Convert.ToInt32(backend.Database.ExecuteScalar(command));

            return(new SqliteNote(taskId, text));
        }
Пример #2
0
        public SqliteTask(SqliteBackend backend, string name)
            : base(backend.SanitizeText (name), TaskNoteSupport.Multiple)
        {
            if (backend == null)
                throw new ArgumentNullException ("backend");

            name = backend.SanitizeText (name);
            this.backend = backend;
            Debug.WriteLine ("Creating New Task Object : {0} (id={1})", name, id);
            var dueDate = Database.FromDateTime (DueDate);
            var completionDate = Database.FromDateTime (CompletionDate);
            var priority = (int)Priority;
            var state = (int)State;
            var command = string.Format ("INSERT INTO Tasks (Name, DueDate, CompletionDate, Priority, State, Category, ExternalID) values ('{0}','{1}', '{2}','{3}', '{4}', '{5}', '{6}'); SELECT last_insert_rowid();",
                                name, dueDate, completionDate, priority, state, 0, string.Empty);
            id = Convert.ToInt32 (backend.Database.ExecuteScalar (command));
        }
Пример #3
0
 public SqliteTask(SqliteBackend backend, string name)
 {
     this.backend = backend;
     Logger.Debug("Creating New Task Object : {0} (id={1})", name, id);
     name = backend.SanitizeText (name);
     this.name = name;
     this.dueDate =  Database.FromDateTime(DateTime.MinValue);
     this.completionDate = Database.FromDateTime(DateTime.MinValue);
     this.category = 0;
     this.priority = (int)(TaskPriority.None);
     this.state = (int)TaskState.Active;
     string command = String.Format("INSERT INTO Tasks (Name, DueDate, CompletionDate, Priority, State, Category, ExternalID) values ('{0}','{1}', '{2}','{3}', '{4}', '{5}', '{6}'); SELECT last_insert_rowid();",
                         name, dueDate, completionDate,
                         priority, state, category, string.Empty);
     this.id = Convert.ToInt32 (backend.Database.ExecuteScalar (command));
 }
Пример #4
0
        public SqliteTask(SqliteBackend backend, string name)
        {
            this.backend = backend;
            Logger.Debug("Creating New Task Object : {0} (id={1})", name, id);
            name                = backend.SanitizeText(name);
            this.name           = name;
            this.dueDate        = Database.FromDateTime(DateTime.MinValue);
            this.completionDate = Database.FromDateTime(DateTime.MinValue);
            this.category       = 0;
            this.priority       = (int)(TaskPriority.None);
            this.state          = (int)TaskState.Active;
            string command = String.Format("INSERT INTO Tasks (Name, DueDate, CompletionDate, Priority, State, Category, ExternalID) values ('{0}','{1}', '{2}','{3}', '{4}', '{5}', '{6}'); SELECT last_insert_rowid();",
                                           name, dueDate, completionDate,
                                           priority, state, category, string.Empty);

            this.id = Convert.ToInt32(backend.Database.ExecuteScalar(command));
        }