Reading DATA from an OBJECT asp.net MVC C#

Posted by kalyan on Stack Overflow See other posts from Stack Overflow or by kalyan
Published on 2010-05-11T20:52:39Z Indexed on 2010/05/11 20:54 UTC
Read the original article Hit count: 334

Filed under:
|
|
|

Hi, I am new to the MVC and I am stuck with a wierd situation. I have to read the Data from the type object and I tried different ways and I couldn't get a solution.Please help.

        IList<User> u = new UserRepository().Getuser(Name.ToUpper(), UserName.ToUpper(), UserCertNumber.ToUpper(), Date.ToUpper(), UserType.ToUpper(), Company.ToUpper(), PageNumber, Orderby, SearchALL.ToUpper(), PrintAllPages.ToUpper());


        object[] users = new object[u.Count];
        for (int i = 0; i < u.Count; i++)
        {
            users[i] = new
            {
                Id = u[i].UserId,
                Title = u[i].Title,
                FirstName = u[i].FirstName,
                LastName = u[i].LastName,
                Privileges = (from apps in u[i].UserPrivileges select new { PrivilegeId = apps.Privilege.PrivilegeId, PrivilegeName = apps.Privilege.Name, DeactiveDate = apps.DeactiveDate }),
                Status = (from status in u[i].UserStatus select new { StatusId = status.Status.StatusId, StatusName = status.Status.StatusName, DeactiveDate = status.DeactiveDate }),
                ActiveDate = u[i].ActiveDate,
                UserName = u[i].Email,
                UserCN = (from cert in u[i].UserCertificates select new { CertificateNumber = cert.CertificateNumber, DeactiveDate = cert.DeactiveDate }),
                Company = u[i].Company.Name

            };
        }



        string x = "";
        string y = "";

        var report = users;


        foreach (var r in report)
        {
            x = r[0].....;
            i want to assign the values from the report to something else and I am not able to read the data from the report object. Please help.
        }

Thank you.

© Stack Overflow or respective owner

Related posts about type

Related posts about object