protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.ListLyt); dbMan = new databaseManager(); kinveyClient = dbMan.buildClient(); btn_addNew = FindViewById <Button>(Resource.Id.button2); btn_search = FindViewById <Button>(Resource.Id.button1); listView1 = FindViewById <ListView>(Resource.Id.listView1); tv_TotalValue = FindViewById <TextView>(Resource.Id.tv_TotalValue); temp = await dbMan.getAllItems(); if (temp.Count == 0) { Toast.MakeText(this, "There are no records for this account.", ToastLength.Short).Show(); } listView1.Adapter = new dataAdapter(this, temp); double total = temp.Sum(x => x.productTotal); tv_TotalValue.Text = total.ToString(); btn_addNew.Click += Btn_addNew_Click; btn_search.Click += Btn_search_Click; listView1.ItemClick += ListView1_ItemClick; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); dbMan = new databaseManager(); kinveyClient = dbMan.buildClient(); if (kinveyClient.User().isUserLoggedIn()) { kinveyClient.User().Logout(); } edttxtUser = FindViewById <EditText>(Resource.Id.edttxtUser); edttxtPass = FindViewById <EditText>(Resource.Id.edttxtPass); btn_Login = FindViewById <Button>(Resource.Id.btn_Login); btn_Register = FindViewById <Button>(Resource.Id.btn_Register); btn_Login.Click += Btn_Login_Click; btn_Register.Click += Btn_Register_Click; }
private void BtnSave_Click(object sender, EventArgs e) { dbMan = new databaseManager(); //Bitmap b = BitmapFactory.DecodeResource(imageView1.Context.Resources, Resource.Drawable.Icon); //imageView1.BuildDrawingCache(true); //Bitmap myb = Bitmap.CreateBitmap(b.Width, b.Height, b.GetConfig()); kinveyClient = dbMan.buildClient(); double price; if (editxtCost.Text == "") { price = 0; } else { price = Convert.ToDouble(editxtCost.Text); } dbMan.addItem(editxtBsinss.Text, dpicker.DateTime, editText1.Text, editxtGST.Text, editxtServ.Text, editxtProdcNam.Text, price, editxtPhNum.Text, editxtAddrs.Text, editxtTag.Text, bitmapData); //bitmap.Dispose(); StartActivity(typeof(ListActivity)); }
private async void Btn_register_Click(object sender, EventArgs e) { // databaseManager dbMan = new databaseManager(); databaseManager dbMan = new databaseManager(); kinveyClient = dbMan.buildClient(); bool success = await dbMan.registerUser(et_username.Text, et_password.Text); if (success == true) { StartActivity(typeof(MainActivity)); } }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.EditRecordLyt); dbMan = new databaseManager(); kinveyClient = dbMan.buildClient(); btn_Edit = FindViewById <Button>(Resource.Id.btn_Edit); btn_Delete = FindViewById <Button>(Resource.Id.btn_Delete); dpicker = FindViewById <DatePicker>(Resource.Id.datePicker1); imageView1 = FindViewById <ImageView>(Resource.Id.imageView1); editxtBsinss = FindViewById <EditText>(Resource.Id.editxtBsinss); editText1 = FindViewById <EditText>(Resource.Id.editText1); editxtGST = FindViewById <EditText>(Resource.Id.editxtGST); editxtServ = FindViewById <EditText>(Resource.Id.editxtServ); editxtProdcNam = FindViewById <EditText>(Resource.Id.editxtProdcNam); editxtCost = FindViewById <EditText>(Resource.Id.editxtCost); editxtPhNum = FindViewById <EditText>(Resource.Id.editxtPhNum); editxtAddrs = FindViewById <EditText>(Resource.Id.editxtAddrs); editxtTag = FindViewById <EditText>(Resource.Id.editxtTag); ID = Intent.GetStringExtra("id"); templist = await dbMan.getOneItem(ID); editxtBsinss.Text = templist[0].business; editText1.Text = templist[0].taxInvoice; editxtGST.Text = templist[0].gstNum; editxtServ.Text = templist[0].serverName; editxtProdcNam.Text = templist[0].productName; editxtCost.Text = templist[0].productTotal.ToString(); editxtPhNum.Text = templist[0].phone; editxtAddrs.Text = templist[0].address; editxtTag.Text = templist[0].tag; imageView1.SetImageBitmap(bytesToBitmap(templist[0].image)); btn_Edit.Click += Btn_Edit_Click; btn_Delete.Click += Btn_Delete_Click; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.SearchResult); listView1 = FindViewById <ListView>(Resource.Id.listView1); dbMan = new databaseManager(); kinveyClient = dbMan.buildClient(); string[] input = new string[6]; List <ReceiptClass> templist = new List <ReceiptClass>(); business = Intent.GetStringExtra("business"); tax = Intent.GetStringExtra("tax"); gst = Intent.GetStringExtra("gst"); productName = Intent.GetStringExtra("productName"); productPrice = Intent.GetStringExtra("productPrice"); tag = Intent.GetStringExtra("tag"); if (productPrice != "") { productTotal = Convert.ToDouble(productPrice); } //input = Intent.GetStringArrayExtra("transfer").ToArray(); //double price = Convert.ToDouble(input[4]); //templist = await dbMan.searchItems(input[0].ToString(), input[1].ToString(), input[2].ToString(), input[3].ToString(), price, input[5].ToString()); templist = await dbMan.searchItems(business, tax, gst, productName, productTotal, tag); if (templist.Count == 0) { Toast.MakeText(this, "There are no records for this account.", ToastLength.Short).Show(); } listView1.Adapter = new dataAdapter(this, templist); }