示例#1
0
        private void BtnSave_Clicked(object sender, EventArgs e)
        {
            if (pickerType.SelectedItem.ToString() == "Catergory")
            {
                if (catergoryEntry.txtName.Text != "")
                {
                    item.CatergoryType = true;
                    item.Name          = catergoryEntry.txtName.Text;
                }
                else
                {
                    return;
                }
            }
            else if (pickerType.SelectedItem.ToString() == "Item")
            {
                if (itemEntry.txtName.Text != "" || itemEntry.txtDescription.Text != "" || itemEntry.txtQuantity.Text != "")
                {
                    item.CatergoryType = false;
                    item.Name          = itemEntry.txtName.Text;
                    item.Quantity      = itemEntry.txtQuantity.Text;
                    item.Description   = itemEntry.txtDescription.Text;
                }
                else
                {
                    return;
                }
            }
            FileManager fileManager = new FileManager();

            fileManager.AddItem(this, item);
            this.Navigation.PopAsync();
        }