Пример #1
0
        void SaveFlat(object param)
        {
            try
            {
                ErrorVisibility = "Collapsed";

                if (ValidateFlat())
                {
                    if (Flats == null)
                    {
                        Flats = new ObservableCollection <FlatModel>();
                    }
                    Flats.Add(new FlatModel
                    {
                        Number               = FlatNumber,
                        ProjectId            = SelectedProject.ID,
                        Project              = SelectedProject,
                        EstimatedAmount      = EstimatedAmount,
                        AggregateAmountTotal = AggregateAmountTotal,
                        EMI  = EMI,
                        Days = Days
                    });
                    ClearFlatFields();
                }
            }
            catch (Exception ex)
            {
                ErrorMessage    = $"Error: {ex.Message}";
                ErrorVisibility = "Visible";
            }
        }
Пример #2
0
        public void LoadData()
        {
            var res = doc.Element("root").Elements("flat").ToList();

            foreach (var x in res)
            {
                Flat c = new Flat()
                {
                    Region = x.Attribute("region").Value,
                    Price  = x.Attribute("price").Value,
                    Adress = x.Attribute("adress").Value,
                    Owner  = x.Attribute("owner").Value,
                    Phone  = x.Attribute("phone").Value
                };
                Flats.Add(c);
            }
        }
Пример #3
0
 public void AddFlat(Flat flat)
 {
     Flats.Add(flat);
     IsDirty = false;
 }