コード例 #1
0
        private void btnSetTime_Click(object sender, EventArgs e)
        {
            Controller ctrl = GetSelectedController();

            if (ctrl == null)
            {
                return;
            }
            IAccessCore access = new WGAccess();
            bool        ret    = access.SetControllerTime(ctrl, dateTimePicker1.Value);

            MessageBox.Show("设置" + (ret ? "成功!" : "失败"));
        }
コード例 #2
0
        private void btnSetTime_Click(object sender, EventArgs e)
        {
            Controller ctrl = GetSelectedController();

            if (ctrl == null)
            {
                return;
            }
            if (dtpTime.ValueObject == null)
            {
                WinInfoHelper.ShowInfoWindow(this, "请选择时间!");
                return;
            }
            using (IAccessCore access = new WGAccess())
            {
                bool ret = access.SetControllerTime(ctrl, dtpTime.Value);
                WinInfoHelper.ShowInfoWindow(this, "设置时间" + (ret ? "成功!" : "失败"));
            }
        }