示例#1
0
 private void button4_Click(object sender, EventArgs e)
 {
     Services.Inmueble inmueble = new Services.Inmueble();
     try
     {
         string msg = inmueble.AgregarFavoritos(_id);
         MessageBox.Show(msg);
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message, "Error");
     }
 }
示例#2
0
        private void inmuebleView_Load(object sender, EventArgs e)
        {
            string[] calificaciones = { "1", "2", "3", "4", "5" };
            calificacion.Items.AddRange(calificaciones);
            Entities.Session.sessionListener += Session_Listener;
            Services.Usuario usuario = new Services.Usuario();
            try
            {
                if (usuario.isLogged())
                {
                    loggedTab.Visible = true;
                    button1.Visible   = false;
                    button2.Visible   = false;
                }
                else
                {
                    loggedTab.Visible = false;
                    button1.Visible   = true;
                    button2.Visible   = true;
                }
            }
            catch
            {
            }

            try
            {
                Services.Inmueble          inmueble    = new Services.Inmueble();
                List <Entities.Comentario> comentarios = inmueble.TraerComentarios(_id);

                List <Comentario> componentesComentario = new List <Comentario>();

                foreach (Entities.Comentario _comentario in comentarios)
                {
                    componentesComentario.Add(new Comentario(_comentario));
                }

                flowLayoutPanel2.AutoScroll    = true;
                flowLayoutPanel2.FlowDirection = FlowDirection.TopDown;
                flowLayoutPanel2.WrapContents  = false;
                flowLayoutPanel2.Height        = comentarios.Count * 160;
                foreach (Control control in componentesComentario)
                {
                    flowLayoutPanel2.Controls.Add(control);
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message, "Error");
            }
        }
示例#3
0
        private void button5_Click(object sender, EventArgs e)
        {
            Services.Inmueble inmueble = new Services.Inmueble();

            try
            {
                string msg = inmueble.AgregarComentario(new Entities.Comentario(_id, comentario.Text, int.Parse(calificacion.Text)));
                MessageBox.Show(msg);
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message, "Error");
            }
        }
示例#4
0
文件: Form1.cs 项目: brunopass/uai
        public void updateHorizontalCards()
        {
            Services.Inmueble        inmueble  = new Services.Inmueble();
            List <Entities.Inmueble> inmuebles = inmueble.TraerInmuebles(4);
            List <ImageCard>         cards     = new List <ImageCard>();

            foreach (Entities.Inmueble _inmueble in inmuebles)
            {
                cards.Add(new ImageCard(_inmueble.Id, _inmueble.Uri, _inmueble.Title, _inmueble.Ubication, _inmueble.Stars));
            }
            flowLayoutPanel2.Controls.Clear();
            flowLayoutPanel2.AutoScroll    = true;
            flowLayoutPanel2.FlowDirection = FlowDirection.LeftToRight;
            flowLayoutPanel2.WrapContents  = false;
            foreach (Control control in cards)
            {
                flowLayoutPanel2.Controls.Add(control);
            }
        }
示例#5
0
文件: Form1.cs 项目: brunopass/uai
        private void updateVerticalCards()
        {
            Services.Inmueble        inmueble  = new Services.Inmueble();
            List <Entities.Inmueble> inmuebles = inmueble.TraerInmuebles();
            List <Card> cards = new List <Card>();

            foreach (Entities.Inmueble _inmueble in inmuebles)
            {
                cards.Add(new Card(_inmueble.Id, _inmueble.Uri, _inmueble.Title, _inmueble.Ubication, _inmueble.Description, _inmueble.Stars, false));
            }

            flowLayoutPanel1.Controls.Clear();
            flowLayoutPanel1.AutoScroll    = true;
            flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
            flowLayoutPanel1.WrapContents  = false;
            flowLayoutPanel1.Height        = cards.Count * 260;
            foreach (Control control in cards)
            {
                flowLayoutPanel1.Controls.Add(control);
            }
        }
示例#6
0
        public inmuebleView(string _id)
        {
            InitializeComponent();
            try
            {
                Services.Inmueble _inmueble = new Services.Inmueble();
                this.inmueble = _inmueble.TraerInmueble(_id);
                byte[]       byteBuffer   = Convert.FromBase64String(inmueble.Uri);
                MemoryStream memoryStream = new MemoryStream(byteBuffer);
                Bitmap       bitmap       = new Bitmap(Bitmap.FromStream(memoryStream));
                pictureBox2.Image    = bitmap;
                pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
                titulo.Text          = inmueble.Title;
                ubicacion.Text       = inmueble.Ubication + " - " + inmueble.Address;
                descripcion.Text     = inmueble.Description;

                List <star> starsList = new List <star>();
                for (int i = 0; i < inmueble.Stars; i++)
                {
                    star s = new star();
                    s.BackColor = Color.WhiteSmoke;
                    starsList.Add(s);
                }
                flowLayoutPanel1.AutoScroll    = true;
                flowLayoutPanel1.FlowDirection = FlowDirection.LeftToRight;
                flowLayoutPanel1.WrapContents  = false;
                foreach (Control control in starsList)
                {
                    flowLayoutPanel1.Controls.Add(control);
                }
                this._id = _id;
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message, "Error");
            }
        }