public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			ViewGroup root = (ViewGroup)inflater.Inflate (Resource.Layout.layout_ticketjuridico, null);

			TextView txtCorreo = root.FindViewById<TextView> (Resource.Id.txtEmail);
			TextView txtNombre = root.FindViewById<TextView> (Resource.Id.txtNombreApellido);
			TextView txtAvisoPrivacidad = root.FindViewById<TextView> (Resource.Id.txtAvisoPrivacidad);

			if (!string.IsNullOrEmpty (TipsFragment.Email)) {
				txtCorreo.Text = TipsFragment.Email.Trim ();
			}

			if (!string.IsNullOrEmpty (TipsFragment.Nombre)) {
				txtNombre.Text = TipsFragment.Nombre.Trim ();
			}

			//cocoservices.tinnova.mx.COCOService cliente = new Navigation_View.cocoservices.tinnova.mx.COCOService ();
			services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService();

			//cliente.ChannelFactory.CreateChannel ();
			string string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";

			Typeface font = Typeface.CreateFromAsset (Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf");

			Button btnRegistrar = root.FindViewById<Button> (Resource.Id.btnAceptar);


			btnRegistrar.SetTypeface (font, TypefaceStyle.Normal);

			txtAvisoPrivacidad.Click += (object sender, EventArgs e) => 
			{
				var uri = Android.Net.Uri.Parse ("http://www.911Consumidor.com/avisoPrivacidad");
				var intent = new Intent (Intent.ActionView, uri);
				StartActivity (intent);
			};


			btnRegistrar.Click += (object sender, EventArgs e) => {
				btnRegistrar.SetBackgroundColor (Color.White);
				btnRegistrar.SetTextColor (Color.Orange);
				string strError = "";
				//EditText txtNombre = root.FindViewById<EditText> (Resource.Id.txtNombreApellido);
				EditText txtTelefono = root.FindViewById<EditText> (Resource.Id.txtPhone);
				Spinner ddEstado = root.FindViewById<Spinner> (Resource.Id.ddlEstado);
				EditText txtCiudad = root.FindViewById<EditText> (Resource.Id.txtCiudad);
				EditText txtNota = root.FindViewById<EditText> (Resource.Id.txtNota);
				Drawable icon_error = Resources.GetDrawable (Resource.Drawable.Error128);
				//cliente.ChannelFactory = 

				try {

					Ticket ticket = new Ticket ();

//					if (!string.IsNullOrEmpty (txtNombre.Text.Trim ()))
//						ticket.Nombre = txtNombre.Text.Trim ();
//					else {
//						txtNombre.SetError ("Es requerido un Nombre ", icon_error);
//						strError += "Nombre";
//					}
					ticket.Email = txtCorreo.Text.Trim ();
					if (!string.IsNullOrEmpty (txtTelefono.Text.Trim ()))
						ticket.Telefono = txtTelefono.Text.Trim ();
					else {
						txtTelefono.SetError ("Es requerido un Telefono ", icon_error);
						strError += "Telefono";
					}
					if (!string.IsNullOrEmpty (txtNota.Text.Trim ()))
						ticket.Nota = txtNota.Text.Trim ();
					else {
						txtNota.SetError ("Es requerido un Comentario ", icon_error);
						strError += "Comentario";
					}

					ticket.Ciudad = txtCiudad.Text.Trim ();
					ticket.Estado = ddEstado.SelectedItem.ToString ();
					var resultado = 0;

					if (string.IsNullOrEmpty (strError)) {
						resultado = cliente.CreateTicket (
							new Navigation_View.services_911consumidor_com.TicketDTO {	
								Client = new Navigation_View.services_911consumidor_com.UserDTO {	
									FirstName = ticket.Nombre,
									LastName = string.Empty,
									Email = ticket.Email,
									Phone = ticket.Telefono,
									PostalCode = string.Empty,
									AddressCity = ticket.Ciudad,
									AddressState = ticket.Estado
								},
								Status = new Navigation_View.services_911consumidor_com.StatusDTO {	
									OBJ_ID = 2, 
									Id = 3
								}, 
								Type = new Navigation_View.services_911consumidor_com.TypeDTO { 
									ObjId = 2, 
									Id = 3
								},
								User = new Navigation_View.services_911consumidor_com.UserDTO {
									Id = 3
								},
								TicketDetail = new Navigation_View.services_911consumidor_com.TicketDetailDTO[] {
									new Navigation_View.services_911consumidor_com.TicketDetailDTO {
										DetailDate = DateTime.Now,
										Subject = "Contacto Consumidor",
										Status = new Navigation_View.services_911consumidor_com.StatusDTO {
											OBJ_ID = 2,
											Id = 3
										},
										Message = string.Empty,
										Agent = new Navigation_View.services_911consumidor_com.UserDTO {
											UserId = string.Empty
										},
										TIC_ID = 3
									}
								},
								Notes = ticket.Nota
							}, string_key);

						if (resultado != 0) {
							new AlertDialog.Builder (root.Context)
								.SetMessage ("Muchas gracias por ponerte en contacto con 911 CONSUMIDOR, en breve recibirás una respuesta a tu caso.")
								.SetPositiveButton ("OK", delegate {
								Console.WriteLine ("OK");
							})
								.SetTitle ("ATENCIÓN")
								.Show ();
						}
					}


				} catch (Exception ex) {
					new AlertDialog.Builder (root.Context)
						.SetMessage ("Ocurrio un error: " + ex.Message.ToString ())
						.SetTitle ("ATENCIÓN")
						.SetPositiveButton ("OK", delegate {
						Console.WriteLine ("OK");
					})
						.Show ();
				} finally {
					//txtApellido.Text="";
					txtNombre.Text = "";
					txtNota.Text = "";
					txtCiudad.Text = "";
					txtCorreo.Text = "";
					txtTelefono.Text = "";
					ddEstado.GetItemIdAtPosition (0);

				}
			};


			return root;
		}
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.layout_ticketjuridico, null);

            TextView txtCorreo          = root.FindViewById <TextView> (Resource.Id.txtEmail);
            TextView txtNombre          = root.FindViewById <TextView> (Resource.Id.txtNombreApellido);
            TextView txtAvisoPrivacidad = root.FindViewById <TextView> (Resource.Id.txtAvisoPrivacidad);

            if (!string.IsNullOrEmpty(TipsFragment.Email))
            {
                txtCorreo.Text = TipsFragment.Email.Trim();
            }

            if (!string.IsNullOrEmpty(TipsFragment.Nombre))
            {
                txtNombre.Text = TipsFragment.Nombre.Trim();
            }

            //cocoservices.tinnova.mx.COCOService cliente = new Navigation_View.cocoservices.tinnova.mx.COCOService ();
            services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService();

            //cliente.ChannelFactory.CreateChannel ();
            string string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";

            Typeface font = Typeface.CreateFromAsset(Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf");

            Button btnRegistrar = root.FindViewById <Button> (Resource.Id.btnAceptar);


            btnRegistrar.SetTypeface(font, TypefaceStyle.Normal);

            txtAvisoPrivacidad.Click += (object sender, EventArgs e) =>
            {
                var uri    = Android.Net.Uri.Parse("http://www.911Consumidor.com/avisoPrivacidad");
                var intent = new Intent(Intent.ActionView, uri);
                StartActivity(intent);
            };


            btnRegistrar.Click += (object sender, EventArgs e) => {
                btnRegistrar.SetBackgroundColor(Color.White);
                btnRegistrar.SetTextColor(Color.Orange);
                string strError = "";
                //EditText txtNombre = root.FindViewById<EditText> (Resource.Id.txtNombreApellido);
                EditText txtTelefono = root.FindViewById <EditText> (Resource.Id.txtPhone);
                Spinner  ddEstado    = root.FindViewById <Spinner> (Resource.Id.ddlEstado);
                EditText txtCiudad   = root.FindViewById <EditText> (Resource.Id.txtCiudad);
                EditText txtNota     = root.FindViewById <EditText> (Resource.Id.txtNota);
                Drawable icon_error  = Resources.GetDrawable(Resource.Drawable.Error128);
                //cliente.ChannelFactory =

                try {
                    Ticket ticket = new Ticket();

//					if (!string.IsNullOrEmpty (txtNombre.Text.Trim ()))
//						ticket.Nombre = txtNombre.Text.Trim ();
//					else {
//						txtNombre.SetError ("Es requerido un Nombre ", icon_error);
//						strError += "Nombre";
//					}
                    ticket.Email = txtCorreo.Text.Trim();
                    if (!string.IsNullOrEmpty(txtTelefono.Text.Trim()))
                    {
                        ticket.Telefono = txtTelefono.Text.Trim();
                    }
                    else
                    {
                        txtTelefono.SetError("Es requerido un Telefono ", icon_error);
                        strError += "Telefono";
                    }
                    if (!string.IsNullOrEmpty(txtNota.Text.Trim()))
                    {
                        ticket.Nota = txtNota.Text.Trim();
                    }
                    else
                    {
                        txtNota.SetError("Es requerido un Comentario ", icon_error);
                        strError += "Comentario";
                    }

                    ticket.Ciudad = txtCiudad.Text.Trim();
                    ticket.Estado = ddEstado.SelectedItem.ToString();
                    var resultado = 0;

                    if (string.IsNullOrEmpty(strError))
                    {
                        resultado = cliente.CreateTicket(
                            new Navigation_View.services_911consumidor_com.TicketDTO {
                            Client = new Navigation_View.services_911consumidor_com.UserDTO {
                                FirstName    = ticket.Nombre,
                                LastName     = string.Empty,
                                Email        = ticket.Email,
                                Phone        = ticket.Telefono,
                                PostalCode   = string.Empty,
                                AddressCity  = ticket.Ciudad,
                                AddressState = ticket.Estado
                            },
                            Status = new Navigation_View.services_911consumidor_com.StatusDTO {
                                OBJ_ID = 2,
                                Id     = 3
                            },
                            Type = new Navigation_View.services_911consumidor_com.TypeDTO {
                                ObjId = 2,
                                Id    = 3
                            },
                            User = new Navigation_View.services_911consumidor_com.UserDTO {
                                Id = 3
                            },
                            TicketDetail = new Navigation_View.services_911consumidor_com.TicketDetailDTO[] {
                                new Navigation_View.services_911consumidor_com.TicketDetailDTO {
                                    DetailDate = DateTime.Now,
                                    Subject    = "Contacto Consumidor",
                                    Status     = new Navigation_View.services_911consumidor_com.StatusDTO {
                                        OBJ_ID = 2,
                                        Id     = 3
                                    },
                                    Message = string.Empty,
                                    Agent   = new Navigation_View.services_911consumidor_com.UserDTO {
                                        UserId = string.Empty
                                    },
                                    TIC_ID = 3
                                }
                            },
                            Notes = ticket.Nota
                        }, string_key);

                        if (resultado != 0)
                        {
                            new AlertDialog.Builder(root.Context)
                            .SetMessage("Muchas gracias por ponerte en contacto con 911 CONSUMIDOR, en breve recibirás una respuesta a tu caso.")
                            .SetPositiveButton("OK", delegate {
                                Console.WriteLine("OK");
                            })
                            .SetTitle("ATENCIÓN")
                            .Show();
                        }
                    }
                } catch (Exception ex) {
                    new AlertDialog.Builder(root.Context)
                    .SetMessage("Ocurrio un error: " + ex.Message.ToString())
                    .SetTitle("ATENCIÓN")
                    .SetPositiveButton("OK", delegate {
                        Console.WriteLine("OK");
                    })
                    .Show();
                } finally {
                    //txtApellido.Text="";
                    txtNombre.Text   = "";
                    txtNota.Text     = "";
                    txtCiudad.Text   = "";
                    txtCorreo.Text   = "";
                    txtTelefono.Text = "";
                    ddEstado.GetItemIdAtPosition(0);
                }
            };


            return(root);
        }
