Exemple #1
0
        partial void UIButton118_TouchUpInside(UIButton sender)
        {
            db_inter = new Database_interaction();
            bool   parseOK;
            string name      = lblname.Text;
            string costvalue = lblcost.Text;
            float  cost;

            parseOK = float.TryParse(costvalue, out cost);
            if (!parseOK)
            {
                UIAlertView alert1 = new UIAlertView()
                {
                    Title   = "Error",
                    Message = "The Cost Must Be digit!!"
                };
                alert1.AddButton("OK");
                alert1.Show();
                return;
            }
            string   type    = lbltype.Text;
            DateTime date    = tempDate;         //picker's time
            string   details = lbldetails.Text;


            db_inter.AddCost(new Cost(name, cost, type, date, details));            //add cost


            UIAlertView alert2 = new UIAlertView()
            {
                Title   = "Add Successfully",
                Message = "The Cost has been added!!"
            };

            alert2.AddButton("OK");
            alert2.Show();
        }
        partial void UIButton118_TouchUpInside(UIButton sender)
        {
            bool   parseOK;
            string name      = lblname.Text;
            string costvalue = lblcost.Text;
            float  cost;

            parseOK = float.TryParse(costvalue, out cost);
            if (!parseOK)
            {
                var alert1 = new UIAlertView("Error", "The Cost Must Be digit", null, "OK", null);
                alert1.Show();
                return;
            }
            string   type    = lbltype.Text;
            DateTime date    = DateTime.Now;
            string   details = lbldetails.Text;


            db_inter.AddCost(new Cost(name, cost, type, date, details));            //add cost

            //var alert = new UIAlertView("", "The Cost has been added!!", null, "OK", null);
            //alert.Show();
        }