Example #1
0
        public static void InitializeData()
        {
            /*PROTECTED REGION ID(initializeDataMethod) ENABLED START*/
            try
            {
                /*List<RetappGenNHibernate.EN.Mediaplayer.MusicTrackEN> musicTracks = new List<RetappGenNHibernate.EN.Mediaplayer.MusicTrackEN>();
                 * RetappGenNHibernate.EN.Mediaplayer.UserEN userEN = new RetappGenNHibernate.EN.Mediaplayer.UserEN();
                 * RetappGenNHibernate.EN.Mediaplayer.ArtistEN artistEN = new RetappGenNHibernate.EN.Mediaplayer.ArtistEN();
                 * RetappGenNHibernate.EN.Mediaplayer.MusicTrackEN musicTrackEN = new RetappGenNHibernate.EN.Mediaplayer.MusicTrackEN();
                 * RetappGenNHibernate.CEN.Mediaplayer.ArtistCEN artistCEN = new RetappGenNHibernate.CEN.Mediaplayer.ArtistCEN();
                 * RetappGenNHibernate.CEN.Mediaplayer.UserCEN userCEN = new RetappGenNHibernate.CEN.Mediaplayer.UserCEN();
                 * RetappGenNHibernate.CEN.Mediaplayer.MusicTrackCEN musicTrackCEN = new RetappGenNHibernate.CEN.Mediaplayer.MusicTrackCEN();
                 * RetappGenNHibernate.CEN.Mediaplayer.PlayListCEN playListCEN = new RetappGenNHibernate.CEN.Mediaplayer.PlayListCEN();
                 *
                 *              //Add Users
                 * userEN.Email = "*****@*****.**";
                 * userEN.Name = "user";
                 * userEN.Surname = "userSurname";
                 * userEN.Password = "******";
                 * userCEN.New_(userEN.Name, userEN.Surname, userEN.Email, userEN.Password);
                 *
                 * //Add Music Track1
                 * musicTrackEN.Id = "http://www2.b3ta.com/mp3/Beer Beer Beer (YOB mix).mp3";
                 * musicTrackEN.Format = "mp3";
                 * musicTrackEN.Lyrics = "Beer Beer Beer Beer Beer Beer ..";
                 * musicTrackEN.Name = "Beer Beer Beer";
                 * musicTrackEN.Company = "Company";
                 * musicTrackEN.Cover = "http://www.tomasabraham.com.ar/cajadig/2007/images/nro18-2/beer1.jpg";
                 * musicTrackEN.Price = 20;
                 * musicTrackEN.Rating = 5;
                 * musicTrackEN.CommunityRating = 5;
                 * musicTrackEN.Duration = 200;
                 * musicTrackCEN.New_(musicTrackEN.Id, musicTrackEN.Format, musicTrackEN.Lyrics, musicTrackEN.Name,
                 * musicTrackEN.Company, musicTrackEN.Cover, musicTrackEN.CommunityRating, musicTrackEN.Rating,
                 * musicTrackEN.Price, musicTrackEN.Duration);
                 * musicTracks.Add(musicTrackEN);
                 * musicTrackCEN.AsignUser(musicTrackEN.Id,userEN.Email);
                 *
                 * //Define Album
                 * //RetappGenNHibernate.CEN.Mediaplayer.AlbumCEN albumCEN = new RetappGenNHibernate.CEN.Mediaplayer.AlbumCEN();
                 * //albumCEN.New_("Album 1", "This is a Album 1", artists, musicTracks);*/
                AdminCEN    acen    = new AdminCEN();
                ConcursoCEN concen  = new ConcursoCEN();
                RetoCEN     retocen = new RetoCEN();
                acen.New_("ara65", "ara1995");
                concen.New_(new DateTime(2016, 3, 13), true, false, "Esta es la frase caracteristica de esta nuestra compa��a", "Descripci�n 1", "premio1", 0, new DateTime(2016, 3, 13), "http://www.huevosguillen.com/wp-content/uploads/2014/07/huevo-tradicional.jpg", "Compa�ia 1");
                concen.New_(new DateTime(2016, 3, 13), false, false, "Esta es la frase caracteristica de esta nuestra compa��a", "Descripci�n 2", "premio2", 0, new DateTime(2016, 3, 13), "http://4.bp.blogspot.com/_BGB6bJqOS60/TCKqPi71VcI/AAAAAAAAACQ/PGaT4Q44YqM/s320/Yoshi+Egg+icon.png", "Compa�ia 2");
                retocen.New_(1, "Reto1A", "DescA", new DateTime(2016, 4, 20), true);
                retocen.New_(1, "Reto2A", "DescA", new DateTime(2016, 4, 20), false);
                retocen.New_(2, "Reto1B", "DescB", new DateTime(2016, 4, 20), false);
                // retocen.New_(2, "Reto2B", "DescB", new DateTime(2016, 4, 20), true);

                /*PROTECTED REGION END*/
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(ex.InnerException);
                throw ex;
            }
        }
Example #2
0
        //Guarda los cambios y hace commmit en la BBDD
        //Pone active a false
        private void button2_Click(object sender, EventArgs e)
        {
            RetoCEN     retocen = new RetoCEN();
            ConcursoCEN concen  = new ConcursoCEN();

            if (reto == null)
            {
                reto             = new RetoEN();
                reto.Concurso    = campaign.Concur;
                reto.Active      = false;
                reto.Nombre      = textBox1.Text;
                reto.Descripcion = richTextBox1.Text;
                reto.FechaFin    = (DateTime)dateTimePicker1.Value;
                reto.Id          = retocen.New_(campaign.Concur.Id, textBox1.Text, richTextBox1.Text, (DateTime)dateTimePicker1.Value, false);
            }
            else
            {
                reto.FechaFin    = dateTimePicker1.Value;
                reto.Nombre      = textBox1.Text;
                reto.Descripcion = richTextBox1.Text;
                reto.Active      = false;
                retocen.get_IRetoCAD().Modify(reto);
            }
            //Actualiza la vista anterior
            this.Reto_Load(sender, e);
            campaign.Campaña_Load(sender, e);
        }