Beispiel #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View myView = inflater.Inflate(Resource.Layout.storeMenu, container, false);

            listView = myView.FindViewById <ListView>(Resource.Id.myListBooks);
            mySearch = myView.FindViewById <SearchView>(Resource.Id.searchID);
            myDB     = new DBHelperClass(myContext);

            ICursor myresult = myDB.getAllBooks();

            while (myresult.MoveToNext())
            {
                myBooksList.Add(new BookObject(myresult.GetInt(myresult.GetColumnIndexOrThrow("book_id")), myresult.GetString(myresult.GetColumnIndexOrThrow("book_name")), myresult.GetString(myresult.GetColumnIndexOrThrow("book_author")), myresult.GetInt(myresult.GetColumnIndexOrThrow("book_image")), myresult.GetDouble(myresult.GetColumnIndexOrThrow("book_rate"))));
            }

            /*    myBooksList.Add(new BookObject(101,"Book 1", "Amith", Resource.Drawable.RomeoandJuliet, 3.5));
             * myBooksList.Add(new BookObject(102, "Book 2", "Prasanna", Resource.Drawable.RomeoandJuliet, 4.5));
             * myBooksList.Add(new BookObject(103, "Book 3", "Shriya", Resource.Drawable.RomeoandJuliet, 2));
             * myBooksList.Add(new BookObject(104, "Book 4", "Raul", Resource.Drawable.RomeoandJuliet, 2.5));
             * myBooksList.Add(new BookObject(105, "Book 5", "girish", Resource.Drawable.RomeoandJuliet, 3));*/


            MyCustomAdapter myAdapter = new MyCustomAdapter(myContext, myBooksList);

            listView.Adapter = myAdapter;

            listView.ItemClick       += List1_ItemClick;
            mySearch.QueryTextChange += searchUsers;

            return(myView);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.login);

            // Create your application here
            myLogin  = FindViewById <Button>(Resource.Id.btnLogin);
            mySignup = FindViewById <Button>(Resource.Id.btnSignup);

            my_success_login = FindViewById <Button>(Resource.Id.btnsuccessLogin); //login
            myUsername       = FindViewById <EditText>(Resource.Id.txtEmail);      // email id
            myPassword       = FindViewById <EditText>(Resource.Id.txtPassword);   // password

            myDB  = new DBHelperClass(this);
            alert = new Android.App.AlertDialog.Builder(this);


            mySignup.Click += delegate
            { // Already login button
                //Intent signupScreen = new Intent(this, typeof(signup)); // on success loading signup page
                //StartActivity(signupScreen);
                StartActivity(typeof(signup));
                OverridePendingTransition(Resource.Animation.fade_in, Resource.Animation.fade_out);
            };

            my_success_login.Click += delegate
            { // Already login button
                var user_name     = myUsername.Text;
                var user_password = myPassword.Text;

                if (user_name.Trim().Equals("") || user_name.Length < 0 || user_password.Trim().Equals("") || user_password.Length < 0)
                {
                    alert.SetTitle("Aleph | Error");
                    alert.SetMessage("Please fill all fields");
                    alert.SetPositiveButton("OK", alertOKButton);
                    Dialog myDialog = alert.Create();
                    myDialog.Show();
                }
                else
                {
                    bool f = myDB.checkUser(user_name.Trim(), user_password.Trim());
                    if (f)
                    {
                        myUsername.Text = ""; myPassword.Text = "";
                        Intent homeScreen = new Intent(this, typeof(MainActivity)); //
                        homeScreen.PutExtra("userName", user_name.Trim());
                        homeScreen.PutExtra("userPassword", user_password.Trim());
                        StartActivity(homeScreen);
                    }
                    else
                    {
                        alert.SetTitle("Aleph | Error");
                        alert.SetMessage("Incorrect email id or password!");
                        alert.SetPositiveButton("OK", alertOKButton);
                        Dialog myDialog = alert.Create();
                        myDialog.Show();
                    }
                }
            };
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View myView = inflater.Inflate(Resource.Layout.layout1, container, false);

            myDB = new DBHelperClass(myContext);
            alert = new Android.App.AlertDialog.Builder(myContext);
            userDetails = myDB.getUserDetails(userEmail);

            btnUpdate = myView.FindViewById<Button>(Resource.Id.btn_update);
            myUserName = myView.FindViewById<EditText>(Resource.Id.txt_Name);
            myEmailId = myView.FindViewById<EditText>(Resource.Id.txt_Email);
            myPassword = myView.FindViewById<EditText>(Resource.Id.txt_Password);
            myCPassword = myView.FindViewById<EditText>(Resource.Id.txt_Cpassword);
            welcomeNote = myView.FindViewById<TextView>(Resource.Id.txtUserName);

            myUserName.Text = userDetails[0];
            myEmailId.Text = userDetails[1];
            myPassword.Text = userDetails[2];
            myCPassword.Text = userDetails[2];
            welcomeNote.Text = "Hey ! "+ userDetails[0];

            btnUpdate.Click += delegate
            {
                if (myUserName.Text.Trim().Equals("") || myUserName.Text.Length < 0 || myPassword.Text.Trim().Equals("") || myPassword.Text.Length < 0 || myCPassword.Text.Trim().Equals("") || myCPassword.Text.Length < 0)
                {
                    alert.SetTitle("Aleph | Error");
                    alert.SetMessage("Please fill all fields");
                    alert.SetPositiveButton("OK", alertOKButton);
                    Dialog myDialog = alert.Create();
                    myDialog.Show();
                }
                else if (myPassword.Text.Trim() != myCPassword.Text.Trim())
                {
                    alert.SetTitle("Aleph | Error");
                    alert.SetMessage("Passwords are not matching");
                    alert.SetPositiveButton("OK", alertOKButton);
                    Dialog myDialog = alert.Create();
                    myDialog.Show();
                }
                else
                {
                    myDB.updateData(myUserName.Text.Trim(), myEmailId.Text.Trim(), myPassword.Text.Trim());
                    alert.SetTitle("Aleph | Information");
                    alert.SetMessage("Information Updated Successfully");
                    alert.SetPositiveButton("OK", alertSuccessButton);
                    Dialog myDialog = alert.Create();
                    myDialog.Show();
                }
            };

            return myView;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.bookContent);

            Book_name = Intent.GetStringExtra("bookName");
            myDB      = new DBHelperClass(this);

            string bookURL = myDB.getBookURL(Book_name);


            webView = FindViewById <WebView>(Resource.Id.webView);
            webView.SetWebViewClient(new WebViewClient());

            WebSettings webSettings = webView.Settings;

            webSettings.JavaScriptEnabled = true;
            webView.LoadUrl(bookURL);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.LibraryBook);
            myDB          = new DBHelperClass(this);
            alert         = new Android.App.AlertDialog.Builder(this);
            btnRead       = FindViewById <Button>(Resource.Id.btn_read);
            btnAddLibrary = FindViewById <Button>(Resource.Id.btn_add_library);

            bookName      = FindViewById <TextView>(Resource.Id.bookName);
            bookauthor    = FindViewById <TextView>(Resource.Id.bookAuthor);
            rateValue     = FindViewById <TextView>(Resource.Id.RateValue);
            booksum       = FindViewById <TextView>(Resource.Id.bookSum);
            bookImg       = FindViewById <ImageView>(Resource.Id.bookImageId);
            Book_name     = Intent.GetStringExtra("bookName");
            userEmail     = Intent.GetStringExtra("userEmailid");
            bookName.Text = Book_name;

            string[] bookDetails = myDB.getBookInformations(Book_name);

            bookauthor.Text = bookDetails[0];
            booksum.Text    = bookDetails[2];
            var type_book = bookDetails[1];

            rateValue.Text = bookDetails[3];
            bookId         = System.Convert.ToInt32(bookDetails[4]);
            bookImg.SetBackgroundResource(System.Convert.ToInt32(bookDetails[5]));


            if (type_book == "book")
            {
                btnRead.Click += ReadBook;
                btnRead.Text   = "Read";
            }
            else
            {
                btnRead.Click += ListenBook;
                btnRead.Text   = "Listen";
            }

            btnAddLibrary.Click += removeLibraryBook;
        }
