コード例 #1
0
 public List<UserDetails> ShowAllUsersInCompany(string companyId)
 {
     int companyID = Convert.ToInt32(companyId);
     StoredProcedureDataContext dbmlObject = new StoredProcedureDataContext();
     var ShowAllUsersInCompanyResult = dbmlObject.ShowAllUsersInCompany(companyID).ToList();
     dbmlObject.SubmitChanges();
     List<UserDetails> userDetails = new List<UserDetails>();
     foreach (var i in ShowAllUsersInCompanyResult)
     {
         userDetails.Add(new UserDetails
                             {
                                 FirstName = i.FirstName,
                                 UserId = i.UserId
                             });
     }
     return userDetails;
 }
        public List <UserDetails> ShowAllUsersInCompany(string companyId)
        {
            int companyID = Convert.ToInt32(companyId);
            StoredProcedureDataContext dbmlObject = new StoredProcedureDataContext();
            var ShowAllUsersInCompanyResult       = dbmlObject.ShowAllUsersInCompany(companyID).ToList();

            dbmlObject.SubmitChanges();
            List <UserDetails> userDetails = new List <UserDetails>();

            foreach (var i in ShowAllUsersInCompanyResult)
            {
                userDetails.Add(new UserDetails
                {
                    FirstName = i.FirstName,
                    UserId    = i.UserId
                });
            }
            return(userDetails);
        }