Example #3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);
            ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.layout_tickets, null);

            //cocoservices.tinnova.mx.COCOService cliente = new Navigation_View.cocoservices.tinnova.mx.COCOService ();
            services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService();

            string   string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";
            Typeface font       = Typeface.CreateFromAsset(Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf");

            Button btnRegistrar = root.FindViewById <Button> (Resource.Id.btnAceptar);

            btnRegistrar.SetTypeface(font, TypefaceStyle.Normal);

            btnRegistrar.Click += (object sender, EventArgs e) => {
                btnRegistrar.SetBackgroundColor(Color.White);
                btnRegistrar.SetTextColor(Color.Orange);
                string   strError  = "";
                EditText txtNombre = root.FindViewById <EditText> (Resource.Id.txtNombre);
                //EditText txtApellido = root.FindViewById<EditText>(Resource.Id.txtApellido);
                EditText txtCorreo   = root.FindViewById <EditText> (Resource.Id.txtEmail);
                EditText txtTelefono = root.FindViewById <EditText> (Resource.Id.txtPhone);
                Spinner  ddEstado    = root.FindViewById <Spinner> (Resource.Id.ddlEstado);
                EditText txtCiudad   = root.FindViewById <EditText> (Resource.Id.txtCiudad);
                //EditText txtCP = root.FindViewById<EditText>(Resource.Id.txtCP);
                EditText txtNota    = root.FindViewById <EditText> (Resource.Id.txtNota);
                Drawable icon_error = Resources.GetDrawable(Resource.Drawable.Error128);
                //cliente.ChannelFactory =

                try {
                    Ticket ticket = new Ticket();

                    if (!string.IsNullOrEmpty(txtNombre.Text.Trim()))
                    {
                        ticket.Nombre = txtNombre.Text.Trim();
                    }
                    else
                    {
                        //throw new Exception("Debe escribir un Nombre");
                        txtNombre.SetError("Es requerido un Nombre ", icon_error);
                        strError += "Nombre";
                    }
                    if (!string.IsNullOrEmpty(txtCorreo.Text.Trim()))
                    {
                        ticket.Email = txtCorreo.Text.Trim();
                    }
                    else
                    {
                        txtCorreo.SetError("Es requerido un Correo Electronico ", icon_error);
                        strError += "Correo Electronico";
                    }
                    if (!string.IsNullOrEmpty(txtTelefono.Text.Trim()))
                    {
                        ticket.Telefono = txtTelefono.Text.Trim();
                    }
                    else
                    {
                        txtTelefono.SetError("Es requerido un Telefono ", icon_error);
                        strError += "Telefono";
                    }
                    if (!string.IsNullOrEmpty(txtNota.Text.Trim()))
                    {
                        ticket.Nota = txtNota.Text.Trim();
                    }
                    else
                    {
                        txtNota.SetError("Es requerido un Comentario ", icon_error);
                        strError += "Comentario";
                    }

                    ticket.Ciudad = txtCiudad.Text.Trim();
                    ticket.Estado = ddEstado.SelectedItem.ToString();

                    if (string.IsNullOrEmpty(strError))
                    {
                        var resultado = cliente.CreateTicket(
                            new Navigation_View.services_911consumidor_com.TicketDTO {
                            Client = new Navigation_View.services_911consumidor_com.UserDTO {
                                FirstName    = ticket.Nombre,
                                LastName     = string.Empty,
                                Email        = ticket.Email,
                                Phone        = ticket.Telefono,
                                PostalCode   = string.Empty,
                                AddressCity  = ticket.Ciudad,
                                AddressState = ticket.Estado,
                            },
                            Status = new Navigation_View.services_911consumidor_com.StatusDTO {
                                OBJ_ID = 2,
                                Id     = 3
                            },
                            Type = new Navigation_View.services_911consumidor_com.TypeDTO {
                                ObjId = 2,
                                Id    = 1
                            },
                            User = new Navigation_View.services_911consumidor_com.UserDTO
                            {
                                Id = 1
                            },
                            TicketDetail = new Navigation_View.services_911consumidor_com.TicketDetailDTO[] {
                                new Navigation_View.services_911consumidor_com.TicketDetailDTO {
                                    DetailDate = DateTime.Now,
                                    Subject    = "Contacto Consumidor",
                                    Status     = new Navigation_View.services_911consumidor_com.StatusDTO {
                                        OBJ_ID = 2,
                                        Id     = 3
                                    },
                                    Message = string.Empty,
                                    Agent   = new Navigation_View.services_911consumidor_com.UserDTO {
                                        UserId = string.Empty
                                    }
                                }
                            },
                            Notes = ticket.Nota
                        }, string_key);

                        if (resultado != 0)
                        {
                            new AlertDialog.Builder(root.Context)
                            .SetMessage("Muchas gracias por ponerte en contacto con 911 CONSUMIDOR, en breve recibirás una respuesta a tu caso.")
                            .SetTitle("ATENCIÓN")
                            .Show();
                        }
                    }
                } catch (Exception ex) {
                    new AlertDialog.Builder(root.Context)
                    .SetMessage("Ocurrio un error: " + ex.Message.ToString())
                    .SetTitle("ATENCIÓN")
                    .Show();
                } finally {
                    //txtApellido.Text="";
                    txtNombre.Text   = "";
                    txtNota.Text     = "";
                    txtCiudad.Text   = "";
                    txtCorreo.Text   = "";
                    txtTelefono.Text = "";
                    //ddEstado.SelectedItemPosition = -1;
                }
            };


            return(root);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.layout_register);

            var btnSave        = FindViewById <Button> (Resource.Id.btnGuardar);
            var txtNombre      = FindViewById <TextView> (Resource.Id.txtNombreCompleto);
            var txtEmail       = FindViewById <TextView> (Resource.Id.txtEmailRegistro);
            var txtPassword    = FindViewById <TextView> (Resource.Id.txtContraseña);
            var txtPassConfirm = FindViewById <TextView> (Resource.Id.txtContraseñaConfirmar);

            var      IniciarSesion = FindViewById <TextView> (Resource.Id.txtIniciarSesion);
            Typeface font          = Typeface.CreateFromAsset(Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf");

            _supporttoolbar = FindViewById <Android.Support.V7.Widget.Toolbar> (Resource.Id.ToolBarRegistro);
            var ToolbarTitle = FindViewById <TextView> (Resource.Id.toolbar_titleRegister);

            ToolbarTitle.SetText(Resource.String.Registro);
            //_supporttoolbar.SetTitle(Resource.String.Registro);
            SetSupportActionBar(_supporttoolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(false);

            btnSave.SetTypeface(font, TypefaceStyle.Normal);

            _supporttoolbar.Click += (object sender, EventArgs e) =>
            {
                StartActivity(typeof(MainActivity));
            };

            IniciarSesion.Click += (object sender, EventArgs e) =>
            {
                StartActivity(typeof(IniciarSesionActivity));
            };

            btnSave.Click += (object sender, EventArgs e) => {
                btnSave.SetBackgroundColor(Color.White);
                btnSave.SetTextColor(Color.Orange);
                string strNombre      = txtNombre.Text.Trim();
                string strEmail       = txtEmail.Text.Trim();
                string strPassword    = txtPassword.Text.Trim();
                string strPassConfirm = txtPassConfirm.Text.Trim();
                string string_key     = "41f579fc-1445-4065-ab10-c06d50e724d3";

                services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService();

                cliente.AccountRegistration(new Navigation_View.services_911consumidor_com.UserDTO {
                    FirstName = strNombre,
                    Email     = strEmail,
                    Password  = strPassword,
                    Device    = string.Empty
                }, string_key);

                Xamarin.Auth.Account account = new Xamarin.Auth.Account(strEmail, AccountCore.Dictionary(strNombre, strEmail, strPassword));

                AccountStore.Create(this).Save(account, "consumidor");

                new Android.Support.V7.App.AlertDialog.Builder(this)
                .SetMessage("Su cuenta ha sido registrada.")
                .SetTitle("ATENCIÓN")
                .Show();

                StartActivity(typeof(MainActivity));
            };
            // Create your application here
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.layout_iniciar_sesion);

            Typeface font          = Typeface.CreateFromAsset(Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf");
            var      btnIniciar    = FindViewById <Button> (Resource.Id.btnIniciar);
            var      txtContraseña = FindViewById <TextView> (Resource.Id.txtContraseñaSesion);
            var      txtEmail      = FindViewById <TextView> (Resource.Id.txtEmailSesion);

            btnIniciar.SetTypeface(font, TypefaceStyle.Normal);

            _supporttoolbar = FindViewById <Android.Support.V7.Widget.Toolbar> (Resource.Id.ToolBarSesion);
            var ToolbarTitle = FindViewById <TextView> (Resource.Id.toolbar_sesion);

            ToolbarTitle.SetText(Resource.String.Sesion);
            SetSupportActionBar(_supporttoolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(false);


            btnIniciar.Click += (object sender, EventArgs e) => {
                btnIniciar.SetBackgroundColor(Color.White);
                btnIniciar.SetTextColor(Color.Orange);
                string string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";
                string UserEmail  = txtEmail.Text.Trim();
                string Password   = txtContraseña.Text.Trim();

                try {
                    services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService();
                    services_911consumidor_com.UserDTO     Usuario = new Navigation_View.services_911consumidor_com.UserDTO();

                    Usuario = cliente.AccountLogin(new Navigation_View.services_911consumidor_com.UserDTO {
                        Email    = UserEmail,
                        Password = Password
                    }, string_key);

                    Xamarin.Auth.Account account = new Xamarin.Auth.Account(Usuario.Email, AccountCore.Dictionary(Usuario.FirstName, Usuario.Email, Password));
                    AccountStore.Create(this).Save(account, "consumidor");
                    new Android.Support.V7.App.AlertDialog.Builder(this)
                    .SetMessage("Conexión Satisfactoria")
                    .SetPositiveButton("OK", delegate {
                        Console.WriteLine("OK");
                    })
                    .SetTitle("ATENCIÓN")
                    .Show();

                    StartActivity(typeof(MainActivity));
                } catch (Exception ex) {
                    var MensajeError = ex.Message.Remove(0, 43);
                    new Android.Support.V7.App.AlertDialog.Builder(this)
                    .SetMessage("Error en la conexión: " + MensajeError)
                    .SetPositiveButton("OK", delegate {
                        Console.WriteLine("OK");
                    })
                    .SetTitle("ATENCIÓN")
                    .Show();
                }
            };

            // Create your application here
        }
		protected override void OnCreate (Bundle savedInstanceState)
		{

			Bundle bundle = Intent.Extras;

			var TicketListDetails = Seguimiento_Adapter.DetallesTicket;
			var TicketID = Convert.ToInt32 (Intent.GetStringExtra ("TicketID").ToString ());

			List<TicketDetail> ListResults = TicketListDetails.FindAll (x => x.TicketID == TicketID);

			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.layout_detalle);


			_supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBarSeguimientoDetalle);
			//_supporttoolbar.SetTitle(Resource.String.Seguimiento);

			var ToolbarTitle = FindViewById<TextView> (Resource.Id.toolbar_titleDetalle);
			var ToolbarBack = FindViewById<ImageView> (Resource.Id.toolbar_backSeg);

			ToolbarTitle.SetText (Resource.String.Seguimiento);
			ToolbarBack.SetImageResource (Resource.Drawable.Back48x48);

			SetSupportActionBar(_supporttoolbar);
			SupportActionBar.SetDisplayHomeAsUpEnabled(false);

			var listView = FindViewById<ListView> (Resource.Id.ListDetalle);

			listView.Adapter = new SeguimientoDetail_Adapter (ListResults, this);
			Typeface font = Typeface.CreateFromAsset (Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf");

			var btnEnviar = FindViewById<Button> (Resource.Id.btnEnviarComentario);
			var txtComentario = FindViewById<EditText> (Resource.Id.txtNewComment);


			//btnEnviar.SetBackgroundResource (Resource.Drawable.selectors);
			btnEnviar.SetTypeface (font,TypefaceStyle.Normal);
			_supporttoolbar.Click += (object sender, EventArgs e) => 
			{
				StartActivity (typeof(MainActivity));
			};


			ToolbarBack.Click += (object sender, EventArgs e) => 
			{
				base.OnBackPressed ();
			};
				

			btnEnviar.Click += (object sender, EventArgs e) => {
				btnEnviar.SetBackgroundColor (Color.White);
				btnEnviar.SetTextColor (Color.Orange);
				var string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";
				//cocoservices.tinnova.mx.COCOService servicio = new Navigation_View.cocoservices.tinnova.mx.COCOService ();
				services_911consumidor_com.COCOService servicio = new Navigation_View.services_911consumidor_com.COCOService ();
				try {

					var resultado = 0;
					resultado = servicio.CreateTicketDetail (new Navigation_View.services_911consumidor_com.TicketDetailDTO {
						TIC_ID = Convert.ToInt32 (TicketID.ToString ()),
						Message = txtComentario.Text.Trim (),
						DetailDate = DateTime.Now,
						Subject = "Mensaje Consumidor",
						Status = new Navigation_View.services_911consumidor_com.StatusDTO {
							Id = 12,
							OBJ_ID = 5
						},
						Agent = new Navigation_View.services_911consumidor_com.UserDTO {
							UserId = string.Empty
						}
					}, string_key);

					if (resultado != 0) {
						new Android.Support.V7.App.AlertDialog.Builder (this)
							.SetMessage ("Su comentario ha sido registrado. Gracias")
							.SetPositiveButton ("OK", delegate {
							Console.WriteLine ("OK");
						})
							.SetTitle ("ATENCIÓN")
							.Show ();
					}

					
				} catch (Exception ex) {
					new Android.Support.V7.App.AlertDialog.Builder (this)
						.SetMessage ("Ocurrio un error: " + ex.Message.ToString ())
						.SetTitle ("ATENCIÓN")
						.SetPositiveButton ("OK", delegate {
						Console.WriteLine ("OK");
					})
						.Show ();
				} finally {
					txtComentario.Text = "";
				}

				StartActivity (typeof(MainActivity));

			};

		}
        protected override void OnCreate(Bundle savedInstanceState)
        {
            Bundle bundle = Intent.Extras;

            var TicketListDetails = Seguimiento_Adapter.DetallesTicket;
            var TicketID          = Convert.ToInt32(Intent.GetStringExtra("TicketID").ToString());

            List <TicketDetail> ListResults = TicketListDetails.FindAll(x => x.TicketID == TicketID);

            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.layout_detalle);


            _supporttoolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBarSeguimientoDetalle);
            //_supporttoolbar.SetTitle(Resource.String.Seguimiento);

            var ToolbarTitle = FindViewById <TextView> (Resource.Id.toolbar_titleDetalle);
            var ToolbarBack  = FindViewById <ImageView> (Resource.Id.toolbar_backSeg);

            ToolbarTitle.SetText(Resource.String.Seguimiento);
            ToolbarBack.SetImageResource(Resource.Drawable.Back48x48);

            SetSupportActionBar(_supporttoolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(false);

            var listView = FindViewById <ListView> (Resource.Id.ListDetalle);

            listView.Adapter = new SeguimientoDetail_Adapter(ListResults, this);
            Typeface font = Typeface.CreateFromAsset(Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf");

            var btnEnviar     = FindViewById <Button> (Resource.Id.btnEnviarComentario);
            var txtComentario = FindViewById <EditText> (Resource.Id.txtNewComment);


            //btnEnviar.SetBackgroundResource (Resource.Drawable.selectors);
            btnEnviar.SetTypeface(font, TypefaceStyle.Normal);
            _supporttoolbar.Click += (object sender, EventArgs e) =>
            {
                StartActivity(typeof(MainActivity));
            };


            ToolbarBack.Click += (object sender, EventArgs e) =>
            {
                base.OnBackPressed();
            };


            btnEnviar.Click += (object sender, EventArgs e) => {
                btnEnviar.SetBackgroundColor(Color.White);
                btnEnviar.SetTextColor(Color.Orange);
                var string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";
                //cocoservices.tinnova.mx.COCOService servicio = new Navigation_View.cocoservices.tinnova.mx.COCOService ();
                services_911consumidor_com.COCOService servicio = new Navigation_View.services_911consumidor_com.COCOService();
                try {
                    var resultado = 0;
                    resultado = servicio.CreateTicketDetail(new Navigation_View.services_911consumidor_com.TicketDetailDTO {
                        TIC_ID     = Convert.ToInt32(TicketID.ToString()),
                        Message    = txtComentario.Text.Trim(),
                        DetailDate = DateTime.Now,
                        Subject    = "Mensaje Consumidor",
                        Status     = new Navigation_View.services_911consumidor_com.StatusDTO {
                            Id     = 12,
                            OBJ_ID = 5
                        },
                        Agent = new Navigation_View.services_911consumidor_com.UserDTO {
                            UserId = string.Empty
                        }
                    }, string_key);

                    if (resultado != 0)
                    {
                        new Android.Support.V7.App.AlertDialog.Builder(this)
                        .SetMessage("Su comentario ha sido registrado. Gracias")
                        .SetPositiveButton("OK", delegate {
                            Console.WriteLine("OK");
                        })
                        .SetTitle("ATENCIÓN")
                        .Show();
                    }
                } catch (Exception ex) {
                    new Android.Support.V7.App.AlertDialog.Builder(this)
                    .SetMessage("Ocurrio un error: " + ex.Message.ToString())
                    .SetTitle("ATENCIÓN")
                    .SetPositiveButton("OK", delegate {
                        Console.WriteLine("OK");
                    })
                    .Show();
                } finally {
                    txtComentario.Text = "";
                }

                StartActivity(typeof(MainActivity));
            };
        }
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Use this to return your custom view for this Fragment
			// return inflater.Inflate(Resource.Layout.YourFragment, container, false);
			ViewGroup root = (ViewGroup)inflater.Inflate (Resource.Layout.layout_tickets,null);

			//cocoservices.tinnova.mx.COCOService cliente = new Navigation_View.cocoservices.tinnova.mx.COCOService ();
			services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService();

			string string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";
			Typeface font = Typeface.CreateFromAsset (Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf");

			Button btnRegistrar = root.FindViewById<Button> (Resource.Id.btnAceptar);

			btnRegistrar.SetTypeface (font, TypefaceStyle.Normal);

			btnRegistrar.Click += (object sender, EventArgs e) => {
				btnRegistrar.SetBackgroundColor (Color.White);
				btnRegistrar.SetTextColor (Color.Orange);
				string strError = "";
				EditText txtNombre = root.FindViewById<EditText> (Resource.Id.txtNombre);
				//EditText txtApellido = root.FindViewById<EditText>(Resource.Id.txtApellido);
				EditText txtCorreo = root.FindViewById<EditText> (Resource.Id.txtEmail);
				EditText txtTelefono = root.FindViewById<EditText> (Resource.Id.txtPhone);
				Spinner ddEstado = root.FindViewById<Spinner> (Resource.Id.ddlEstado);
				EditText txtCiudad = root.FindViewById<EditText> (Resource.Id.txtCiudad);
				//EditText txtCP = root.FindViewById<EditText>(Resource.Id.txtCP);
				EditText txtNota = root.FindViewById<EditText> (Resource.Id.txtNota);
				Drawable icon_error = Resources.GetDrawable (Resource.Drawable.Error128);
				//cliente.ChannelFactory = 

				try {

					Ticket ticket = new Ticket ();

					if (!string.IsNullOrEmpty (txtNombre.Text.Trim ()))
						ticket.Nombre = txtNombre.Text.Trim ();
					else {
						//throw new Exception("Debe escribir un Nombre");
						txtNombre.SetError ("Es requerido un Nombre ", icon_error);
						strError += "Nombre";
					}
					if (!string.IsNullOrEmpty (txtCorreo.Text.Trim ()))
						ticket.Email = txtCorreo.Text.Trim ();
					else {
						txtCorreo.SetError ("Es requerido un Correo Electronico ", icon_error);
						strError += "Correo Electronico";
					}
					if (!string.IsNullOrEmpty (txtTelefono.Text.Trim ()))
						ticket.Telefono = txtTelefono.Text.Trim ();
					else {
						txtTelefono.SetError ("Es requerido un Telefono ", icon_error);
						strError += "Telefono";
					}
					if (!string.IsNullOrEmpty (txtNota.Text.Trim ()))
						ticket.Nota = txtNota.Text.Trim ();
					else {
						txtNota.SetError ("Es requerido un Comentario ", icon_error);
						strError += "Comentario";
					}
					
					ticket.Ciudad = txtCiudad.Text.Trim ();
					ticket.Estado = ddEstado.SelectedItem.ToString ();

					if (string.IsNullOrEmpty (strError)) {
						var resultado = cliente.CreateTicket (
							                new Navigation_View.services_911consumidor_com.TicketDTO {	Client = new Navigation_View.services_911consumidor_com.UserDTO {	FirstName = ticket.Nombre,
									LastName = string.Empty,
									Email = ticket.Email,
									Phone = ticket.Telefono,
									PostalCode = string.Empty,
									AddressCity = ticket.Ciudad,
									AddressState = ticket.Estado,
								},
								Status = new Navigation_View.services_911consumidor_com.StatusDTO {	
									OBJ_ID = 2, 
									Id = 3
								}, 
								Type = new Navigation_View.services_911consumidor_com.TypeDTO { 
									ObjId = 2, 
									Id = 1
								}, 
								User = new Navigation_View.services_911consumidor_com.UserDTO
								{ Id = 1 },
								TicketDetail = new Navigation_View.services_911consumidor_com.TicketDetailDTO[] {
									new Navigation_View.services_911consumidor_com.TicketDetailDTO {
										DetailDate = DateTime.Now,
										Subject = "Contacto Consumidor",
										Status = new Navigation_View.services_911consumidor_com.StatusDTO {
											OBJ_ID = 2,
											Id = 3
										},
										Message = string.Empty,
										Agent = new Navigation_View.services_911consumidor_com.UserDTO {
											UserId = string.Empty
										}
									}
								},
								Notes = ticket.Nota
							}, string_key);
						
						if (resultado != 0) {
							new AlertDialog.Builder (root.Context)
								.SetMessage ("Muchas gracias por ponerte en contacto con 911 CONSUMIDOR, en breve recibirás una respuesta a tu caso.")
								.SetTitle ("ATENCIÓN")
								.Show ();
						}
					}
						
					
				} catch (Exception ex) {
					new AlertDialog.Builder (root.Context)
						.SetMessage ("Ocurrio un error: " + ex.Message.ToString ())
						.SetTitle ("ATENCIÓN")
						.Show ();
				} finally {
					//txtApellido.Text="";
					txtNombre.Text = "";
					txtNota.Text = "";
					txtCiudad.Text = "";
					txtCorreo.Text = "";
					txtTelefono.Text = "";
					//ddEstado.SelectedItemPosition = -1;

				}
			};


			return root;
		}
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			SetContentView (Resource.Layout.layout_iniciar_sesion);

			Typeface font = Typeface.CreateFromAsset (Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf");
			var btnIniciar = FindViewById<Button> (Resource.Id.btnIniciar);
			var txtContraseña = FindViewById<TextView> (Resource.Id.txtContraseñaSesion);
			var txtEmail = FindViewById<TextView> (Resource.Id.txtEmailSesion);

			btnIniciar.SetTypeface (font, TypefaceStyle.Normal);

			_supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.ToolBarSesion);
			var ToolbarTitle = FindViewById<TextView> (Resource.Id.toolbar_sesion);
			ToolbarTitle.SetText (Resource.String.Sesion);
			SetSupportActionBar(_supporttoolbar);
			SupportActionBar.SetDisplayHomeAsUpEnabled(false);


			btnIniciar.Click += (object sender, EventArgs e) => {
				btnIniciar.SetBackgroundColor (Color.White);
				btnIniciar.SetTextColor (Color.Orange);
				string string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";
				string UserEmail = txtEmail.Text.Trim ();
				string Password = txtContraseña.Text.Trim ();

				try {

					services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService ();
					services_911consumidor_com.UserDTO Usuario = new Navigation_View.services_911consumidor_com.UserDTO ();

					Usuario = cliente.AccountLogin (new Navigation_View.services_911consumidor_com.UserDTO {
						Email = UserEmail,
						Password = Password
					}, string_key);

					Xamarin.Auth.Account account = new Xamarin.Auth.Account (Usuario.Email, AccountCore.Dictionary (Usuario.FirstName, Usuario.Email, Password));
					AccountStore.Create (this).Save (account, "consumidor");
					new Android.Support.V7.App.AlertDialog.Builder (this)
						.SetMessage ("Conexión Satisfactoria")
						.SetPositiveButton ("OK", delegate {
						Console.WriteLine ("OK");
					})
						.SetTitle ("ATENCIÓN")
						.Show ();

					StartActivity (typeof(MainActivity));

				} catch (Exception ex) {
					var MensajeError = ex.Message.Remove (0, 43);
					new Android.Support.V7.App.AlertDialog.Builder (this)
						.SetMessage ("Error en la conexión: " + MensajeError)
						.SetPositiveButton ("OK", delegate {
						Console.WriteLine ("OK");
					})
						.SetTitle ("ATENCIÓN")
						.Show ();
				}

			};

			// Create your application here
		}