SmartHouseAPI/Source/MyHouse/DbOp/FrmSetOpTime.cs
zilinsoft f0ff641ed4 ## 2025-02-08 星期六更新
### MyHouse    V1.0.2502.0801
- *.[新增]适配新版接口。
### SmartHouseAPI    V1.0.2502.0801
- *.[新增]支持Docker部署,支持NAS。
2025-02-08 17:01:20 +08:00

55 lines
1.7 KiB
C#

using ryCommon;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MyHouse.DbOp
{
public partial class FrmSetOpTime : RySkins.SKinForm
{
public FrmSetOpTime()
{
InitializeComponent();
CbbMode.SelectedIndex = 0;
dateTimePickerEX1.Value = DateTime.Now;
}
public int OpId { get; set; } = 0;
private void BtnOK_Click(object sender, EventArgs e)
{
switch (MessageBox.Show("是否确认要设置?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
return;
}
var dt = dateTimePickerEX1.Value.ToInt64();
string post_str = "api=SetTime&id=" + OpId;
if(CbbMode.SelectedIndex==0)
{
post_str += "&CleanTime=" + dt;
}
else if(CbbMode.SelectedIndex==1)
{
post_str += "&ChargingTime=" + dt;
}
var jsonResult = API.API.Post("Goods", "SetTime", post_str);
if (jsonResult.IsOK)
{
DialogResult = DialogResult.OK;
//API.API.AddGoodsLogs(CbbMode.Text, OpId, "进行了[" + CbbMode.Text + "]", dateTimePickerEX1.Value.ToInt64());
}
else
{
MessageBox.Show(jsonResult.ResultText, "出错", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
//DialogResult = DialogResult.OK;
}
}
}