Esempio n. 1
0
 public CharityProfile(int UserID, string UserName, UserRole Role,
                       string FullName,
                       string City, string Province, string PostalCode, string Address1, string Address2,
                       string Phone, string Website, string Email,
                       string RegNumber,
                       CharityCategory Category, CharityDesignation Designation) :
     this(UserID, UserName, Role, FullName, City, Province, PostalCode, Address1, Address2, Phone, Website, Email,
          RegNumber, Category, Designation, new List <CharityProgram>(), new List <CharityActivityCountry>())
 {
 }
Esempio n. 2
0
 public CharityProfile(int UserID, string UserName, UserRole Role,
     string FullName,
     string City, string Province, string PostalCode, string Address1, string Address2,
     string Phone, string Website, string Email,
     string RegNumber,
     CharityCategory Category, CharityDesignation Designation)
     : this(UserID, UserName, Role, FullName, City, Province, PostalCode, Address1, Address2, Phone, Website, Email,
             RegNumber, Category, Designation, new List<CharityProgram>(), new List<CharityActivityCountry>())
 {
 }
Esempio n. 3
0
        public CharityProfile(int UserID, string UserName, UserRole Role,
                              string FullName,
                              string City, string Province, string PostalCode, string Address1, string Address2,
                              string Phone, string Website, string Email,
                              string RegNumber,
                              CharityCategory Category, CharityDesignation Designation,
                              List <CharityProgram> Programs, List <CharityActivityCountry> Countries) :
            base(UserID, UserName, Role, FullName, City, Province, PostalCode, Address1, Address2, Phone, Website, Email)
        {
            this.RegNumber = RegNumber;

            this.Category    = Category;
            this.Designation = Designation;

            this.Programs  = Programs;
            this.Countries = Countries;
        }
Esempio n. 4
0
        public CharityProfile(int UserID, string UserName, UserRole Role,
            string FullName,
            string City, string Province, string PostalCode, string Address1, string Address2,
            string Phone, string Website, string Email,
            string RegNumber,
            CharityCategory Category, CharityDesignation Designation,
            List<CharityProgram> Programs, List<CharityActivityCountry> Countries)
            : base(UserID, UserName, Role, FullName, City, Province, PostalCode, Address1, Address2, Phone, Website, Email)
        {
            this.RegNumber = RegNumber;

            this.Category = Category;
            this.Designation = Designation;

            this.Programs = Programs;
            this.Countries = Countries;
        }
Esempio n. 5
0
        private static CharityCategory GetCharityCategory(int CharityCategoryID)
        {
            try
            {
                //###########
                //# Command #
                //###########
                string command = "SELECT categoryID, charityType, description FROM [CharityCategory] WHERE categoryID = @CategoryID";

                //##############
                //# Parameters #
                //##############
                List<SqlParameter> parameters = new List<SqlParameter>();
                parameters.Add(new SqlParameter("@CategoryID", CharityCategoryID));

                //#############
                //# Execution #
                //#############
                DataTable table = DatabaseManager.ExecuteDataQueryCommand(command, parameters.ToArray());

                if (table == null)
                    return null;

                //############
                //# Analysis #
                //############
                CharityCategory category = null;

                if (table.Rows.Count > 0)
                {
                    DataRow row = table.Rows[0];

                    int categoryID = int.Parse(row["categoryID"].ToString());
                    string charityType = row["charityType"].ToString();
                    string description = row["description"].ToString();

                    category = new CharityCategory(categoryID, charityType, description);
                }

                return category;
            }
            catch { return null; }
        }