/// <summary>
        /// Get the allocated project for specific user
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public static IEnumerable<ProjectAssignment> GetAssignedProject(string userId)
        {
            var conn = new SqlConnection(SqlConString);
            var assignments = new List<ProjectAssignment>();
            try
            {
                var sqlQuery = string.Format("select UserId,ProjectId from DTSUserProject where UserId={0} and ProjectMgrId='"+HttpContext.Current.User.Identity.Name +"'", userId);
                var sqlCommand = new SqlCommand { CommandText = sqlQuery, Connection = conn };
                conn.Open();
                var sqlReader = sqlCommand.ExecuteReader();
                while (sqlReader.Read())
                {
                    var ap = new ProjectAssignment
                    {
                        UserId = int.Parse(sqlReader[0].ToString()),
                        ProjectId = int.Parse(sqlReader[1].ToString())
                    };
                    assignments.Add(ap);
                }

            }
            finally
            {
                if (conn.State != ConnectionState.Closed)
                {
                    conn.Close();
                }
            }
            return assignments;
        }
        private static IEnumerable<ProjectAssignment> GetProjectAssignments(object[] assignments)
        {
            if (assignments == null)
            {
                return null;
            }
            var passignmetns = new List<ProjectAssignment>();
            foreach (var assignment in assignments)
            {
                var passignment = new ProjectAssignment();
                var tmp = (Dictionary<string, object>)assignment;
                object objUserId = null;
                object objProjectId = null;
                if (tmp.TryGetValue("UserId", out objUserId))
                    passignment.UserId = int.Parse(objUserId.ToString());

                if (tmp.TryGetValue("ProjectId", out objProjectId))
                    passignment.ProjectId = int.Parse(objProjectId.ToString());
                passignmetns.Add(passignment);
            }
            return passignmetns;
        }