質問

I have two classes:

    class OrdenO
        {
            public int id_orden_O {get;set;}
            public int Ei_O {get;set;}
            public int Ii_O {get;set;}
            public int Si_O {get;set;}
            public int DTi_O {get;set;}
            public int Ui_O {get;set;}
            public int K_O {get;set;}
            public int Q_O {get;set;}
            public List TT;
    }

     class Muelle
        {
            public int id_muelle { get; set; }
            public int Lk { get; set; }
            public int Sk { get; set; }
            public List orden_asign;
        }

And here, I have all elements in both Lists Collection:

    List myClassArray = new List()
                {
    new OrdenO{id_orden_O="1", Ei_O= 0, Ii_O= 120, Si_O=0, DTi_O=0, Ui_O=0, K_O=0, Q_O=0, TT= new List{ 18, 8}},
    new OrdenO{id_orden_O="2", Ei_O= 0, Ii_O= 120, Si_O=0, DTi_O=0, Ui_O=0, K_O=0, Q_O=0, TT= new List{ 20, 25}},
                };

     List mydock = new List()
                {
                    new Muelle{id_muelle=0, Lk=0, Sk=0, orden_asign= new List{0} },
                    new Muelle{id_muelle=1, Lk=0, Sk=0, orden_asign= new List{0}}
                };

I need help, because I don't know how to find the TT index min value. For example, the (TT) index min value of the first is 1, because 8 is the min value. And the second one is 0.

And if the index min value is 1, so find the id_muelle = 1, and add id_orden to orden_asign.

Any help would be much appreciated,

Thanks

役に立ちましたか?

解決

You can use something like this

 TT.IndexOf(TT.Min());
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top