Ejemplo n.º 1
0
 private void CopyCustomer(Customer source, SimpleEditableCustomer target)
 {
     target.Id = source.Id;
     if (EditMode)
     {
         target.FirstName      = source.FirstName;
         target.LastName       = source.LastName;
         target.Gender         = source.Gender;
         target.BirthDateDay   = source.BirthDateDay;
         target.BirthDateMonth = source.BirthDateMonth;
         target.BirthDateYear  = source.BirthDateYear;
         target.BirthDate      = source.BirthDate;
         target.Comment        = source.Comment;
     }
 }
Ejemplo n.º 2
0
        public void SetCustomer(Customer customer)
        {
            _editingCustomer = customer;
            ACustomer        = new SimpleEditableCustomer();
            CopyCustomer(customer, ACustomer);

            var imagesFolderPath = AppDomain.CurrentDomain.BaseDirectory + @"Images\" + customer.Id;

            if (Directory.Exists(imagesFolderPath))
            {
                var imagePaths = Directory.GetFiles(imagesFolderPath, "*")
                                 .Select(Path.GetFullPath);
                ACustomer.Images.Clear();
                foreach (var path in imagePaths)
                {
                    ACustomer.Images.Add(new BitmapImage(new Uri(path)));
                }
            }
        }