Ejemplo n.º 1
0
        public async Task <bool> SetPersonName(string fName, string lName, string patronym, string date, string personId)
        {
            if (string.IsNullOrWhiteSpace(fName) ||
                string.IsNullOrWhiteSpace(personId))
            {
                return(false);
            }

            PersonName personName = new PersonName();

            personName.Id              = Guid.NewGuid().ToString();
            personName.Firstname       = fName;
            personName.Lastname        = lName;
            personName.Patronym        = patronym;
            personName.DateNameChanged = DateTime.Parse(date);
            personName.PersonId        = personId;

            var person = await _mgrFcc.GetPerson(personId);

            bool hasNothingChanged =
                (person.Firstname == fName &&
                 person.Lastname == lName &&
                 person.Patronym == patronym);

            if (hasNothingChanged)
            {
                return(false);
            }

            var result = await _mgrFcc.SetPersonName(personName);

            if (string.IsNullOrWhiteSpace(result))
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public async Task <KeyValuePair <string, IEnumerable <FileContent> > > CreatePartialViewPersonPhotos(string personId)
        {
            var person = await _mgrFcc.GetPerson(personId);

            return(new KeyValuePair <string, IEnumerable <FileContent> >(person.FileContentId, await _mgrFcc.GetAllPhotosByPersonId(personId)));
        }