Exemple #1
0
        public static int Mtri(NA2 x, NA2 y)
        {
            int i = int.Parse(x.loc.Split('.')[0]);
            int j = int.Parse(y.loc.Split('.')[0]);

            if (i > j)
            {
                return(1);
            }
            else if (i < j)
            {
                return(-1);
            }
            else
            {
                int i2 = int.Parse(x.loc.Split('.')[1]);
                int j2 = int.Parse(y.loc.Split('.')[1]);

                if (i2 > j2)
                {
                    return(1);
                }
                else if (i2 < j2)
                {
                    return(-1);
                }
                return(0);
            }
        }
Exemple #2
0
        public static int Mtri(NA2 x, NA2 y)
        {
            int i   = x.rayon;
            int j   = y.rayon;
            int cpr = i.CompareTo(j);

            if (cpr == 0)
            {
                string i1   = x.loc;
                string j1   = y.loc;
                int    cpr2 = i.CompareTo(j);
                return(cpr2);
            }
            return(cpr);
        }
Exemple #3
0
        public bool ReadCp(string text, string str2, bool gencode, bool motcle)
        {
            bool flag = true;

            _NAs = new List <NA2>();
            string str = text;

            str = str.Replace('\r', ' ');
            string[] vs = str.Split('\n');
            for (int i = 1; i < vs.Length - 1; i++)
            {
                try
                {
                    string   line = vs[i];
                    string[] item = line.Split('\t');
                    if (item.Length == 2)
                    {
                        if (item[1] != "EAN" && item[1] != "")
                        {
                            NA2 na = new NA2
                            {
                                Lib = item[0],
                                Ean = item[1]
                            };
                            _NAs.Add(na);
                        }
                    }
                }
                catch (Exception) { flag = false; }
            }
            if (flag)
            {
                _listGencode = new ListeGencode();
                if (gencode)
                {
                    _NAs = _listGencode.TriDesFamilles(_NAs);
                }
                _listMotClé = new ListMotClé(str2);
                if (motcle)
                {
                    _NAs = _listMotClé.TriDesFamilles(_NAs);
                }
            }
            return(flag);
            //  WriteExcelFil2e();
        }