using System;
namespace Versioning
{
    public class NominalData : Sage_Container, IData
    {
        /* Autogenerated by sage_wrapper_generator.pl */
        SageDataObject110.NominalData nd11;
        SageDataObject120.NominalData nd12;
        SageDataObject130.NominalData nd13;
        SageDataObject140.NominalData nd14;
        SageDataObject150.NominalData nd15;
        SageDataObject160.NominalData nd16;
        SageDataObject170.NominalData nd17;


        public NominalData(object inner, int version)
            : base(version) {
            switch (m_version) {
            case 11: {
                    nd11 = (SageDataObject110.NominalData)inner;
                    m_fields = new Fields(nd11.Fields,m_version);
                    return;
                }

            case 12: {
                    nd12 = (SageDataObject120.NominalData)inner;
                    m_fields = new Fields(nd12.Fields,m_version);
                    return;
                }

            case 13: {
                    nd13 = (SageDataObject130.NominalData)inner;
                    m_fields = new Fields(nd13.Fields,m_version);
                    return;
                }

            case 14: {
                    nd14 = (SageDataObject140.NominalData)inner;
                    m_fields = new Fields(nd14.Fields,m_version);
                    return;
                }

            case 15: {
                    nd15 = (SageDataObject150.NominalData)inner;
                    m_fields = new Fields(nd15.Fields,m_version);
                    return;
                }
            case 16: {
                    nd16 = (SageDataObject160.NominalData)inner;
                    m_fields = new Fields(nd16.Fields,m_version);
                    return;
                }
            case 17: {
                    nd17 = (SageDataObject170.NominalData)inner;
                    m_fields = new Fields(nd17.Fields,m_version);
                    return;
                }

            default: throw new InvalidOperationException("ver");
            }
        }
        /* Autogenerated with data_generator.pl */
        const string ACCOUNT_REF = "ACCOUNT_REF";
        const string NOMINALDATA = "NominalData";


        
        public bool Open(OpenMode mode) {
            bool ret;
            switch (m_version) {
            case 11: {
                    ret = nd11.Open((SageDataObject110.OpenMode)mode);
                    break;
                }

            case 12: {
                    ret = nd12.Open((SageDataObject120.OpenMode)mode);
                    break;
                }

            case 13: {
                    ret = nd13.Open((SageDataObject130.OpenMode)mode);
                    break;
                }

            case 14: {
                    ret = nd14.Open((SageDataObject140.OpenMode)mode);
                    break;
                }

            case 15: {
                    ret = nd15.Open((SageDataObject150.OpenMode)mode);
                    break;
                }
            case 16: {
                    ret = nd16.Open((SageDataObject160.OpenMode)mode);
                    break;
                }
            case 17: {
                    ret = nd17.Open((SageDataObject170.OpenMode)mode);
                    break;
                }

            default: throw new InvalidOperationException("ver");
            }
            return ret;
        }
        public void Close() {
            switch (m_version) {
            case 11: {
                    nd11.Close();
                    break;
                }

            case 12: {
                    nd12.Close();
                    break;
                }

            case 13: {
                    nd13.Close();
                    break;
                }

            case 14: {
                    nd14.Close();
                    break;
                }

            case 15: {
                    nd15.Close();
                    break;
                }
            case 16: {
                    nd16.Close();
                    break;
                }
            case 17: {
                    nd17.Close();
                    break;
                }

            default: throw new InvalidOperationException("ver");
            }

        }
        public bool Read(int IRecNo) {
            bool ret;
            switch (m_version) {
            case 11: {
                    ret = nd11.Read(IRecNo);
                    break;
                }

            case 12: {
                    ret = nd12.Read(IRecNo);
                    break;
                }

            case 13: {
                    ret = nd13.Read(IRecNo);
                    break;
                }

            case 14: {
                    ret = nd14.Read(IRecNo);
                    break;
                }

            case 15: {
                    ret = nd15.Read(IRecNo);
                    break;
                }
            case 16: {
                    ret = nd16.Read(IRecNo);
                    break;
                }
            case 17: {
                    ret = nd17.Read(IRecNo);
                    break;
                }

            default: throw new InvalidOperationException("ver");
            }
            return ret;
        }
        public bool Write(int IRecNo) {
            bool ret;
            switch (m_version) {
            case 11: {
                    ret = nd11.Write(IRecNo);
                    break;
                }

            case 12: {
                    ret = nd12.Write(IRecNo);
                    break;
                }

            case 13: {
                    ret = nd13.Write(IRecNo);
                    break;
                }

            case 14: {
                    ret = nd14.Write(IRecNo);
                    break;
                }

            case 15: {
                    ret = nd15.Write(IRecNo);
                    break;
                }
            case 16: {
                    ret = nd16.Write(IRecNo);
                    break;
                }
            case 17: {
                    ret = nd17.Write(IRecNo);
                    break;
                }

            default: throw new InvalidOperationException("ver");
            }
            return ret;
        }
        public bool Seek(int IRecNo) {
            bool ret;
            switch (m_version) {
            case 11: {
                    ret = nd11.Seek(IRecNo);
                    break;
                }

            case 12: {
                    ret = nd12.Seek(IRecNo);
                    break;
                }

            case 13: {
                    ret = nd13.Seek(IRecNo);
                    break;
                }

            case 14: {
                    ret = nd14.Seek(IRecNo);
                    break;
                }

            case 15: {
                    ret = nd15.Seek(IRecNo);
                    break;
                }
            case 16: {
                    ret = nd16.Seek(IRecNo);
                    break;
                }
            case 17: {
                    ret = nd17.Seek(IRecNo);
                    break;
                }

            default: throw new InvalidOperationException("ver");
            }
            return ret;
        }
        public bool Lock(int IRecNo) {
            bool ret;
            switch (m_version) {
            case 11: {
                    ret = nd11.Lock(IRecNo);
                    break;
                }

            case 12: {
                    ret = nd12.Lock(IRecNo);
                    break;
                }

            case 13: {
                    ret = nd13.Lock(IRecNo);
                    break;
                }

            case 14: {
                    ret = nd14.Lock(IRecNo);
                    break;
                }

            case 15: {
                    ret = nd15.Lock(IRecNo);
                    break;
                }
            case 16: {
                    ret = nd16.Lock(IRecNo);
                    break;
                }
            case 17: {
                    ret = nd17.Lock(IRecNo);
                    break;
                }

            default: throw new InvalidOperationException("ver");
            }
            return ret;
        }
        public bool Unlock(int IRecNo) {
            bool ret;
            switch (m_version) {
            case 11: {
                    ret = nd11.Unlock(IRecNo);
                    break;
                }

            case 12: {
                    ret = nd12.Unlock(IRecNo);
                    break;
                }

            case 13: {
                    ret = nd13.Unlock(IRecNo);
                    break;
                }

            case 14: {
                    ret = nd14.Unlock(IRecNo);
                    break;
                }

            case 15: {
                    ret = nd15.Unlock(IRecNo);
                    break;
                }
            case 16: {
                    ret = nd16.Unlock(IRecNo);
                    break;
                }
            case 17: {
                    ret = nd17.Unlock(IRecNo);
                    break;
                }

            default: throw new InvalidOperationException("ver");
            }
            return ret;
        }
        public bool FindFirst(object varField, object varSearch) {
            bool ret;
            switch (m_version) {
            case 11: {
                    ret = nd11.FindFirst(varField, varSearch);
                    break;
                }

            case 12: {
                    ret = nd12.FindFirst(varField, varSearch);
                    break;
                }

            case 13: {
                    ret = nd13.FindFirst(varField, varSearch);
                    break;
                }

            case 14: {
                    ret = nd14.FindFirst(varField, varSearch);
                    break;
                }

            case 15: {
                    ret = nd15.FindFirst(varField, varSearch);
                    break;
                }
            case 16: {
                    ret = nd16.FindFirst(varField, varSearch);
                    break;
                }
            case 17: {
                    ret = nd17.FindFirst(varField, varSearch);
                    break;
                }

            default: throw new InvalidOperationException("ver");
            }
            return ret;
        }
        public bool FindNext(object varField, object varSearch) {
            bool ret;
            switch (m_version) {
            case 11: {
                    ret = nd11.FindNext(varField, varSearch);
                    break;
                }

            case 12: {
                    ret = nd12.FindNext(varField, varSearch);
                    break;
                }

            case 13: {
                    ret = nd13.FindNext(varField, varSearch);
                    break;
                }

            case 14: {
                    ret = nd14.FindNext(varField, varSearch);
                    break;
                }

            case 15: {
                    ret = nd15.FindNext(varField, varSearch);
                    break;
                }
            case 16: {
                    ret = nd16.FindNext(varField, varSearch);
                    break;
                }
            case 17: {
                    ret = nd17.FindNext(varField, varSearch);
                    break;
                }

            default: throw new InvalidOperationException("ver");
            }
            return ret;
        }
        public int Count {
            get {
                int ret;
                switch (m_version) {
                case 11: {
                        ret = nd11.Count();
                        break;
                    }

                case 12: {
                        ret = nd12.Count();
                        break;
                    }

                case 13: {
                        ret = nd13.Count();
                        break;
                    }

                case 14: {
                        ret = nd14.Count();
                        break;
                    }

                case 15: {
                        ret = nd15.Count();
                        break;
                    }
                case 16: {
                        ret = nd16.Count();
                        break;
                    }
                case 17: {
                        ret = nd17.Count();
                        break;
                    }

                default: throw new InvalidOperationException("ver");
                }
                return ret;
            }
        }
    }
}
