C sharp - necesito realizar esta aplicacion y no he podido ordenar ni que me muestre los colores como alli ind

 
Vista:
sin imagen de perfil

necesito realizar esta aplicacion y no he podido ordenar ni que me muestre los colores como alli ind

Publicado por diana (4 intervenciones) el 28/03/2015 23:30:53
p2
TENGO DOS CLASES UNA CONDE RECIBE YARDA PIE Y PULGADA Y OTRA QUE RECIBE ELNOMBRE DEL GIMNASIO, AVANCE INICIAL Y EL FINAL Y ALLI CALCULA EL AVANCE.. TAMBN YA CODIFIQUE EL BOTON CALCULAR Y SI ME DA SOLO ME FALTA QUE ME PINTE Y ORDENE COMO ALLI MUESTRA
ESPERO UNA PRONTA RESPUESTA
Ayudenme por favor como le hago para que los ordene y me muestre en color el mayor y menor Gracias!!!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

necesito realizar esta aplicacion y no he podido ordenar ni que me muestre los colores como alli ind

Publicado por diana (4 intervenciones) el 28/03/2015 23:54:46
ESTE ES EL CODIGO QUE LLEVO ESTE ES DE LA PRIMER CLASE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
{
    class Area
    {
 
        //Atributos...
 
        private int yarda;
        private int  pie;
        private int  pulgada;
 
 
        //Constructores...
 
        public Area()
        {
 
            yarda = 0;
            pie = 0;
            pulgada = 0;
        }
 
 
        public Area ( int yar, int ft, int  pul)
        {
 
            yarda = yar;
            pie = ft;
            pulgada = pul;
        }
 
 
        //3er Constructor de copia 
 
 
        public Area(Area a)
        {
            yarda = a.yarda;
            pie = a.pie;
            pulgada = a.pulgada;
        }
 
 
        //Propiedades...
 
 
        public int  Yarda
        {
            get { return yarda; }
            set { yarda = value; }
        }
 
        public int Pie
        {
            get { return pie; }
            set { pie = value; }
        }
 
        public int Pulgada
        {
            get { return pulgada; }
            set { pulgada = value; }
        }
 
 
        //Metodos...
 
 
        public override string ToString()
        {
            return yarda.ToString() + "\t Y \t" +"\t\t"+ pie.ToString() + "\t FT \t" + pulgada.ToString() + "P";
        }



Y ESTE DE LA SEGUNDA

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
{
    class Gimnasio
    {
 
 
 
        private string name;
        private Area inicial;
        private Area final;
 
 
 
        public Gimnasio()
        {
            name = "NO-ID";
            inicial = new Area();
            final = new Area();
 
        }
 
        public Gimnasio(string nam, Area ini, Area fin)
        {
            name = nam;
            inicial = ini;
            final = fin;
        }
 
 
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
 
        public Area Inicial
        {
            get { return inicial; }
            set { inicial = value; }
        }
 
        public Area Final
        {
            get { return final; }
            set { final = value; }
        }
 
 
 
 
        public Area Avance()
        {
            return final - inicial;
        }
 
 
 
    }
}

Y ESTO ES EL BOTON CALCULAR

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
private void butCalcular_Click(object sender, EventArgs e)
        {
            Gimnasio[] Lista = new Gimnasio[dgvDatos.RowCount - 1];
 
            for (int i=0;i<Lista.Length;i++)
                Lista[i]=new Gimnasio(dgvDatos[0,i].Value.ToString(),
                         new Area  (Convert.ToInt32(dgvDatos[1,i].Value),
                                   Convert.ToInt32(dgvDatos[2,i].Value),
                                   Convert.ToInt32(dgvDatos[3,i].Value)),
                         new Area  (Convert.ToInt32(dgvDatos[4,i].Value),
                                   Convert.ToInt32(dgvDatos[5,i].Value),
                                   Convert.ToInt32(dgvDatos[6,i].Value)));
 
 
            Area total = new Area();
            Area AvancePromedio = new Area();
            for (int i = 0; i < Lista.Length; i++)
            {
                dgvDatos[7, i].Style.BackColor = Color.LightSkyBlue;
                dgvDatos[7, i].Value = Lista[i].Avance().Yarda;
                dgvDatos[8, i].Style.BackColor = Color.LightSkyBlue;
                dgvDatos[8, i].Value = Lista[i].Avance().Pie;
                dgvDatos[9, i].Style.BackColor = Color.LightSkyBlue;
                dgvDatos[9, i].Value = Lista[i].Avance().Pulgada;
                total += Lista[i].Avance();
            }
 
 
                    etiTotal.Text = total.ToString();
        }
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

necesito realizar esta aplicacion y no he podido ordenar ni que me muestre los colores como alli ind

Publicado por diana (4 intervenciones) el 29/03/2015 00:54:50
POR FAVOR ALGUIEN QUE ME PUEDA AYUDAR .. NECESITO ENTREGAR ESTO YA ... PORFAVOR SOLO DIGANME COMO HACERLE PORFA
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

necesito realizar esta aplicacion y no he podido ordenar ni que me muestre los colores como alli ind

Publicado por diana (4 intervenciones) el 09/04/2015 02:26:06
estaba tan facil quizas era el estres el que no me dejaba verlo Gracias por tantas respuestas
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar