public NewUserWin(User user) { NewUser = new User(user); isUpdateble = true; InitializeComponent(); init(); }
public User(User user) { if (user != null) { GUID = user.GUID; Name = user.Name; Email = user.Email; IsDelete = user.IsDelete; } }
public Comment(Comment comment) { GUID = comment.GUID; TaskGUID = comment.TaskGUID; User = new User(comment.User); Date = new DateTime(comment.Date.Year, comment.Date.Month, comment.Date.Day, comment.Date.Hour, comment.Date.Minute, comment.Date.Second, comment.Date.Millisecond); Data = comment.Data; IsNew = comment.IsNew; }
public Comment(bool generate = true) { if (generate) { GUID = SQLiteWorker.GenerateGUID(); Date = DateTime.Now; User = new User(Settings.CurrentUser); IsNew = false; } }
public Project(Project prj) { GUID = prj.GUID; Description = prj.Description; DateStart = prj.DateStart; DateEnd = prj.DateEnd; DateCreate = prj.DateCreate; Customer = new User(prj.Customer); Leader = new User(prj.Leader); Percents = prj.Percents; if(prj.Parent!=null) { Parent = new Project(prj.Parent); } Type = prj.Type; IsDelete = prj.IsDelete; }
public Task(Task task) { GUID = task.GUID; OrderDate = task.OrderDate; EndDate = task.EndDate; Performer = new User(task.Performer); Customer = new User(task.Customer); Topic = task.Topic; Description = task.Description; Priority = task.Priority; Project = new Project(task.Project); TimePlan = task.TimePlan; TimeAdjustment = task.TimeAdjustment; TimeFact = task.TimeFact; Percents = task.Percents; IsImportant = task.IsImportant; IsNew = task.IsNew; IsDelete = task.IsDelete; }
public NewUserWin() { NewUser = new User(); InitializeComponent(); init(); }
public static void AddNewUser(User user) { ExecuteNonQuery(string.Format( "insert into Users values('{0}', '{1}', '{2}', '{3}')", user.GUID, user.Name, user.Email, user.IsDelete), null, true); }
public static void UpdateUser(User user) { ExecuteNonQuery("update Users set Name=@Name, Email=@Email where GUID=@GUID", new List<SQLiteParameter> { new SQLiteParameter("GUID", user.GUID), new SQLiteParameter("Name", user.Name), new SQLiteParameter("Email", user.Email) }, true); }
public static User GetUserFromGUID(string guid) { SQLiteConnection connection = new SQLiteConnection(ConnectionString); User user = new User(guid); try { connection.Open(); SQLiteCommand cmd = new SQLiteCommand("select name, Email, IsDelete from USERS where guid=@GUID", connection); cmd.Parameters.Add(new SQLiteParameter("GUID", guid)); SQLiteDataReader reader = cmd.ExecuteReader(); reader.Read(); user.Name = reader.GetString(reader.GetOrdinal("name")); user.Email = reader.GetString(reader.GetOrdinal("Email")); object o = reader["IsDelete"]; user.IsDelete = Convert.ToBoolean(o); } catch (Exception exc) { MessageWindows.Show("GetUserFromGUID:Exception", exc.Message); return null; } finally { if (connection.State == ConnectionState.Open) { connection.Close(); } } return user; }