コード例 #1
0
    void Start()
    {
        int id = ScheduleDetail.ScheduleId;

        if (id == 0)
        {
            return;
        }
        Year.text = Calendar.SelectedDate.ToString("yyyy年");
        Date.text = Calendar.SelectedDate.ToString("M月d日");

        var result = ScheduleTable.FindById(id);

        if (result.Rows.Count == 0)
        {
            return;
        }

        var data = result.Rows[0];

        titleField.text = (string)data["title"];
        descField.text  = (string)data["detail"];

        backButton.onClick.AddListener(() => {
            SceneManager.LoadScene("ScheduleDetail");
        });
        updateButton.onClick.AddListener(UpdateSchedule);
    }
コード例 #2
0
    void Start()
    {
        var result = ScheduleTable.FindById(ScheduleId);

        if (result.Rows.Count == 0)
        {
            return;
        }
        var data = result.Rows[0];

        var date = DateTime.Parse((string)data["date"]);
        var icon = (int)data["icon"];

        Year.text    = date.ToString("yyyy年");
        Date.text    = date.ToString("M月d日");
        Title.text   = (string)data["title"];
        Detail.text  = (string)data["detail"];
        Remind.text  = (string)data["time"];
        Image.sprite = iconList[icon];

        BackButton.onClick.AddListener(() => {
            SceneManager.LoadScene("ScheduleList");
        });
        EditButton.onClick.AddListener(() => {
            SceneManager.LoadScene("ScheduleEdit");
        });
        DeleteButton.onClick.AddListener(() => {
            ScheduleTable.DeleteById(ScheduleId);
            SceneManager.LoadScene("ScheduleList");
        });
    }