Esempio n. 1
0
        void SaveData()
        {
            DateTime date = Utility.ConvertToDate(TRXDATE);

            using (var db = new SQLite.SQLiteConnection(pathToDatabase))
            {
                var list = db.Table <ItemStock> ().Where(x => x.ICode == ICODE && x.DateTrx == date).ToList();
                if (list.Count > 0)
                {
                    list [0].QtyAct = Convert2NumTool <double> .ConvertVal(qtyAct.Text);

                    list [0].QtyRtr = Convert2NumTool <double> .ConvertVal(qtyRtn.Text);

                    list [0].QtyCrf = Convert2NumTool <double> .ConvertVal(qtyCrf.Text);

                    list [0].QtyBrf = Convert2NumTool <double> .ConvertVal(qtyBrf.Text);

                    list [0].QtyBal = Convert2NumTool <double> .ConvertVal(qtySales.Text);

                    db.Update(list [0]);
                }
            }
            Toast.MakeText(this, Resources.GetString(Resource.String.msg_successsave), ToastLength.Long).Show();
            base.OnBackPressed();
        }
Esempio n. 2
0
        bool IsValidEntry()
        {
            if (spinItem.SelectedItem == null)
            {
                Toast.MakeText(this, Resources.GetString(Resource.String.msg_invaliditem), ToastLength.Long).Show();
                spinItem.RequestFocus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtqty.Text))
            {
                Toast.MakeText(this, Resources.GetString(Resource.String.msg_invalidqty), ToastLength.Long).Show();
                txtqty.RequestFocus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtprice.Text))
            {
                Toast.MakeText(this, Resources.GetString(Resource.String.msg_invalidprice), ToastLength.Long).Show();
                txtprice.RequestFocus();
                return(false);
            }

            double qty = Convert2NumTool <double> .ConvertVal(txtqty.Text);

            if (qty == 0)
            {
                Toast.MakeText(this, Resources.GetString(Resource.String.msg_invalidqty), ToastLength.Long).Show();
                txtqty.RequestFocus();
                return(false);
            }

            return(true);
        }