Esempio n. 1
0
        private void Insert_Clicked(object sender, EventArgs e)
        {
            RecordsModel.InsertRecords(Weight.Text, Leg.Text, Set.Text, yyyymmdd);//試し

            DisplayAlert("", "保存されました", "OK");

            Navigation.PushAsync(new RecordListPage());
        }
        public RecordListPage()
        {
            InitializeComponent();

            try
            {
                list.ItemsSource = RecordsModel.SelectRe();
            }catch (Exception e)
            {
                N.Text = "";
            }
        }
Esempio n. 3
0
        public RecordListPage()
        {
            InitializeComponent();

            /*var layout = new StackLayout { HorizontalOptions = LayoutOptions.Center, Margin = new Thickness { Top = 100 } };
             * //Userテーブルに適当なデータを追加
             * MuscleMenuModelCS.insertUser("鈴木");
             * MuscleMenuModelCS.insertUser("田中");
             * MuscleMenuModelCS.insertUser("斎藤");
             * //Userテーブルの行データを取得
             * var query = MuscleMenuModelCS.selectUser();
             * foreach (var Memo in query)
             * {
             *  //Userテーブルの名前列をLabelに書き出します
             *  layout.Children.Add(new Label { Text = Memo.Name });
             * }
             * Content = layout;
             * }*/

            var layout = new StackLayout {
                HorizontalOptions = LayoutOptions.Margin = new Thickness {
                    0, 20, 0, 0
                }
            };
            var record = RecordsModel.SelectRecords();

            if (record != null)
            {
                foreach (var Memo in record)
                {
                    layout.Children.Add(new Label {
                        Text = Memo.M_date.ToString()
                    });
                    layout.Children.Add(new Label {
                        Text = Memo.M_weight.ToString()
                    });
                    layout.Children.Add(new Label {
                        Text = Memo.M_set.ToString()
                    });
                    layout.Children.Add(new Label {
                        Text = Memo.M_leg.ToString()
                    });
                }
            }
            var insertButton = new Button
            {
                HorizontalOptions = LayoutOptions.EndAndExpand,
                Text = "メニュー追加",
            };

            Content = layout;
        }
Esempio n. 4
0
        void Button_Clicked(object sender, EventArgs e)
        {
            var InsertName = insertEntry.Text;

            RecordsModel.InsertRecords(weight);//試し

            /*var InsertName = insertEntry.Text;
             * RecordsModel.insertRecords(InsertName); */
            DisplayAlert("", "保存されました", "OK");


            Navigation.PushAsync(new RecordListPage());
        }
Esempio n. 5
0
        public void Insert_Clicked(object sender, EventArgs e)
        {
            int WeightText = int.Parse(Weight.Text);
            int LegText    = int.Parse(Leg.Text);
            int SetText    = int.Parse(Set.Text);


            //RecordsModel.InsertRecords(Weight.Text, Leg.Text, Set.Text, yyyymmdd);//試し
            RecordsModel.InsertRecords(WeightText, LegText, SetText, yyyymmdd);

            DisplayAlert("", "保存されました", "OK");

            Navigation.PushAsync(new RecordListPage());
        }
Esempio n. 6
0
        public ReModel()
        {
            if (RecordsModel.SelectRecords() != null)
            {
                var query = RecordsModel.SelectRecords();
                Records = new ObservableCollection <Record>();

                foreach (var record in query)//拡張forループ
                {
                    Record r = new Record
                    {
                        M_no     = record.M_no,
                        M_name   = record.M_name,
                        M_weight = record.M_weight,
                        M_leg    = record.M_leg,
                        M_set    = record.M_set,
                        M_date   = record.M_date
                    };
                    //一行ずつ追加
                    Records.Add(r);
                }
            }

            /*if(RecoedsModel.SelectRecords())
             * {
             *
             * }*/

            else
            {
                Records = new ObservableCollection <Record>
                {
                    new Record
                    {
                        M_no     = 0,
                        M_name   = "データなし",
                        M_weight = 0,
                        M_leg    = 0,
                        M_set    = 0,
                        M_date   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day),
                    }
                };
            }
        }
Esempio n. 7
0
        public RecordListPage()
        {
            InitializeComponent();

            //Userテーブルの行データを取得
            var query  = RecordsModel.SelectRecords(); //中身はSELECT * FROM [Records]
            var layout = new StackLayout {
                HorizontalOptions = LayoutOptions.Center, Margin = new Thickness {
                    Top = 100
                }
            };

            foreach (var records in query)
            {
                //Userテーブルの名前列をLabelに書き出す
                layout.Children.Add(new Label {
                    Text = records.M_weight
                });
            }
        }
Esempio n. 8
0
        public ReModel()
        {
            //今日の日付
            DateTime now = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);

            if (RecordsModel.SelectRecords() != null)
            {
                var query = RecordsModel.SelectRecords();
                Records = new ObservableCollection <Record>();

                foreach (var record in query)//拡張forループ
                {
                    Record r = new Record
                    {
                        M_no     = m_no,
                        M_name   = m_name,
                        M_weight = m_weight,
                        M_leg    = m_leg,
                        M_set    = m_set,
                        M_date   = m_date
                    };
                    //一行ずつ追加
                    Records.Add(r);
                }
            }

            else
            {
                Records = new ObservableCollection <Record>
                {
                    new Record
                    {
                        M_name   = "データなし",
                        M_weight = 0,
                        M_leg    = 0,
                        M_set    = 0,
                        M_date   = now
                    }
                };
            }
        }
Esempio n. 9
0
 private void addItemButton_Clicked(object sender, EventArgs e)
 {
     RecordsModel.InsertRe(t);
     Navigation.PushAsync(new RecordListPage());
 }