Beispiel #6
0
        public PhotoAlbum2(Activity context, string userEmail)
        {
            DBHelperClass myDB     = new DBHelperClass(context);
            ICursor       myresult = myDB.getAllLibraryBooks(userEmail);

            listPhoto = new Photo2[myresult.Count];
            int i = 0;

            while (myresult.MoveToNext())
            {
                listPhoto[i] = new Photo2()
                {
                    mPhotoID = myresult.GetInt(myresult.GetColumnIndexOrThrow("bookimage")), mCaption = myresult.GetString(myresult.GetColumnIndexOrThrow("bookname"))
                };
                ++i;
            }

            this.photos1 = listPhoto;
            random       = new Random();
        }
        public PhotoAlbum(Activity context)
        {
            DBHelperClass myDB = new DBHelperClass(context);

            ICursor myresult = myDB.getAllBooks();

            listPhoto = new Photo[myresult.Count];
            int i = 0;
            int a = Resource.Drawable.RomeoandJuliet;

            while (myresult.MoveToNext())
            {
                listPhoto[i] = new Photo()
                {
                    mPhotoID = myresult.GetInt(myresult.GetColumnIndexOrThrow("book_image")), mCaption = myresult.GetString(myresult.GetColumnIndexOrThrow("book_name"))
                };
                ++i;
            }

            this.photos = listPhoto;
            random      = new Random();
        }
