Example #1
0
 private void CreateCompanyForEachUser(UserServiceReference.User[] users)
 {
     for (var i = 0; i < users.Length; i++)
     {
         var company = new CompanyInfo()
         {
             OwnerId     = users[i].Id,
             Name        = "Company " + i,
             Description = "Desciption"
         };
         companyService.Add(company);
     }
 }
Example #2
0
        public void CreateExecute()
        {
            if (!string.IsNullOrWhiteSpace(Name) || !string.IsNullOrWhiteSpace(Description))
            {
                CompanyInfo.OwnerId      = SystemUser.Instance.Id;
                CompanyInfo.CreationTime = DateTime.Now;

                if (_companyService.Add(CompanyInfo) != Guid.Empty)
                {
                    Name        = "";
                    Description = "";
                }
            }
        }