コード例 #1
0
        public ZipCodePart Copy()
        {
            ZipCodePart _zipCodePart = new ZipCodePart();

            _zipCodePart.StateCode = _stateCode;
            _zipCodePart.ZipPart   = _zipPart;
            return(_zipCodePart);
        }
コード例 #2
0
 static private void LoadZipCodePart(ZipCodePart objZipCodePart, IDataReader _reader)
 {
     if (_reader.IsDBNull(0) != true)
     {
         objZipCodePart.StateCode = _reader.GetString(0);
     }
     if (_reader.IsDBNull(1) != true)
     {
         objZipCodePart.ZipPart = _reader.GetString(1);
     }
 }
コード例 #3
0
        static public List <ZipCodePart> GetForState(string StateCode)
        {
            List <ZipCodePart> objZipCodeParts = new List <ZipCodePart>();
            Database           db = DatabaseFactory.CreateDatabase("BRGCaseMail");

            using (IDataReader reader = db.ExecuteReader(CommandType.Text, _selectViewSQL + " Where StateCode = '" + StateCode + "' order by StateCode asc, ZipPart asc"))
            {
                while (reader.Read())
                {
                    ZipCodePart objZipCodePart = new ZipCodePart();
                    LoadZipCodePart(objZipCodePart, reader);
                    objZipCodePart.IsModified = false;
                    objZipCodeParts.Add(objZipCodePart);
                }
                // always call Close when done reading.
                reader.Close();
                return(objZipCodeParts);
            }
        }
コード例 #4
0
        static public ZipCodePart GetByID(int ID)
        {
            ZipCodePart objZipCodePart = new ZipCodePart();
            string      query          = _selectViewSQL + " where ID = " + ID;
            Database    db             = DatabaseFactory.CreateDatabase("BRGCaseMail");

            using (IDataReader reader = db.ExecuteReader(CommandType.Text, query))
            {
                if (reader.Read())
                {
                    LoadZipCodePart(objZipCodePart, reader);
                    // always call Close when done reading.
                    reader.Close();
                    objZipCodePart.IsModified = false;
                    return(objZipCodePart);
                }
                else
                {
                    return(null);
                }
            }
        }