public SqliteCategory(SqliteBackend backend, string name) { this.backend = backend; string command = String.Format("INSERT INTO Categories (Name, ExternalID) values ('{0}', '{1}'); SELECT last_insert_rowid();", name, string.Empty); this.id = Convert.ToInt32 (backend.Database.ExecuteScalar(command)); //Logger.Debug("Inserted category named: {0} with id {1}", name, id); }
public SqliteCategory(SqliteBackend backend, string name) { this.backend = backend; string command = String.Format("INSERT INTO Categories (Name, ExternalID) values ('{0}', '{1}'); SELECT last_insert_rowid();", name, string.Empty); this.id = Convert.ToInt32(backend.Database.ExecuteScalar(command)); //Logger.Debug("Inserted category named: {0} with id {1}", name, id); }
public SqliteCategory(SqliteBackend backend, string name) : base(name) { var command = string.Format ( "INSERT INTO Categories (Name, ExternalID) values ('{0}', '{1}'); SELECT last_insert_rowid();", name, string.Empty); backend.Database.ExecuteScalar (command); //Debug.WriteLine("Inserted category named: {0} with id {1}", name, id); }
public SqliteTask(SqliteBackend backend, int id, int category, string name, long dueDate, long completionDate, int priority, int state) : base(name, TaskNoteSupport.Multiple) { this.backend = backend; this.id = id; DueDate = Database.ToDateTime (dueDate); CompletionDate = Database.ToDateTime (completionDate); Priority = (TaskPriority)priority; State = (TaskState)state; }
public SqliteTask(SqliteBackend backend, int id, int category, string name, long dueDate, long completionDate, int priority, int state) { this.backend = backend; this.id = id; this.category = category; this.name = name; this.dueDate = dueDate; this.completionDate = completionDate; this.priority = priority; this.state = state; }
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)); }
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)); }
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)); }
public SqliteCategory(SqliteBackend backend, int id) { this.backend = backend; this.id = id; }