protected void OnPatronChanged()
 {
     PersonImage = null;
     if (Patron != null)
     {
         PersonImage = QuickServiceCall.LoadPersonImage(Patron.PersonID);
     }
 }
Ejemplo n.º 2
0
 protected void OnPersonChanged(PersonModel old)
 {
     if (Person != null)
     {
         Person.PropertyChanged += Person_PropertyChanged;
         Person.Image            = QuickServiceCall.LoadPersonImage(Person.ID);
         imageChanged            = false;
     }
     if (old != null)
     {
         old.PropertyChanged -= Person_PropertyChanged;
     }
 }
 protected void OnSelectedModelChanged()
 {
     if (SelectedModel?.PersonID > 0)
     {
         int id = SelectedModel.PersonID ?? 0;
         if (!cache.ContainsKey(id))
         {
             cache.Add(id, QuickServiceCall.LoadPersonImage(id));
         }
         PersonImage = cache[id];
     }
     else
     {
         PersonImage = null;
     }
 }
Ejemplo n.º 4
0
 private void Person_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(Person.NationalNo))
     {
         var person = QuickServiceCall.PersonByNationalNo(Person.NationalNo);
         Mapper.Map(person, Person);
         if (person != null)
         {
             Person.Image = QuickServiceCall.LoadPersonImage(Person.ID);
         }
         imageChanged = false;
     }
     else if (e.PropertyName == nameof(Person.Image))
     {
         imageChanged = true;
     }
 }
Ejemplo n.º 5
0
        protected void OnSelectedModelChanged()
        {
            var request = new PatronRequest
            {
                Filter = new PatronFilter {
                    ID = SelectedModel.PatronID
                },
                LoadPerson = true,
            };
            var response = Helper.Call(s => s.PatronGet(request));

            ServiceResponseHelper.CheckServiceResponse(response, "PatronGet", request);
            Patron = Mapper.SmartMap(response.Result, new PatronModel(), (s, d) =>
            {
                d.Person = Mapper.Map(response.Result.Person, new PersonModel());
            });
            Image = QuickServiceCall.LoadPersonImage(Patron.PersonID);
        }