Beispiel #1
0
        private Sprint GetFromReader(SqlCeDataReader reader)
        {
            var s = new Sprint
            {
                ID   = Convert.ToInt32(reader.GetValue(0)),
                Name = reader.GetValue(1).ToString(),
                Date = Convert.ToDateTime(reader.GetValue(2)),
                NumberOfDevelopers = Convert.ToInt32(reader.GetValue(3)),
                Status             = reader.GetValue(4).ToString()
            };

            return(s);
        }
Beispiel #2
0
        public Sprint GetById(int id)
        {
            var connection = Connection;

            try
            {
                var sql     = $@"
                    SELECT id, name, date, no_of_developers, status 
                    FROM sprint 
                    WHERE id = {id}";
                var command = new SqlCeCommand(sql, connection);
                connection.Open();
                var reader = command.ExecuteReader();
                if (reader.Read())
                {
                    var s = new Sprint
                    {
                        ID   = Convert.ToInt32(reader.GetValue(0)),
                        Name = Convert.ToString(reader.GetValue(1))
                    };
                    return(s);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (connection.State != ConnectionState.Closed)
                {
                    connection.Close();
                }
            }
            return(null);
        }
Beispiel #3
0
 public Ticket(string summary, string description, int estimation, string priority, string status, Sprint Id)
 {
     Summary     = summary;
     Description = description;
     Estimation  = estimation;
     Priority    = priority;
     Status      = status;
     Sprint      = Id;
 }