using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using System.ComponentModel;
using Eloquera.Client;
namespace digioz
{
    public class UserProfile
    {
        private int ciID;
        private string csUsername;
        private string csPassword;
        private string csPasswordEncrypted;
        private string csPermission;
        private string csEmail;
        private DateTime cdBirthday;
        private Boolean cbHideBirthday;
        private string csAddress;
        private string csAddress2;
        private string csCity;
        private string csState;
        private string csZip;
        private string csCountry;
        private string csSignature;
        private string csAvatar;

        public UserProfile()
        { }

        public string CleanText(string psText)
        {
            string lsText = psText.Replace("'", "''");
            return lsText;
        }
        [Index]
        public int ID
        {
            get { return ciID; }
            set { ciID = value; }
        }

        public string Username
        {
            get { return csUsername; }
            set { csUsername = CleanText(value); }
        }

        public string Password
        {
            get { return csPassword; }
            set { csPassword = value; }
        }

        public string PasswordEncrypted
        {
            get { return csPasswordEncrypted; }
            set { csPasswordEncrypted = value; }
        }

        public string Permission
        {
            get { return csPermission; }
            set { csPermission = CleanText(value); }
        }

        public string Email
        {
            get { return csEmail; }
            set { csEmail = CleanText(value); }
        }

        public DateTime Birthday
        {
            get { return cdBirthday; }
            set { cdBirthday = value; }
        }

        public Boolean HideBirthday
        {
            get { return cbHideBirthday; }
            set { cbHideBirthday = value; }
        }

        public string Address
        {
            get { return csAddress; }
            set { csAddress = CleanText(value); }
        }

        public string Address2
        {
            get { return csAddress2; }
            set { csAddress2 = CleanText(value); }
        }

        public string City
        {
            get { return csCity; }
            set { csCity = CleanText(value); }
        }

        public string State
        {
            get { return csState; }
            set { csState = CleanText(value); }
        }

        public string Zip
        {
            get { return csZip; }
            set { csZip = CleanText(value); }
        }

        public string Country
        {
            get { return csCountry; }
            set { csCountry = CleanText(value); }
        }

        public string Signature
        {
            get { return csSignature; }
            set { csSignature = CleanText(value).Replace("\n", "<br />"); }
        }

        public string Avatar
        {
            get { return csAvatar; }
            set { csAvatar = value; }
        }
    }

    public class UserProfileList : BindingList<UserProfile>
    {
        public UserProfileList()
        { }
    }
}
