Exemplo n.º 1
0
        public Technician CreateTechnician(Technician technician, TechnicianProfileEntity technicianProfileEntity)
        {
            technician.CanDoPreAudit = technicianProfileEntity.CanCompletePreAudit;
            technician.IsTeamLead    = technicianProfileEntity.IsTeamLead;
            technician.TechnicianId  = technicianProfileEntity.OrganizationRoleUserId;
            technician.Pin           = !string.IsNullOrWhiteSpace(technicianProfileEntity.Pin) ? technicianProfileEntity.Pin.Decrypt() : string.Empty;
            technician.PinChangeDate = technicianProfileEntity.PinChangeDate;

            return(technician);
        }
Exemplo n.º 2
0
 public bool UpdatePin(long technicianId, string pin)
 {
     using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
     {
         var eventCustomerResultEntity = new TechnicianProfileEntity(technicianId)
         {
             Pin = pin, PinChangeDate = DateTime.Now
         };
         var bucket = new RelationPredicateBucket(TechnicianProfileFields.OrganizationRoleUserId == technicianId);
         return(myAdapter.UpdateEntitiesDirectly(eventCustomerResultEntity, bucket) > 0);
     }
 }