public int ShowSetting() { frmTaiwanContractSetting cSetting = new frmTaiwanContractSetting(); cSetting.CloseTime = __cCloseTime; DialogResult cResult = cSetting.ShowDialog(); if (cResult == DialogResult.OK) { __cCloseTime = cSetting.CloseTime; this.UpdateContractTime(DateTime.UtcNow.AddHours(TaiwanStockExchange.TIME_ZONE)); //更新 JObject cObject = new JObject(); cObject.Add(new JProperty("ExpireTime", __cCloseTime)); this.args = cObject; //將參數設定至屬性上(方便寫入至設定檔內) return(0); //成功 } return(-1); //取消 }
public int ShowSetting() { frmTaiwanContractSetting cSetting = new frmTaiwanContractSetting(); cSetting.CloseTime = new TimeSpan(__iCloseHour, __iCloseMinute, __iCloseSecond); DialogResult cResult = cSetting.ShowDialog(); if (cResult == DialogResult.OK) { TimeSpan cCloseTime = cSetting.CloseTime; __iCloseHour = cCloseTime.Hours; __iCloseMinute = cCloseTime.Minutes; __iCloseSecond = cCloseTime.Seconds; this.UpdateContractTime(DateTime.UtcNow.AddHours(TaiwanStockExchange.TIME_ZONE)); JObject cObject = new JObject(); cObject.Add(new JProperty("ExpireTime", cCloseTime)); this.args = cObject; //將參數設定至屬性上(方便寫入至設定檔內) return(0); //成功 } return(-1); //取消 }