/// <summary>
        /// Get department list.
        /// </summary>
        /// <param name="sessionKey">string</param>
        /// <param name="departmentid">string</param>
        /// <returns>string</returns>
        public string GetPrivateProject(string sessionKey, string privateprojectid, string approvalstatusid)
        {
            string retValue = string.Empty;
            List<PrivateProject> lstdepartment = new List<PrivateProject>();
            ResponseObjectForAnything obj = new ResponseObjectForAnything();
            int count = 0;
            bool isValid = true;
            if (!string.IsNullOrEmpty(sessionKey)) { isValid = IsValidSession(sessionKey); }

            if (isValid)
            {
                try
                {
                    Database db = DatabaseFactory.CreateDatabase();
                    DbCommand dbCommand = db.GetStoredProcCommand("usp_GetPrivateProject");
                    if (!string.IsNullOrEmpty(privateprojectid)) { db.AddInParameter(dbCommand, "@PrivateProjectID", DbType.Int32, Int32.Parse(privateprojectid)); }
                    else { db.AddInParameter(dbCommand, "@PrivateProjectID", DbType.Int32, null); }
                    if (!string.IsNullOrEmpty(approvalstatusid)) { db.AddInParameter(dbCommand, "@ApprovalStatusID", DbType.Int32, Int32.Parse(approvalstatusid)); }
                    else { db.AddInParameter(dbCommand, "@ApprovalStatusID", DbType.Int32, null); }

                    DataSet dsStates = db.ExecuteDataSet(dbCommand);

                    if (dsStates.Tables.Count > 0)
                    {
                        DataTable tState = dsStates.Tables[0];

                        foreach (DataRow dr in tState.Rows)
                        {
                            PrivateProject department = new PrivateProject();
                            if (dr["PrivateProjectID"] != DBNull.Value) { department.PrivateProjectID = Int32.Parse(dr["PrivateProjectID"].ToString()); }
                            if (dr["PersonID"] != DBNull.Value) { department.PersonID = Int32.Parse(dr["PersonID"].ToString()); }
                            if (dr["ApprovalStatusID"] != DBNull.Value) { department.ApprovalStatusID = Int32.Parse(dr["ApprovalStatusID"].ToString()); }
                            if (dr["ApprovalStatusName"] != DBNull.Value) { department.ApprovalStatusName = dr["ApprovalStatusName"].ToString(); }
                            if (dr["VideoFileName"] != DBNull.Value) { department.VideoFileName = dr["VideoFileName"].ToString(); }
                            if (dr["PhotoURL"] != DBNull.Value) { department.PhotoURL = dr["PhotoURL"].ToString(); }
                            if (dr["CreatedDate"] != DBNull.Value) { department.CreatedDate = Convert.ToDateTime(dr["CreatedDate"].ToString()); }
                            if (dr["IsEnabled"] != DBNull.Value) { department.IsEnabled = Convert.ToBoolean(dr["IsEnabled"].ToString()); }
                            lstdepartment.Add(department);
                            count++;
                        }
                        obj.ResultObjectJSON = Serializer.ObjectToJSON(lstdepartment);
                        obj.ResultCode = "SUCCESS";
                        obj.ResultObjectRecordCount = count;
                        if (obj.ResultObjectRecordCount <= 0) { obj.ResultMessage = "No records found."; }
                    }
                }
                catch (Exception ex)
                {
                    CustomException exc = new CustomException(ex.ToString(), this.ToString(), "GetDepartments", System.DateTime.Now);
                    ExceptionManager.PublishException(exc);
                }
            }
            return Serializer.ObjectToJSON(obj);
        }
        /// <summary>
        /// Get persons list.
        /// </summary>
        /// <param name="sessionKey">string</param>
        /// <param name="personId">string</param>
        /// <param name="personTypeId">string</param>
        /// <param name="persongroupid">string</param>
        /// <param name="langid">string</param>
        /// <param name="firstname">string</param>
        /// <param name="lastname">string</param>
        /// <param name="username">string</param>
        /// <param name="password">string</param>
        /// <param name="email">string</param>
        /// <param name="countryid">string</param>
        /// <param name="stateid">string</param>
        /// <param name="telhome">string</param>
        /// <param name="telwork">string</param>
        /// <param name="telmobile">string</param>
        /// <param name="profilepicture">string</param>
        /// <param name="personcode">string</param>
        /// <param name="jobtitle">string</param>
        /// <returns>string</returns>
        public string GetPersons(string sessionKey, string personId, string duedate, string persontypeid)
        {
            PersonObject personobj = new PersonObject();
            List<Person> lstPerson = new List<Person>();
            List<Address> lstAddress = new List<Address>();
            List<PersonCompletedQuiz> lstcompletedquiz = new List<PersonCompletedQuiz>();
            List<SteviArt.Common.DTO.Task> lsttasks = new List<Common.DTO.Task>();
            List<PrivateProject> lstprivateprojs = new List<PrivateProject>();
            List<PersonFeedback> lstfeedback = new List<PersonFeedback>();
            ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
            int count = 0;
            bool isValid = true;
            if (!string.IsNullOrEmpty(sessionKey)) { isValid = IsValidSession(sessionKey); }

            try
            {
                if (isValid)
                {
                    Database db = DatabaseFactory.CreateDatabase();
                    DbCommand dbCommand = db.GetStoredProcCommand("usp_GetPerson");
                    if (!string.IsNullOrEmpty(personId)) { db.AddInParameter(dbCommand, "@PersonID", DbType.Int32, Int32.Parse(personId)); }
                    else { db.AddInParameter(dbCommand, "@PersonID", DbType.Int32, null); }
                    if (!string.IsNullOrEmpty(duedate)) { db.AddInParameter(dbCommand, "@DueDate", DbType.DateTime, Convert.ToDateTime(duedate)); }
                    else { db.AddInParameter(dbCommand, "@DueDate", DbType.DateTime, null); }
                    if (!string.IsNullOrEmpty(persontypeid)) { db.AddInParameter(dbCommand, "@PersonTypeID", DbType.Int32, Int32.Parse(persontypeid)); }
                    else { db.AddInParameter(dbCommand, "@PersonTypeID", DbType.Int32, null); }

                    DataSet dsPersons = db.ExecuteDataSet(dbCommand);

                    if (dsPersons.Tables.Count > 0)
                    {
                        DataTable tUser = dsPersons.Tables[0];
                        foreach (DataRow dr in tUser.Rows)
                        {
                            Person person = new Person();
                            if (dr["PersonID"] != DBNull.Value) { person.PersonID = Int32.Parse(dr["PersonID"].ToString()); }
                            if (dr["PersonTypeID"] != DBNull.Value) { person.PersonTypeID = Int32.Parse(dr["PersonTypeID"].ToString()); }
                            if (dr["PreferredLanguageID"] != DBNull.Value) { person.PreferredLanguageID = Int32.Parse(dr["PreferredLanguageID"].ToString()); }
                            if (dr["FirstName"] != DBNull.Value) { person.FirstName = dr["FirstName"].ToString(); }
                            if (dr["LastName"] != DBNull.Value) { person.LastName = dr["LastName"].ToString(); }
                            if (dr["Username"] != DBNull.Value) { person.Username = dr["Username"].ToString(); }
                            if (dr["Email"] != DBNull.Value) { person.Email = dr["Email"].ToString(); }
                            if (dr["ProfilePicPath"] != DBNull.Value) { person.ProfilePicPath = dr["ProfilePicPath"].ToString(); }
                            if (dr["PersonGroupID"] != DBNull.Value) { person.PersonGroupID = Int32.Parse(dr["PersonGroupID"].ToString()); }
                            if (dr["GroupName"] != DBNull.Value) { person.GroupName = dr["GroupName"].ToString(); }
                            if (dr["PersonType"] != DBNull.Value) { person.PersonType = dr["PersonType"].ToString(); }
                            if (dr["RegisteredToken"] != DBNull.Value) { person.RegisteredToken = dr["RegisteredToken"].ToString(); }
                            if (dr["PointsEarned"] != DBNull.Value) { person.PointsEarned = Convert.ToInt32(dr["PointsEarned"].ToString()); }
                            if (dr["AvgFeedback"] != DBNull.Value) { person.AvgFeedback = Convert.ToDecimal(dr["AvgFeedback"].ToString()); }
                            if (dr["FullName"] != DBNull.Value) { person.FullName = dr["FullName"].ToString(); }
                            if (dr["AudioURL"] != DBNull.Value) { person.AudioURL = dr["AudioURL"].ToString(); }
                            if (dr["GroupAudioURL"] != DBNull.Value) { person.GroupAudioURL = dr["GroupAudioURL"].ToString(); }
                            lstPerson.Add(person);
                            count++;
                        }
                        personobj.Persons = lstPerson;
                    }
                    if(dsPersons.Tables.Count > 1)
                    {
                        DataTable tPersonQuiz = dsPersons.Tables[1];
                        foreach(DataRow dr in tPersonQuiz.Rows)
                        {
                            PersonCompletedQuiz completedquiz = new PersonCompletedQuiz();
                            if (dr["PersonCompletedQuizID"] != DBNull.Value) { completedquiz.PersonCompletedQuizID = Int32.Parse(dr["PersonCompletedQuizID"].ToString()); }
                            if (dr["VideoID"] != DBNull.Value) { completedquiz.VideoID = Int32.Parse(dr["VideoID"].ToString()); }
                            if (dr["VideoTitle"] != DBNull.Value) { completedquiz.VideoTitle = dr["VideoTitle"].ToString(); }
                            if (dr["CompletedDate"] != DBNull.Value) { completedquiz.CompletedDate = Convert.ToDateTime(dr["CompletedDate"].ToString()); }
                            if (dr["PointsEarned"] != DBNull.Value) { completedquiz.PointsEarned = Int32.Parse(dr["PointsEarned"].ToString()); }
                            lstcompletedquiz.Add(completedquiz);
                        }
                        personobj.PersonCompletedQuiz = lstcompletedquiz;
                    }
                    if (dsPersons.Tables.Count > 2)
                    {
                        DataTable tTasks = dsPersons.Tables[2];
                        foreach(DataRow dr in tTasks.Rows)
                        {
                            Common.DTO.Task task = new Common.DTO.Task();
                            if (dr["Title"] != DBNull.Value) { task.Title = dr["Title"].ToString(); }
                            if (dr["LastCompletionDate"] != DBNull.Value) { task.LastCompletionDate = Convert.ToDateTime(dr["LastCompletionDate"].ToString()); }
                            if (dr["PercentComplete"] != DBNull.Value) { task.PercentComplete = Decimal.Parse(dr["PercentComplete"].ToString()); }
                            if (dr["IsCompleted"] != DBNull.Value) { task.IsCompleted = Convert.ToBoolean(dr["IsCompleted"].ToString()); }
                            if (dr["DueDate"] != DBNull.Value) { task.DueDate = Convert.ToDateTime(dr["DueDate"].ToString()); }
                            lsttasks.Add(task);
                        }
                        personobj.Task = lsttasks;
                    }
                    if (dsPersons.Tables.Count > 3)
                    {
                        DataTable tPrivateProj = dsPersons.Tables[3];
                        foreach(DataRow dr in tPrivateProj.Rows)
                        {
                            Common.DTO.PrivateProject privateproj = new PrivateProject();
                            if (dr["PhotoURL"] != DBNull.Value) { privateproj.PhotoURL = dr["PhotoURL"].ToString(); }
                            if (dr["CreatedDate"] != DBNull.Value) { privateproj.CreatedDate = Convert.ToDateTime(dr["CreatedDate"].ToString()); }
                            if (dr["PersonID"] != DBNull.Value) { privateproj.PersonID = Int32.Parse(dr["PersonID"].ToString()); }
                            if (dr["ApprovalStatusName"] != DBNull.Value) { privateproj.ApprovalStatusName = dr["ApprovalStatusName"].ToString(); }
                            lstprivateprojs.Add(privateproj);
                        }
                        personobj.PrivateProject = lstprivateprojs;
                    }
                    if(dsPersons.Tables.Count > 4)
                    {
                        DataTable tFeedback = dsPersons.Tables[4];
                        foreach (DataRow dr in tFeedback.Rows)
                        {
                            Common.DTO.PersonFeedback feedback = new PersonFeedback();
                            if (dr["PersonFeedbackID"] != DBNull.Value) { feedback.PersonFeedbackID = Int32.Parse(dr["PersonFeedbackID"].ToString()); }
                            if (dr["PersonID"] != DBNull.Value) { feedback.PersonID = Int32.Parse(dr["PersonID"].ToString()); }
                            if (dr["PersonName"] != DBNull.Value) { feedback.PersonName = dr["PersonName"].ToString(); }
                            if (dr["Feedback"] != DBNull.Value) { feedback.Feedback = Convert.ToDecimal(dr["Feedback"].ToString()); }
                            if (dr["FeedbackSubmitterID"] != DBNull.Value) { feedback.FeedbackSubmitterID = Int32.Parse(dr["FeedbackSubmitterID"].ToString()); }
                            if (dr["FeedbackSubmitterName"] != DBNull.Value) { feedback.FeedbackSubmitterName = dr["FeedbackSubmitterName"].ToString(); }
                            if (dr["RankTopicID"] != DBNull.Value) { feedback.RankTopicID = Int32.Parse(dr["RankTopicID"].ToString()); }
                            if (dr["RankTopic"] != DBNull.Value) { feedback.RankTopic = dr["RankTopic"].ToString(); }
                            lstfeedback.Add(feedback);
                        }
                        personobj.PersonFeedback = lstfeedback;
                    }
                }
                responseObject.ResultObjectJSON = Serializer.ObjectToJSON(personobj);
                responseObject.ResultCode = "SUCCESS";
                responseObject.ResultObjectRecordCount = count;
                if (responseObject.ResultObjectRecordCount <= 0) { responseObject.ResultMessage = "No records found."; }
            }
            catch (Exception ex)
            {
                CustomException exc = new CustomException(ex.ToString(), this.ToString(), "GetPersons", System.DateTime.Now);
                ExceptionManager.PublishException(exc);
            }
            return Serializer.ObjectToJSON(responseObject);
        }