/// <summary>
        /// Fetches community profile approval by specified parameters.
        /// It returns an empty array if there are no community profile approval in DB by specified arguments.
        /// If these arguments are null it returns all community profile approval from DB.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="username">The username.</param>
        /// <param name="approvedBy">The approved by.</param>
        /// <param name="fromDate">From date.</param>
        /// <param name="toDate">To date.</param>
        /// <param name="sortColumn">The sort column.</param>
        /// <returns></returns>
        private static CommunityProfileApproval[] Fetch(int? id, string username, string approvedBy,
                                                        DateTime? fromDate, DateTime? toDate, eSortColumn sortColumn)
        {
            //using (var conn = Config.DB.Open())
            {
                List<CommunityProfileApproval> lApprovals = new List<CommunityProfileApproval>();

                using (var reader = SqlHelper.GetDB().ExecuteReader("FetchCommunityProfileApproval",
                                             id, username, approvedBy, fromDate, toDate,sortColumn))
                {

                    while (reader.Read())
                    {
                        CommunityProfileApproval communityProfileApproval = new CommunityProfileApproval();

                        communityProfileApproval.id = (int) reader["ID"];
                        communityProfileApproval.username = (string) reader["Username"];
                        communityProfileApproval.approvedBy = (string) reader["ApprovedBy"];
                        communityProfileApproval.date = (DateTime) reader["Date"];
                        communityProfileApproval.approved = (bool) reader["Approved"];

                        lApprovals.Add(communityProfileApproval);
                    }
                    reader.Close();
                }
                return lApprovals.ToArray();
            }
        }
Exemplo n.º 2
0
        protected void btnReject_Click(object sender, EventArgs e)
        {
            if (CurrentNewUser != null)
            {
                CommunityProfileApproval cma = new CommunityProfileApproval(CurrentNewUser.Username, CurrentUserSession.Username);
                cma.Save();

                determineProfileState();
                loadNewUser(true);
            }
        }