コード例 #1
0
        private void checkHoste()
        {
            try
            {
                // string nom, string dNIPasaport, string telefon, string nacionalitat, string adreca, int codipostal, string poblacio
                hoste = new Hoste(Nom, DNIPasaport, Telefon, Nacionalitat, Adreca, Codipostal, Poblacio);

                Console.WriteLine(hoste.ToString());
                bool hostevalid = false;

                if (Nom != null && DNIPasaport != null && Telefon != null && Nacionalitat != null && Adreca != null &&
                    Codipostal != 0 && Poblacio != null)
                {
                    hostevalid = true;
                }

                ah.afegirClientB.Enabled = hostevalid;

                Console.WriteLine(hostevalid);
            }
            catch (Exception ex)
            {
                //
            }
        }
コード例 #2
0
 private void getHosteSelected()
 {
     try
     {
         hosteSelected = (Hoste)ar.SeleccionaHosteInput.SelectedItem;
     }
     catch (Exception ex) {
         hosteSelected = new Hoste();
     }
 }
コード例 #3
0
ファイル: AfegirHosteController.cs プロジェクト: MikeGs/Hotel
        private void checkHoste()
        {
            try
            {
                // string nom, string dNIPasaport, string telefon, string nacionalitat, string adreca, int codipostal, string poblacio
                hoste = new Hoste(Nom, DNIPasaport, Telefon, Nacionalitat, Adreca, Codipostal, Poblacio);

                bool hostevalid = hoste.GetType().GetProperties().All(p => p.GetValue(hoste) != null);
                Console.WriteLine(hostevalid);
            }
            catch (Exception ex)
            {
                //
            }
        }