Пример #1
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;
        }
Пример #2
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),
                    }
                };
            }
        }
Пример #3
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
                });
            }
        }
Пример #4
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
                    }
                };
            }
        }