Пример #1
0
        private string GetNextLinNumber(string ColID)
        {
            int        FinalMaxN = 1;
            List <int> Nlist     = new List <int>();

            if (dgvAccList.Rows.Count > 0)
            {
                foreach (DataGridViewRow r in dgvAccList.Rows)
                {
                    string ln   = r.Cells[ColID].Value.ToString();
                    int    N    = 0;
                    bool   resp = int.TryParse(ln, out N);
                    Nlist.Add(N);
                }
                FinalMaxN = MyCommon.GetMaxNumber(Nlist);
                return(FinalMaxN.ToString());
            }
            else
            {
                return("1");
            }
        }