Example #1
0
 public objUserProfile Select(int userID)
 {
     objUserProfile o = new objUserProfile();
     IDataReader idr = db.Select(userID);
     o = Select_Obj(idr);
     return o;
 }
Example #2
0
 public objUserProfile Select(string userEmail)
 {
     objUserProfile o = new objUserProfile();
     IDataReader idr = db.Select(userEmail);
     o = Select_Obj(idr);
     return o;
 }
Example #3
0
        public objUserProfile Select_Obj(IDataReader idr)
        {
            objUserProfile o = new objUserProfile();
            bool rtNull = true;

            if (idr != null)
            {
                while (idr.Read())
                {
                    rtNull = false;

                    if (idr["userID"] != DBNull.Value)
                    {
                        o.userID = Convert.ToInt32(idr["userID"]);
                    }
                    if (idr["userFirstName"] != DBNull.Value)
                    {
                        o.userFirstName = Convert.ToString(idr["userFirstName"]);
                    }
                    if (idr["userMiddleName"] != DBNull.Value)
                    {
                        o.userMiddleName = Convert.ToString(idr["userMiddleName"]);
                    }
                    if (idr["userLastName"] != DBNull.Value)
                    {
                        o.userLastName = Convert.ToString(idr["userLastName"]);
                    }
                    if (idr["userEmail"] != DBNull.Value)
                    {
                        o.userEmail = Convert.ToString(idr["userEmail"]);
                    }
                    if (idr["userIsOfficial"] != DBNull.Value)
                    {
                        o.userIsOfficial = Convert.ToBoolean(idr["userIsOfficial"]);
                    }
                    if (idr["userIsActive"] != DBNull.Value)
                    {
                        o.userIsActive = Convert.ToBoolean(idr["userIsActive"]);
                    }
                }
            }

            if (rtNull)
            {
                o = null;
            }

            return o;
        }
Example #4
0
 public void Update(objUserProfile i)
 {
     db.Update(
     i.userID, i.userFirstName, i.userMiddleName, i.userLastName, i.userEmail, i.userIsOfficial, i.userIsActive);
 }