Beispiel #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.signup);

            // Create your application here
            myLogin  = FindViewById <Button>(Resource.Id.btnLogin);
            mySignup = FindViewById <Button>(Resource.Id.btnSignup);

            btnSignup   = FindViewById <Button>(Resource.Id.button3);     // signup
            txtName     = FindViewById <EditText>(Resource.Id.editText);  //name
            txtEmail    = FindViewById <EditText>(Resource.Id.editText2); //email
            txtPassword = FindViewById <EditText>(Resource.Id.editText3); //password

            alert = new Android.App.AlertDialog.Builder(this);            // database
            myDB  = new DBHelperClass(this);                              // alertbox


            myLogin.Click += delegate
            { // Already login button
              //Intent loginScreen = new Intent(this, typeof(login)); // on success loading login page
              // StartActivity(loginScreen);
                StartActivity(typeof(login));
                OverridePendingTransition(Resource.Animation.fade_in, Resource.Animation.fade_out);
            };

            btnSignup.Click += delegate
            {
                alert.SetTitle("Aleph | Error !");
                if (txtName.Text.Trim().Equals("") || txtName.Text.Length < 0 || txtEmail.Text.Trim().Equals("") || txtEmail.Text.Length < 0 || txtPassword.Text.Trim().Equals("") || txtPassword.Text.Length < 0)
                {
                    alert.SetMessage("Please fill all fields");
                    alert.SetPositiveButton("OK", alertOKButton);
                    Dialog myDialog = alert.Create();
                    myDialog.Show();
                }
                else if (!re.IsMatch(txtEmail.Text.Trim()))
                {
                    alert.SetMessage("Please enter valid Email address");
                    alert.SetPositiveButton("OK", alertOKButton);
                    Dialog myDialog = alert.Create();
                    myDialog.Show();
                }
                else
                {
                    Boolean f = myDB.insertValue(txtName.Text.Trim(), txtEmail.Text.Trim(), txtPassword.Text.Trim());
                    if (f)
                    {
                        txtName.Text = ""; txtEmail.Text = ""; txtPassword.Text = "";
                        alert.SetMessage("Registration successfull!");
                    }
                    else
                    {
                        alert.SetMessage("User already exist!");
                    }
                    alert.SetTitle("Aleph | Information");
                    alert.SetPositiveButton("OK", redirectToLogin);
                    Dialog myDialog = alert.Create();
                    myDialog.Show();
                }
            };
        }