.Android.Material.TextField;
using Newtonsoft.Json;
using System.Drawing;
using WeightApp.Fragments;

/*
* <NAME> : 01/27/2022
* Purpose: Handle the forgot password page
* Function: User is prompted for a username they submit which is then checked against names in db. 
*           If exists, user moves to security question page
*/

namespace WeightApp.Activities {
  [Activity(Label = "ForgotPasswordActivity")]
  public class ForgotPasswordActivity : Activity {
    protected override void OnCreate(Bundle savedInstanceState) {
      base.OnCreate(savedInstanceState);

      //find the xml view to set
      SetContentView(Resource.Layout.activity_forgot_password);

      //XML elements to be stored in variables
      ImageButton btnBack = FindViewById<ImageButton>(Resource.Id.btn_fp_back);
      Button btnForgotPassword = FindViewById<Button>(Resource.Id.btn_fp_check_username);

      //set the button and textview click events
      btnBack.Click += delegate {
        //navigate to login activity
        StartActivity(typeof(LoginActivity));
      };

      btnForgotPassword.Click += (s, e) => {
        //XML elements to be stored in variables
        TextInputLayout txtIlUsername = FindViewById<TextInputLayout>(Resource.Id.et_fp_username);
        TextInputEditText txtUsername = FindViewById<TextInputEditText>(Resource.Id.fp_tiet_username);

        #region VALIDATION
        //set error to empty on button click
        txtIlUsername.Error = "";

        //check username textbox for empty or null
        if (txtUsername.Text == "") {
          if (txtUsername.Text == "") {
            txtIlUsername.Error = "Username is required";
            txtIlUsername.SetErrorTextAppearance(Color.Red.ToArgb());
          }
          return;
        }
        
        //instantiate the user dao
        UserDao userDao = new UserDao();

        //check if passed username exists in db
        User user = userDao.GetUserByUsername(txtUsername.Text);
        
        //display user does not exist error to user if none found in db
        if (user == null) {
          txtIlUsername.Error = "Username not found";
          txtIlUsername.SetErrorTextAppearance(Color.Red.ToArgb());
          return;
        }
        #endregion

        //serialize user obj and send to next activity. This will save on making another db call
        Intent intent = new Intent(this, typeof(SecurityQuestionActivity));
        intent.PutExtra("User", JsonConvert.SerializeObject(user));
        StartActivity(intent);
        Finish();
      };
    }
  }
}BigBadToyStore has teamed up with FansProject to make the holidays a little brighter for some great kids. We will be donating $20 (wholesale) worth of toys to Toys for Tots for each Function X-1 figure purchased between now and December 16th. The figure is still being kept a secret, but we can tell you that it converts from robot to four-wheeled vehicle mode and features two scoped rifles, and is listed at $68.99. A new collectible toy for you, as well as toys for those who could really use and enjoy them - help us make the holidays merry for everyone!
Five releases have been announced in the January 2013 DC list. We have the Injustice 3.75" figure set of Deathstroke and Green Arrow, which is listed at $26.99 (43 off the MSRP), as well as the new Green Lantern Simon Baz Action figure at $20.99 ($2 off the MSRP). For Statues with have a new Superman piece from Lee Bermejo art at $69.99 ($10 off the MSRP), a Batman: Arkham City The Joker Statue at $99.99 ($25 off the MSRP) and an Oliver Queen 13.25" Statue from the new TV series Arrow, which is listed at $134.99 ($15 off the MSRP).
Syco Collectibles has announced a new Mortal Kombat Statue. Noob is shown in his grey ninja outfit, ready to deal a killing blow. We have this statue listed at $149.99, $10 off the MSRP.
December is a pretty good month for books and TPBs. we have both cover versions of the New Warriors Omnibus Hardcover Volume 01 at $79.99 ($20 off the MSRP), the Avengers Vs. X-Men Hardcover Companion at $79.99 ($20 off the MSRP), the GI Joe Cobra Civil War Compendium Hardcover at $44.99 ($5 off the MSRP), the LEGO &reg Minifigure Character Encyclopedia at $18.99, the new World of Warcraft Dark Riders Hardcover at $21.49, Star Trek Federation First 150 Years Deluxe Hardcover with Sound & Light Base at $89.99 ($10 off the MSRP), Batman Volume 01 Court of Owls TPB at $15.49, Batman: Gotham By Gaslight TPB at $11.99 and more - take a peek at all of the new books at the link.
Another batch of import exclusives has been listed. We have the Robot Damashii Unicorn Gundam (Awakening), with or without Glowing Stage Set at $179.99 or $124.99, an SIC Kiwami Damashii Kamen Rider Kuuga Three Form Set at $132.99, 1/144 HGUC Sets of GM & Guncannon and Gouf & Gelgoog with new paintjobs at $54.99 and $63.99, respectively, a Gundam Warrior Gashapon Senshi Set at $108.99 and a Rider Hero Series Kamen Rider Fourze Meteor Double Fusion States at $39.99.
A variety of new DVDs and Blu-Rays are listed for pre-order. We have all three seasons of Archer in either format, as well as "Godzilla Vs. Biollante" an either format. Puppet Master Box Sets of Movies 1, 2 and 3 are also available as Blu-Ray or DVD, and DVDs are listed of Animaniacs Volume 04 and Young Justice Invasion: Destiny Calling. You can get more information about all of these releases at the link.
Underground Toys has announced that a number of popular figures are going back for another run. Pre-orders are currently listed for River Song in Spacesuit, Idris, the Silent with Mouth Open or Closed, Cybermats and the Bearded Doctor, with each priced at $17.99.
Tezuka Productions will be releasing a number of new Astro Boy items. We have the Atom Tin Toy at $899.99, $100 off the MSRP, as well as a Pluto Vs. Uran PVC Set, a Baby Atom 10" PVC Figure, an Atom Bank, Plushes of Atom, Uran and Dr. Ochanomizu, and even an Accessory Pouch.
We also have a number of new listings for Tintin items. There is a Tintin Meetings - Tintin & Chang 10.63" Statue at $449.99, $60 off the MSRP; a Haddock the Mariner 9.45" Statue at $299.99, $40 off the MSRP, a Best Wishes Limited Edition Metal Sculpture, new Transports and Box Sets and more.
Our first shipment of Generations 2013 Deluxes has arrived. and while we are waiting on another shipment to finish filling our cases and sets, we have some leftover singles available. We have Fall of Cybertron Sideswipe and Fall of Cybertron Ultra Magnus at $14.99 each, and Fall of Cybertron Starscream at $16.99.
Enterbay's first entries into the Batman Franchise come in the form of two figures from "Batman: The Dark Knight". The 1/4 Scale HD Masterpiece Batman and Joker figures come with alternate heads, hands, weapons and more, and we have Batman and Joker each listed at $374.99 ($75 off of the MSRP).
Hot Toys has released a new version of Snake from Metal Gear Solid 3, complete with Sneaking Suit. He comes with alternate hands, weapons and more, and is listed at $199.99, $15 off of the MSRP.
The latest Sideshow 12" Militaries of Star Wars release is the Utapau Airborne Trooper. This Clone Trooper comes with a yellow/orange detailed heavy armor suit, multiple weapons, alternate hands and boots and more. We have this figure listed at $129.99, $5 off the MSRP.
This case of 8 includes Dark Wolverine, Drax, Fantomex, Heroic Age Captain America and more, along with the pieces to assemble the Arnim Zola Build-A-Figure. We have this case priced at $124.99.
Bowen Designs has