public override void OnViewCreated(View view, Bundle savedInstanceState) { var TxtNombres = view.FindViewById<EditText> (Resource.Id.TxtNombres); var TxtEmail = view.FindViewById<EditText> (Resource.Id.TxtEmail); var TxtCalular = view.FindViewById<EditText> (Resource.Id.TxtCelular); var TxtPwd = view.FindViewById<EditText> (Resource.Id.TxtPwd); var BtnRegistar = view.FindViewById<Button> (Resource.Id.BtnRegistar); BtnRegistar.Click += async (sender, e) => { if (string.IsNullOrEmpty (TxtNombres.Text)) { TxtNombres.SetError ("Digite su Nombre", null); TxtNombres.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtEmail.Text)) { TxtEmail.SetError ("Digite su Email", null); TxtEmail.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtCalular.Text)) { TxtCalular.SetError ("Digite su # Celular", null); TxtCalular.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtPwd.Text)) { TxtPwd.SetError ("Digite su Contrseña", null); TxtPwd.RequestFocus (); return; } _ProgressDialog = ProgressDialog.Show (this.Activity, "", "Registrando los datos...", true); try { using (var _Bussines = new Bussines ()) { var Client = new Clients { Id = Guid.NewGuid ().ToString (), Name = TxtNombres.Text, Phone = TxtCalular.Text, Email = TxtEmail.Text, Pwd = TxtPwd.Text }; int Result = 0; Result = await _Bussines.RegisterClients (Client); _ProgressDialog.Dismiss (); switch (Result) { case 0: Toast.MakeText (this.Activity, "Errer: Al registrar los datos", ToastLength.Long).Show (); break; case 1: Toast.MakeText (this.Activity, "Los datos se registraron Exitosamente", ToastLength.Long).Show (); _DatosUser.SetDatosClients (Client); int go = this.Arguments.GetInt ("Go", 0); switch (go) { case 0: this.Activity.SupportFragmentManager.BeginTransaction () .Replace (Resource.Id.content_frame, InitFragment.NewInstance (Client.Email), "OfertasFragment") .AddToBackStack ("RegisterUserFragment") .Commit (); break; case 1: this.Activity.SupportFragmentManager.BeginTransaction () .Replace (Resource.Id.content_frame, SubastaFragment.NewInstance (), "SubastaFragment") .AddToBackStack ("RegisterUserFragment") .Commit (); break; default: this.Activity.SupportFragmentManager.BeginTransaction () .Replace (Resource.Id.content_frame, InitFragment.NewInstance (Client.Email), "OfertasFragment") .AddToBackStack ("RegisterUserFragment") .Commit (); break; } break; case 2: Toast.MakeText (this.Activity, "E-mail: " + TxtEmail.Text + " ya esta Registrado...", ToastLength.Long).Show (); break; default: break; } } } catch (Exception ex) { _ProgressDialog.Dismiss (); Toast.MakeText (this.Activity, ex.Message, ToastLength.Long).Show (); return; } }; try { Account[] accounts = AccountManager.Get (this.Activity).GetAccountsByType ("com.google"); foreach (Account account in accounts) { if (!string.IsNullOrEmpty (account.Name)) { TxtEmail.Text = account.Name; break; } //accountsList.add(item); } } catch (Exception) { } base.OnViewCreated (view, savedInstanceState); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { var TxtNit = view.FindViewById<EditText> (Resource.Id.TxtNit); var TxtRSocial = view.FindViewById<EditText> (Resource.Id.TxtRSocial); var TxtPCargo = view.FindViewById<EditText> (Resource.Id.TxtPCargo); var TxtCelular = view.FindViewById<EditText> (Resource.Id.TxtCelular); var TxtCComercial = view.FindViewById<EditText> (Resource.Id.TxtCComercial); var TxtCiudad = view.FindViewById<EditText> (Resource.Id.TxtCiudad); var TxtAddress = view.FindViewById<EditText> (Resource.Id.TxtAddress); var TxtEmail = view.FindViewById<EditText> (Resource.Id.TxtEmail); var TxtPwd = view.FindViewById<EditText> (Resource.Id.TxtPwd); var ChBoxTerminos = view.FindViewById<CheckBox> (Resource.Id.ChBoxTerminos); var BtnRegister = view.FindViewById<Button> (Resource.Id.BtnRegister); BtnRegister.Text = "Registrar"; if (this.Arguments.GetBoolean (ISUDAPE, false)) { UserDatos = _DatosUser.GetDatosVendors (); if (UserDatos != null) { BtnRegister.Text = "Actualizar"; TxtNit.Text = UserDatos.Nit; TxtRSocial.Text = UserDatos.Name; TxtPCargo.Text = UserDatos.Contact; TxtCelular.Text = UserDatos.Phone; TxtCComercial.Text = UserDatos.ShoppingCenter; TxtCiudad.Text = UserDatos.City; TxtAddress.Text = UserDatos.Address; TxtEmail.Text = UserDatos.Email; TxtEmail.SetTextColor (Color.Red); TxtEmail.Enabled = false; TxtNit.Enabled = false; TxtPwd.Visibility = ViewStates.Gone; ChBoxTerminos.Visibility = ViewStates.Gone; } } TxtEmail.Text = this.Arguments.GetString ("EMAIL"); BtnRegister.Click += async (sender, e) => { if (string.IsNullOrEmpty (TxtNit.Text)) { TxtNit.SetError ("Digite su Nit", null); TxtNit.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtRSocial.Text)) { TxtRSocial.SetError ("Digite la Razon Social", null); TxtRSocial.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtPCargo.Text)) { TxtPCargo.SetError ("Digite su Cargo", null); TxtPCargo.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtCelular.Text)) { TxtCelular.SetError ("Digite su Telefono", null); TxtCelular.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtCComercial.Text)) { TxtCComercial.SetError ("Digite el Centro Comercial", null); TxtCComercial.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtCiudad.Text)) { TxtCiudad.SetError ("Digite la Ciudad", null); TxtCiudad.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtAddress.Text)) { TxtAddress.SetError ("Digite la Direccion", null); TxtAddress.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtEmail.Text)) { TxtEmail.SetError ("Digite su Email", null); TxtEmail.RequestFocus (); return; } if (!emailIsValid (TxtEmail.Text)) { TxtEmail.SetError ("Digite un Email Valido", null); TxtEmail.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtPwd.Text)) { TxtPwd.SetError ("Digite su Contrseña para el ingreso", null); TxtPwd.RequestFocus (); return; } if (!ChBoxTerminos.Checked) { Toast.MakeText (this.Activity, "Acepte los Terminos y Condiciones para Continuar", ToastLength.Long).Show (); ChBoxTerminos.SetTextColor (Color.Red); return; } try { using (var _Bussines = new Bussines ()) { var Vendedor = new Vendors { Id = Guid.NewGuid ().ToString (), Nit = TxtNit.Text, Name = TxtRSocial.Text, Contact = TxtPCargo.Text, Phone = TxtCelular.Text, ShoppingCenter = TxtCComercial.Text, City = TxtCiudad.Text, Address = TxtAddress.Text, Email = TxtEmail.Text, Pwd = TxtPwd.Text }; int Result =0; _ProgressDialog = ProgressDialog.Show (this.Activity, "", "Registrando los datos...", true); if (!this.Arguments.GetBoolean (ISUDAPE, false)) { Result = await _Bussines.RegisterVendors (Vendedor); }else{ Vendedor.Id= UserDatos.Id; Result = await _Bussines.UpDateVendors (Vendedor); } _ProgressDialog.Dismiss (); switch (Result) { case 0: Toast.MakeText (this.Activity, "Errer: Al registrar los datos", ToastLength.Long).Show (); break; case 1: Toast.MakeText (this.Activity, "Los datos se registraron Exitosamente", ToastLength.Long).Show (); _DatosUser.SetDatosVendors (Vendedor); if (!this.Arguments.GetBoolean (ISUDAPE, false)) { this.Activity.SupportFragmentManager.BeginTransaction () .Replace (Resource.Id.content_frame, OfertasFragment.NewInstance (), "OfertasFragment") .AddToBackStack ("RegisterCMFragment") .Commit (); } break; case 2: Toast.MakeText (this.Activity, "E-mail: " + TxtEmail.Text + " ya esta Registrado...", ToastLength.Long).Show (); break; default: break; } } } catch (Exception ex) { Toast.MakeText (this.Activity, ex.Message, ToastLength.Long).Show (); _ProgressDialog.Dismiss (); return; } }; base.OnViewCreated (view, savedInstanceState); }
private void LoadDatos() { var r = new Random (); var nproveedores = r.Next (100, 623).ToString (); var msg = "En TIEMPO REAL a mas de " + nproveedores + " Provedores que TE enviaran las Mejores OFERTAS de este producto, Solo espera Unos MINUTOS"; _ProgressDialog = ProgressDialog.Show (this.Activity, "Estamos Contactando", msg, true); _ProgressDialog.Show (); var DatosClient = _DatosUser.GetDatosClients (); var DatosProduct = _DatosUser.GetDatosProduct (); if(DatosClient!=null){ using (var _Bussines = new Bussines ()) { _Bussines.SetConsultProduct (DatosClient.Id, DatosProduct.Id); } } List<Ofertas> List = new List<Ofertas> () { new Ofertas { Id = "", Trade = "TOTAL CELL", UrlImg = "http://www.tiendasjumbo.co/arquivos/logo-jumbo.png", Contact = "JHON HAROLD DIAZ", City = "VALLEDUPAR", IsSend = true, IsWarranty = true, Price = 10500 }, new Ofertas { Id = "", Trade = "TOTAL CELL", UrlImg = "http://production-alkosto-data.s3-website-us-east-1.amazonaws.com/media/ALKOSTO/contenido/logo-octubre-header.png", Contact = "JHON HAROLD DIAZ", City = "BOGOTA", IsSend = true, IsWarranty = true, Price = 105600 } , new Ofertas { Id = "", Trade = "TOTAL CELL", UrlImg = "http://www.tiendasjumbo.co/arquivos/logo-jumbo.png", Contact = "JHON HAROLD DIAZ", City = "BOGOTA", IsSend = true, IsWarranty = true, Price = 1056000 } , new Ofertas { Id = "", Trade = "TOTAL CELL", UrlImg = "http://production-alkosto-data.s3-website-us-east-1.amazonaws.com/media/ALKOSTO/contenido/logo-octubre-header.png", Contact = "JHON HAROLD DIAZ", City = "BOGOTA", IsSend = true, IsWarranty = true, Price = 105 } }; var Orderlist = List.OrderBy (d => d.Price).ToList(); // var FirtPreci = Orderlist.FirstOrDefault (); // // if (FirtPreci != null) { // TxtTrade.Text = FirtPreci.Trade; // TxtPrecio.Text = string.Format ("${0:N}", FirtPreci.Price); // } ListVOfertas.Adapter = new ListOfertaAdapter (this.Activity, Orderlist); _ProgressDialog.Dismiss (); if (!string.IsNullOrEmpty (Product.UrlImg)) { var img = new DownloadAsync (); img.DownloadHistory (ImgPro,Product.UrlImg); } }
public override void OnViewCreated(View view, Bundle savedInstanceState) { TxtTypeUser = view.FindViewById<TextView> (Resource.Id.TxtTypeUser); TxtTypeUser.Text = "Vendedor"; var TxtNit = view.FindViewById<EditText> (Resource.Id.TxtNit); var TxtPwd = view.FindViewById<EditText> (Resource.Id.TxtPwd); var BtnIniciar = view.FindViewById<TextView> (Resource.Id.BtnIniciar); var BtnRegister = view.FindViewById<TextView> (Resource.Id.BtnRegister); try { Account[] accounts = AccountManager.Get (this.Activity).GetAccountsByType ("com.google"); var email=accounts.FirstOrDefault(); if(email!=null) TxtNit.Text = email.Name; } catch (Exception) { } BtnRegister.Click+= (sender, e) => { this.Activity.SupportFragmentManager.BeginTransaction () .Replace (Resource.Id.content_frame,RegisterCMFragment.NewInstance(TxtNit.Text,false),"RegisterCMFragment") .AddToBackStack("InitFragment") .Commit (); }; BtnIniciar.Click+=async (sender, e) => { if (string.IsNullOrEmpty(TxtNit.Text)) { TxtNit.SetError("Digite su Email",null); TxtNit.RequestFocus(); return; } if (!emailIsValid (TxtNit.Text)) { TxtNit.SetError ("Digite un Email Valido", null); TxtNit.RequestFocus (); return; } if (string.IsNullOrEmpty(TxtPwd.Text)) { TxtPwd.SetError("Digite su Contrseña",null); TxtNit.RequestFocus(); return; } try { using (var _Bussines = new Bussines ()) { _ProgressDialog = ProgressDialog.Show (this.Activity, "", "Procesando...", true); var Result = await _Bussines.LoginVendors (TxtNit.Text,TxtPwd.Text); _ProgressDialog.Dismiss (); switch (Result.Msg) { case "Ok": _DatosUser.SetDatosVendors(Result.dato); this.Activity.SupportFragmentManager.BeginTransaction () .Replace (Resource.Id.content_frame, OfertasFragment.NewInstance(),"OfertasFragment") .AddToBackStack("LoginCMFragment") .Commit (); break; default: Toast.MakeText (this.Activity, Result.Msg, ToastLength.Long).Show (); break; } } } catch (Exception ex) { Toast.MakeText (this.Activity, ex.Message, ToastLength.Long).Show (); return; } }; base.OnViewCreated (view, savedInstanceState); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { TxtTypeUser = view.FindViewById<TextView> (Resource.Id.TxtTypeUser); var TxtNit = view.FindViewById<EditText> (Resource.Id.TxtNit); var TxtPwd = view.FindViewById<EditText> (Resource.Id.TxtPwd); var BtnIniciar = view.FindViewById<TextView> (Resource.Id.BtnIniciar); var BtnRegister = view.FindViewById<TextView> (Resource.Id.BtnRegister); BtnRegister.Click += (sender, e) => { switch (this.Arguments.GetInt ("Go", 0)) { case 0: this.Activity.SupportFragmentManager.BeginTransaction () .Replace (Resource.Id.content_frame, RegisterUserFragment.NewInstance (GoFragments.InitFragment), "RegisterUserFragment") .AddToBackStack ("LoginUserFragment") .Commit (); break; case 1: this.Activity.SupportFragmentManager.BeginTransaction () .Replace (Resource.Id.content_frame, RegisterUserFragment.NewInstance (GoFragments.SubastaFragment), "RegisterUserFragment") .AddToBackStack ("LoginUserFragment") .Commit (); break; default: RegisterUserFragment.NewInstance (GoFragments.InitFragment); this.Activity.SupportFragmentManager.BeginTransaction () .Replace (Resource.Id.content_frame, RegisterUserFragment.NewInstance (GoFragments.InitFragment), "RegisterUserFragment") .AddToBackStack ("LoginUserFragment") .Commit (); break; } }; BtnIniciar.Click += async (sender, e) => { if (string.IsNullOrEmpty (TxtNit.Text)) { TxtNit.SetError ("Digite su Email", null); TxtNit.RequestFocus (); return; } if (string.IsNullOrEmpty (TxtPwd.Text)) { TxtPwd.SetError ("Digite su Contrseña", null); TxtPwd.RequestFocus (); return; } try { using (var _Bussines = new Bussines ()) { _ProgressDialog = ProgressDialog.Show (this.Activity, "", "Procesando...", true); var Result = await _Bussines.LoginClients (TxtNit.Text, TxtPwd.Text); _ProgressDialog.Dismiss (); switch (Result.Msg) { case "Ok": _DatosUser.SetDatosClients (Result.dato); GoFragment (Result.dato); break; default: Toast.MakeText (this.Activity, Result.Msg, ToastLength.Long).Show (); break; } } } catch (Exception ex) { Toast.MakeText (this.Activity, ex.Message, ToastLength.Long).Show (); return; } }; TxtTypeUser.Text = "Usuario"; try { Account[] accounts = AccountManager.Get (this.Activity).GetAccountsByType ("com.google"); foreach (Account account in accounts) { if (!string.IsNullOrEmpty (account.Name)) { TxtNit.Text = account.Name; break; } //accountsList.add(item); } } catch (Exception) { } base.OnViewCreated (view, savedInstanceState); }
private async void LoadGridView () { //_ProgressDialog = ProgressDialog.Show (this.Activity, null, "Categorias...", true); using (var _Bussines = new Bussines ()) { ListCategory = (ListCategory == null ? await _Bussines.GetCategorys () : ListCategory); if (ListCategory != null && ListCategory.Count != 0) { Gridview.Adapter = new GridAdapter (this.Activity, ListCategory); } } ProBar.Visibility = ViewStates.Gone; //_ProgressDialog.Dismiss (); }