public CreateNewDogViewModel()
 {
     Gender.Add("Weibchen");
     Gender.Add("Rüde");
     Birthday       = DateTime.Now;
     CastratedSince = DateTime.Now;
     EffectiveUntil = DateTime.Now;
 }
        /// <summary>
        /// Constructor initializes everything
        /// </summary>
        /// <param name="dog"></param>
        public DogDetailsViewModel(DogModel dog)
        {
            DogToEdit = dog;
            DogName   = DogToEdit.Name;
            Breed     = DogToEdit.Breed;
            Color     = DogToEdit.Color;
            Gender.Add("Weibchen");
            Gender.Add("Rüde");
            SelectedGender = DogToEdit.Gender;
            Birthday       = Convert.ToDateTime(DogToEdit.Birthday);

            if (DogToEdit.PermanentCastrated)
            {
                CastratedSince      = Convert.ToDateTime(DogToEdit.CastratedSince);
                EffectiveUntil      = DateTime.Now;
                CastrationIsDurable = true;
                PermanentCastrated  = true;
            }
            else
            {
                if (DogToEdit.EffectiveUntil != null)
                {
                    EffectiveUntil = Convert.ToDateTime(DogToEdit.EffectiveUntil);
                    CastratedSince = DateTime.Now;
                }
                else
                {
                    EffectiveUntil = DateTime.Now;
                }
                CastrationIsDurable    = false;
                CastrationIsNotDurable = true;
                PermanentCastrated     = false;
            }

            if (DogToEdit.Diseases != null && DogToEdit.Diseases.Count > 0)
            {
                DiseasesList = new BindableCollection <DiseasesModel>(DogToEdit.Diseases);
            }
            if (DogToEdit.Characteristics != null && DogToEdit.Characteristics.Count > 0)
            {
                CharacteristicsList = new BindableCollection <CharacteristicsModel>(DogToEdit.Characteristics);
            }
            if (DogToEdit.Active == 1)
            {
                NotActive = false;
            }
            else
            {
                NotActive = true;
            }
            DogToEdit.CustomerList = GlobalConfig.Connection.GetAllCustomerForDog(DogToEdit);
            if (DogToEdit.CustomerList != null && DogToEdit.CustomerList.Count > 0)
            {
                Owner = new BindableCollection <CustomerModel>(DogToEdit.CustomerList);
            }
            NotifyOfPropertyChange(() => Owner);
        }
Ejemplo n.º 3
0
        private void InitializeStartUpComboList()
        {
            this.SearchType = new List <string>();
            this.SearchType.Add("Add hoc");
            this.SearchType.Add("By Class, Section and Roll");
            this.SearchType.Add("Bulk");

            this.VillList = new List <string>();
            VillList.Add("Bakharpur");
            VillList.Add("Bamongram");
            VillList.Add("Chamagram");
            VillList.Add("Chaspara");
            VillList.Add("Goyeshbari");
            VillList.Add("Harugram");
            VillList.Add("Jalalpur");
            VillList.Add("Mosimpur");
            VillList.Add("Nazirpur");
            VillList.Add("Paharpur");
            VillList.Add("Sujapur");

            this.POList = new List <string>();
            POList.Add("Bakharpur");
            POList.Add("Bamongram");
            POList.Add("Chaspara");
            POList.Add("Chhoto Sujapur");
            POList.Add("Fatehkhani");
            POList.Add("Gayeshbari");
            POList.Add("Jalalpur");
            POList.Add("Mosimpur");
            POList.Add("Sujapur");

            this.PSList = new List <string>();
            PSList.Add("Kaliachak");

            this.DistList = new List <string>();
            DistList.Add("Malda");

            this.PinList = new List <string>();
            PinList.Add("732206");

            this.Gender = new List <string>();
            Gender.Add("Boy");
            Gender.Add("Girl");

            this.SchoolClass = new List <string>();
            SchoolClass.Add("V");
            SchoolClass.Add("VI");
            SchoolClass.Add("VII");
            SchoolClass.Add("VIII");
            SchoolClass.Add("IX");
            SchoolClass.Add("X");
            SchoolClass.Add("XI");
            SchoolClass.Add("XII");

            this.SchoolSection = new List <string>();
            SchoolSection.Add("A");
            SchoolSection.Add("B");
            SchoolSection.Add("C");
            SchoolSection.Add("D");
            SchoolSection.Add("E");
        }