private void Initiate()
        {
            SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(this);
            string DistanceString           = Save.LoadString(SaveUsingSharedPreferences.Tags.Organizator.Distanta);

            if (DistanceString != "")
            {
                Distanta = int.Parse(Save.LoadString(SaveUsingSharedPreferences.Tags.Organizator.Distanta));
            }
            else
            {
                Save.Save(SaveUsingSharedPreferences.Tags.Organizator.Distanta, "50");
                Distanta = 50;
            }
        }
        public override Android.Views.View GetView(int position, Android.Views.View convertView, Android.Views.ViewGroup parent)
        {
            LayoutInflater inflater = context.LayoutInflater;
            View           v        = inflater.Inflate(Resource.Layout.Organizator_Trip_GridViewAdapter, null, true);

            ImageView Icon_iView = v.FindViewById <ImageView> (Resource.Id.imageView1);

            Icon_iView.SetImageDrawable(Icons[position]);

            Icon_iView.Click += (object sender, EventArgs e) => {
                switch (position)
                {
                case 1: {
                    context.StartActivity(typeof(Organizator_Trip_VizualizareExcursionisti));
                } break;

                case 3:
                {
                    Dialog diag = new Dialog(context);
                    diag.Window.RequestFeature(WindowFeatures.NoTitle);

                    View      CostumView = inflater.Inflate(Resource.Layout.Utilizator_Trip_TripInfo_AlertDialogAdapter, null);
                    TextView  NumeCamp   = CostumView.FindViewById <TextView>(Resource.Id.textView1);
                    ImageView EditInfo   = CostumView.FindViewById <ImageView>(Resource.Id.imageView1);
                    EditText  NewValue   = CostumView.FindViewById <EditText>(Resource.Id.editText1);

                    SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(context);
                    string Distanta = Save.LoadString(SaveUsingSharedPreferences.Tags.Organizator.Distanta);

                    NumeCamp.Text   = "Valoarea actuala este:" + Distanta;
                    EditInfo.Click += (object sender1, EventArgs e1) =>
                    {
                        Save.Save(SaveUsingSharedPreferences.Tags.Organizator.Distanta, NewValue.Text);

                        diag.Cancel();
                    };

                    diag.SetContentView(CostumView);

                    diag.SetCanceledOnTouchOutside(true);
                    diag.Show();
                    diag.Window.SetBackgroundDrawable(context.Resources.GetDrawable(Resource.Drawable.background_MarginiOvaleAlb));
                } break;

                case 4: {
                    PopupMenu popup = new PopupMenu(context, v);
                    popup.MenuItemClick += (object s, PopupMenu.MenuItemClickEventArgs e1) =>
                    {
                        switch (e1.Item.ToString())
                        {
                        case "Adauga intrebare noua":
                        {
                            context.StartActivity(typeof(Organizator_Trip_NewQuestionPool));
                        } break;

                        case "Vezi progresul intrebarilor actuale":
                        {
                            TcpClient     Client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort);
                            NetworkStream ns     = Client.GetStream();

                            string TripId = new SaveUsingSharedPreferences(context).LoadString(SaveUsingSharedPreferences.Tags.Trip.TipId);
                            _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { _Details.RequestVotesQuestionPool, TripId }));

                            string[] Response = CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(ns));

                            string[] Intrebari = Response[0].Split(',');
                            string[] Ids       = Response[1].Split(',');

                            var Test = new Organizator_Trip_ViewQuestionPool_Adapters.IntrebarVariante[Intrebari.Length];

                            for (int i = 0; i < Intrebari.Length; i++)
                            {
                                Response = CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(ns));

                                List <string> Variante = new List <string>();
                                List <string> Procente = new List <string>();

                                for (int j = 0; j < Response.Length; j++)
                                {
                                    if (Response[j] != "")
                                    {
                                        Variante.Add(Response[j].Split(',')[0]);
                                        Procente.Add(Response[j].Split(',')[1]);
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }

                                var temp = new Organizator_Trip_ViewQuestionPool_Adapters.IntrebarVariante();
                                temp.Intrebare = Intrebari[i];
                                temp.Variante  = Variante.ToArray();
                                temp.Procente  = Procente.ToArray();

                                Test[i] = temp;
                            }

                            Organizator_Trip_ViewQuestionPool_DialogFragment diag = new Organizator_Trip_ViewQuestionPool_DialogFragment(Test);
                            diag.Show(context.FragmentManager, "ViewQuestionPool");
                        } break;
                        }
                    };
                    MenuInflater menuInflater = popup.MenuInflater;
                    menuInflater.Inflate(Resource.Menu.OptiuniQuestionPool, popup.Menu);
                    popup.Show();
                } break;
                }
            };

            return(v);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View v = inflater.Inflate(Layouturi[position], container, false);
            SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(context);

            switch (position)
            {
            case 0:
            {
                TextView    Nume_TView    = v.FindViewById <TextView> (Resource.Id.textView1);
                TextView    Prenume_TView = v.FindViewById <TextView> (Resource.Id.textView2);
                TextView    Varsta_TView  = v.FindViewById <TextView> (Resource.Id.textView3);
                TextView    Sex_TView     = v.FindViewById <TextView> (Resource.Id.textView4);
                RadioButton Masculin      = v.FindViewById <RadioButton> (Resource.Id.radioButton1);
                RadioButton Feminin       = v.FindViewById <RadioButton> (Resource.Id.radioButton3);
                EditText    Nume_EText    = v.FindViewById <EditText> (Resource.Id.editText1);
                EditText    Prenume_EText = v.FindViewById <EditText> (Resource.Id.editText2);
                EditText    Varsta_EText  = v.FindViewById <EditText> (Resource.Id.editText3);

                Nume_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Nume, Nume_EText.Text);
                };

                Prenume_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Prenume, Prenume_EText.Text);
                };

                Varsta_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Varsta, Varsta_EText.Text);
                };

                Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Masculin");
                Masculin.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                    if (e.IsChecked)
                    {
                        Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Masculin");
                    }
                    else
                    {
                        Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Feminin");
                    }
                };

                SetTypeface.Normal.SetTypeFace(context, Nume_TView);
                SetTypeface.Normal.SetTypeFace(context, Prenume_TView);
                SetTypeface.Normal.SetTypeFace(context, Varsta_TView);
                SetTypeface.Normal.SetTypeFace(context, Sex_TView);
                SetTypeface.Normal.SetTypeFace(context, Masculin);
                SetTypeface.Normal.SetTypeFace(context, Feminin);
            }
            break;

            case 1:
            {
                TextView    Email_TView        = v.FindViewById <TextView> (Resource.Id.textView1);
                TextView    NumarTelefon_TView = v.FindViewById <TextView> (Resource.Id.textView2);
                TextView    Mark               = v.FindViewById <TextView> (Resource.Id.textView3);
                TextView    TipCont_TView      = v.FindViewById <TextView> (Resource.Id.textView4);
                RadioButton Utilizator         = v.FindViewById <RadioButton> (Resource.Id.radioButton1);
                RadioButton Organizator        = v.FindViewById <RadioButton> (Resource.Id.radioButton3);
                EditText    Email_EText        = v.FindViewById <EditText> (Resource.Id.editText1);
                EditText    NumarTelefon_EText = v.FindViewById <EditText> (Resource.Id.editText2);

                SetTypeface.Normal.SetTypeFace(context, Email_TView);
                SetTypeface.Normal.SetTypeFace(context, NumarTelefon_TView);
                SetTypeface.Normal.SetTypeFace(context, Mark);
                SetTypeface.Normal.SetTypeFace(context, TipCont_TView);
                SetTypeface.Normal.SetTypeFace(context, Utilizator);
                SetTypeface.Normal.SetTypeFace(context, Organizator);

                Save.Save(SaveUsingSharedPreferences.Tags.SetUp.TipCont, "Utilizator");
                Utilizator.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                    if (e.IsChecked)
                    {
                        Save.Save(SaveUsingSharedPreferences.Tags.SetUp.TipCont, "Utilizator");
                    }
                    else
                    {
                        Save.Save(SaveUsingSharedPreferences.Tags.SetUp.TipCont, "Organizator");
                    }
                };

                Email_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Email, Email_EText.Text);
                };

                NumarTelefon_EText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.SetUp.NumarTelefon, NumarTelefon_EText.Text);
                };
            }
            break;

            case 2:
            {
                ImageView ChaptaView        = v.FindViewById <ImageView> (Resource.Id.imageView1);
                TextView  VIntroducetiCodul = v.FindViewById <TextView> (Resource.Id.textView1);
                TextView  VParola           = v.FindViewById <TextView> (Resource.Id.textView2);
                TextView  VConfParola       = v.FindViewById <TextView> (Resource.Id.textView3);
                Button    Gata             = v.FindViewById <Button> (Resource.Id.button1);
                EditText  Chapta           = v.FindViewById <EditText> (Resource.Id.editText1);
                EditText  Parola_EText     = v.FindViewById <EditText> (Resource.Id.editText2);
                EditText  ConfParola_Etext = v.FindViewById <EditText> (Resource.Id.editText3);

                SetTypeface.Normal.SetTypeFace(context, VIntroducetiCodul);
                SetTypeface.Normal.SetTypeFace(context, Gata);
                SetTypeface.Normal.SetTypeFace(context, VParola);
                SetTypeface.Normal.SetTypeFace(context, VConfParola);

                DisplayChapta displayChapta = new DisplayChapta(5);
                displayChapta.Create();
                string ChaptaText = displayChapta.GetText();
                Bitmap b          = displayChapta.GetBitmap();
                ChaptaView.SetImageBitmap(b);

                Gata.Click += (object sender, EventArgs e) => {
                    string Nume         = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Nume);
                    string Prenume      = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Prenume);
                    string Varsta       = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Varsta);
                    string Sex          = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Sex);
                    string Email        = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.Email);
                    string TipCont      = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.TipCont);
                    string NumarTelefon = Save.LoadString(SaveUsingSharedPreferences.Tags.SetUp.NumarTelefon);
                    string Parola       = Parola_EText.Text;
                    string ConfParola   = ConfParola_Etext.Text;

                    //if (VerificareDate (
                    //	Nume,Prenume,Varsta,Email,NumarTelefon,Parola,ConfParola,Chapta.Text, ChaptaText)) {

                    TcpClient     Client = new TcpClient(_Details.ServerIP, _Details.LoginSignUpNewTripPort);
                    NetworkStream ns     = Client.GetStream();

                    _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { "SIGNUP", Nume, Prenume, Varsta, Sex, Email, NumarTelefon, TipCont, Parola }));

                    if (CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(ns))[0] == "ok")
                    {
                        Toast.MakeText(context, "Ala-i bosssss!", ToastLength.Long).Show();

                        Intent StartLogin = new Intent(context, typeof(Login));
                        StartLogin.PutExtra("BackgroundLoginByteArray", DrawableConverter.DrawableToByteArray(context.Background.Background));
                        context.StartActivity(StartLogin);
                    }
                    else
                    {
                        Toast.MakeText(context, "Fail!", ToastLength.Long).Show();
                        Intent StartLogin = new Intent(context, typeof(Login));
                        StartLogin.PutExtra("BackgroundLoginByteArray", DrawableConverter.DrawableToByteArray(context.Background.Background));
                        context.StartActivity(StartLogin);
                    }

                    //}
                };
            }
            break;
            }

            return(v);
        }
        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            View v = inflater.Inflate(Layouturi[position], null, true);
            SaveUsingSharedPreferences Save = new SaveUsingSharedPreferences(context);

            switch (position)
            {
            case 0:
            {
                TextView    TViewDestinatiePrincipala = v.FindViewById <TextView> (Resource.Id.textView1);
                TextView    TViewTipulParticipantilor = v.FindViewById <TextView> (Resource.Id.textView4);
                EditText    DestinatiePrincipala      = v.FindViewById <EditText> (Resource.Id.editText1);
                RadioButton Elevi           = v.FindViewById <RadioButton> (Resource.Id.radioButton1);
                RadioButton PersoanePrivate = v.FindViewById <RadioButton> (Resource.Id.radioButton3);

                SetTypeface.Normal.SetTypeFace(context, TViewDestinatiePrincipala);
                SetTypeface.Normal.SetTypeFace(context, TViewTipulParticipantilor);
                SetTypeface.Normal.SetTypeFace(context, DestinatiePrincipala);
                SetTypeface.Normal.SetTypeFace(context, Elevi);
                SetTypeface.Normal.SetTypeFace(context, PersoanePrivate);

                DestinatiePrincipala.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DestinatiePrincipala, DestinatiePrincipala.Text);
                };

                Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.TipulParticipantilor, "Elevi");
                Elevi.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                    if (e.IsChecked)
                    {
                        Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Elevi");
                    }
                    else
                    {
                        Save.Save(SaveUsingSharedPreferences.Tags.SetUp.Sex, "Persoane private");
                    }
                };
            }
            break;

            case 1:
            {
                TextView   PerioadaExcursieiTView = v.FindViewById <TextView> (Resource.Id.textView1);
                TextView   DataPlecareTView       = v.FindViewById <TextView> (Resource.Id.textView2);
                TextView   DataIntoarcereTView    = v.FindViewById <TextView> (Resource.Id.textView3);
                DatePicker DataPlecare            = v.FindViewById <DatePicker> (Resource.Id.datePicker1);
                DatePicker DataIntoarcere         = v.FindViewById <DatePicker> (Resource.Id.datePicker2);

                SetTypeface.Normal.SetTypeFace(context, PerioadaExcursieiTView);
                SetTypeface.Normal.SetTypeFace(context, DataPlecareTView);
                SetTypeface.Normal.SetTypeFace(context, DataIntoarcereTView);

                Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DataPlecare, System.DateTime.Now.Day.ToString() + "." + System.DateTime.Now.Month.ToString() + "." + System.DateTime.Now.Year.ToString());
                DataPlecare.CalendarView.DateChange += (object sender, CalendarView.DateChangeEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DataPlecare, e.DayOfMonth.ToString() + "." + e.Month.ToString() + "." + e.Year.ToString());
                };

                Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DataIntoarcere, System.DateTime.Now.Day.ToString() + "." + System.DateTime.Now.Month.ToString() + "." + System.DateTime.Now.Year.ToString());
                DataIntoarcere.CalendarView.DateChange += (object sender, CalendarView.DateChangeEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.DataIntoarcere, e.DayOfMonth.ToString() + "." + e.Month.ToString() + "." + e.Year.ToString());
                };
            }
            break;

            case 2:
            {
                TextView   LocatiePlecareTView = v.FindViewById <TextView> (Resource.Id.textView1);
                TextView   OraPlecareTview     = v.FindViewById <TextView> (Resource.Id.textView2);
                EditText   LocatiePlecare      = v.FindViewById <EditText> (Resource.Id.editText1);
                TimePicker OraPlecare          = v.FindViewById <TimePicker> (Resource.Id.timePicker1);

                OraPlecare.SetIs24HourView(Java.Lang.Boolean.True);

                SetTypeface.Normal.SetTypeFace(context, LocatiePlecareTView);
                SetTypeface.Normal.SetTypeFace(context, OraPlecareTview);
                SetTypeface.Normal.SetTypeFace(context, LocatiePlecare);

                LocatiePlecare.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.LocatiePlecare, LocatiePlecare.Text);
                };

                Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.OraPlecare, System.DateTime.Now.Minute.ToString() + ":" + System.DateTime.Now.Hour.ToString());
                OraPlecare.TimeChanged += (object sender, TimePicker.TimeChangedEventArgs e) => {
                    Save.Save(SaveUsingSharedPreferences.Tags.NewTrip.OraPlecare, e.Minute.ToString() + ":" + e.HourOfDay.ToString());
                };
            }
            break;

            case 3:
            {
                Button   Finalizare      = v.FindViewById <Button> (Resource.Id.button1);
                TextView ObservatiiTView = v.FindViewById <TextView> (Resource.Id.textView1);
                EditText ObservatiiEText = v.FindViewById <EditText> (Resource.Id.editText1);

                SetTypeface.Normal.SetTypeFace(context, Finalizare);
                SetTypeface.Normal.SetTypeFace(context, ObservatiiTView);
                SetTypeface.Normal.SetTypeFace(context, ObservatiiEText);

                Finalizare.Click += (object sender, EventArgs e) => {
                    string DestinatiePrincipala = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.DestinatiePrincipala);
                    string TipulParticipantilor = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.TipulParticipantilor);
                    string DataPlecare          = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.DataPlecare);
                    string DataIntoarcere       = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.DataIntoarcere);
                    string LocatiePlecare       = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.LocatiePlecare);
                    string OraPlecare           = Save.LoadString(SaveUsingSharedPreferences.Tags.NewTrip.OraPlecare);
                    string Observatii           = ObservatiiEText.Text;
                    string NumeOrganizator      = "numeOrganizator";
                    string NumarTelefon         = new SaveUsingSharedPreferences(context).LoadString(SaveUsingSharedPreferences.Tags.Login.Username);

                    if (VerificareDate(DestinatiePrincipala, LocatiePlecare))
                    {
                        TcpClient     Client = new TcpClient(_Details.ServerIP, _Details.TripPort_INPUT);
                        NetworkStream ns     = Client.GetStream();

                        _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] {
                                "NEWTRIP",
                                DestinatiePrincipala,
                                TipulParticipantilor,
                                DataPlecare,
                                DataIntoarcere,
                                LocatiePlecare,
                                OraPlecare,
                                Observatii,
                                NumeOrganizator,
                                NumarTelefon
                            }));

                        if (CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(ns)) [0] == "1")
                        {
                            Toast.MakeText(context, "Ala-i bosssss!", ToastLength.Long).Show();

                            TcpClient     client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort);
                            NetworkStream Ns     = client.GetStream();

                            _TcpDataExchange.WriteStreamString(Ns, CryptDecryptData.CryptData(new string[] { _Details.GetTripId, new SaveUsingSharedPreferences(context).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) }));
                            string TripId = CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(Ns))[0];
                            new SaveUsingSharedPreferences(context).Save(SaveUsingSharedPreferences.Tags.Trip.TipId, TripId);

                            ns.Dispose();
                            client.Close();

                            Intent StartOrganizatorTrip = new Intent(context, typeof(Organizator_Trip));
                            StartOrganizatorTrip.PutExtra("BackgroundByteArray", DrawableConverter.DrawableToByteArray(Background));
                            context.StartActivity(StartOrganizatorTrip);
                        }
                        else
                        {
                            Toast.MakeText(context, "Fail!", ToastLength.Long).Show();
                            context.Finish();
                        }
                    }
                };
            }
            break;
            }

            return(v);
        }