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; } } }