using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data; using ICSharpCode.Core; using Mesnac.Controls.Base; using Mesnac.Action.Base; using Mesnac.Codd.Session; using Mesnac.Action.ChemicalWeighing.Entity; namespace Mesnac.Action.ChemicalWeighing.Product.XlPlan { /// /// 自动下传计划列表 /// public class AutoDownloadAction : ChemicalWeighingAction, IAction { public void Run(RuntimeParameter runtime) { base.RunIni(runtime); //必须要调用的 ICSharpCode.Core.LoggingService.Debug("自动下传计划信息..."); Console.WriteLine("sa..............."); //DbMCControl planDateControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "[xl_plan].[Plan_Date]").FirstOrDefault(); //DbMCControl pptShiftControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Pmt_Shiftime").FirstOrDefault(); //if (planDateControl == null) //{ // ICSharpCode.Core.LoggingService.Error("{当班计划-手动下传计划列表} 缺少日期选择控件..."); // return; //} //if (pptShiftControl == null) //{ // ICSharpCode.Core.LoggingService.Error("{当班计划-手动下传计划列表} 缺少班次组合框控件..."); // return; //} #region 读取应答信号 if (!(BasePlcHelper.Instance.ChemicalWeighing_PLC_LoadingStatus.NowValue.ToInt() == 1 && BasePlcHelper.Instance.ChemicalWeighing_PC_LoadingStatus.NowValue.ToInt() == 0)) { return; } #endregion string msg = String.Empty; string planDate = DateTime.Now.ToString(); bool result = PlanHelper.DownloadPlanInfo(planDate, Global.PublicVar.Instance.globalShiftID, out msg); if (result) { msg = StringParser.Parse(ResourceService.GetString("Mesnac_Dialog_Msg_Success")); //执行成功! #region 记录操作日志 //base.DBLog(msg); #endregion MessageBox.Show(msg, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { #region 记录操作日志 //base.DBLog(msg); #endregion MessageBox.Show(msg, Mesnac.Basic.LanguageHelper.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }