Exemplo n.º 1
0
        public static Model.SystemUser ToEntity(this SystemUserModel model, Model.SystemUser systemUser = null)
        {
            var user = systemUser ?? new Model.SystemUser()
            {
                Id       = Guid.NewGuid(),
                Created  = DateTime.Now,
                Modified = DateTime.Now,
            };

            user.Active = model.Active;
            user.Locked = model.Locked;

            return(user);
        }
Exemplo n.º 2
0
 public static Staff ToEntity(this SystemUserModel model, Model.Staff staff)
 {
     staff = staff ?? new Staff
     {
         Id = Guid.NewGuid()
     };
     staff.DesignationId      = model.SelectedDesignationId;
     staff.CountrySubOfficeId = model.SelectedCountrySubOfficeId;
     if (model.FinanceLimitId.HasValue)
     {
         staff.FinanceLimitId = (Guid)model.FinanceLimitId;
     }
     return(staff);
 }
Exemplo n.º 3
0
 public static Model.Person ToEntity(this SystemUserModel model, Model.Person person)
 {
     person = person ?? new Person
     {
         Id = Guid.NewGuid()
     };
     if (model.Email != null)
     {
         person.OfficialEmail = model.Email;
     }
     person.FirstName     = model.FirstName;
     person.OtherNames    = model.OtherNames;
     person.IDNo          = model.IdNumber;
     person.OfficialPhone = model.OfficialPhone;
     return(person);
 }