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); } }
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 = ""; } } }