public async Task <Models.User> GetUser(string id) { Systemuser user = await _crmrep.Get(id, "systemusers"); Models.User usr = new Models.User(); usr.Name = user.Fullname; usr.Title = user.Title; var org = await this.GetOrganization(user.Organizationid.ToString()); usr.Company = org.Name; return(usr); }
public async Task <Models.User> GetUserByDomain(string property, string value) { List <Models.User> users = new List <Models.User>(); Models.User usr = new Models.User(); List <Systemuser> list = await _crmrep.FilterbyContains("systemusers", property, value); Systemuser user = null; if (list.Count() > 0) { user = list.FirstOrDefault(); usr.Name = user.Fullname; usr.Title = user.Title; var org = await this.GetOrganization(user.Organizationid.ToString()); usr.Company = org.Name; } return(usr); }
public void RetrieveExistingTemplate() { Entity template = TemplatesHelper.RetrieveTemplateByName(TemplateName, this.CrmOrganisationService); Assert.IsTrue(template.Contains("presentationxml")); InstantiateTemplateRequest instantiateTemplateRequest = new InstantiateTemplateRequest() { ObjectId = Systemuser.GetCallingUserID(this.CrmOrganisationService) , ObjectType = "systemuser" , TemplateId = template.Id }; InstantiateTemplateResponse instantiateTemplateResponse = this.CrmOrganisationService.Execute(instantiateTemplateRequest) as InstantiateTemplateResponse; Assert.IsNotNull(instantiateTemplateResponse.EntityCollection.Entities[0]); Entity email = instantiateTemplateResponse.EntityCollection.Entities[0]; Assert.IsTrue(email.Contains("description")); }