public static int FindIndexProductInOder(int id_Custumer, int id_Oder, string code_product) { Method.ReadOnMember(); int pos_Custumer = Management.FindIndexOfIdCustumer(id_Custumer); int pos_Oder = Management.FindIndexOderInOders(id_Custumer, id_Oder); if (pos_Custumer != -1) { if (pos_Oder != -1) { for (int i = 0; i < Method.data.custumers[pos_Custumer].oders[pos_Oder].products.Count; i++) { if (Method.data.custumers[pos_Custumer].oders[pos_Oder].products[i].code_product == code_product) { return(i); } } return(-1); } return(-1); } return(-1); }