void GetData(bool refresh = false) { WriteLog.GetLog().Write("读取数据"); StringBuilder sb = new StringBuilder(); sb.AppendLine("开始获取数据" + DateTime.Now.ToString()); string strStart = System.DateTime.Now.ToString(); List <T_PRODUCE_REPLENISHPLAN> lists = new List <T_PRODUCE_REPLENISHPLAN>();///RelenishimentClass.GetReplenishplan(); foreach (var item in lbladded) { UpdateLabel(lists, 10, lbladd, Color.White); } foreach (var item in lbladd) { UpdateLabel(lists, 10, lbladd, Color.White); } try { List <T_PRODUCE_REPLENISHPLAN> list = RelenishimentClass.GetReplenishplan(); int length; if (list.Count > lbladded.Length) { length = lbladded.Length; } else { length = list.Count; } UpdateLabel(list, length, lbladd, Color.White); List <T_PRODUCE_REPLENISHPLAN> finish = new List <T_PRODUCE_REPLENISHPLAN>(); finish = RelenishimentClass.GetFinishedReplenishplan().OrderBy(item => item.ID).ToList(); int lengths; if (finish.Count > lbladded.Length) { lengths = lbladded.Length; } else { lengths = finish.Count; } UpdateLabel(finish, lengths, lbladded, Color.LightGreen); } catch (Exception ex) { WriteLog.GetLog().Write("sp-03:数据获取失败! "); if (ex.Message == "基础提供程序在 Open 上失败。") { databaselinkcheck("数据库连接失败!请检查网络,重新打开程序!"); } } }
/// <summary> /// 绑定数据 /// </summary> /// <param name="Seq"></param> /// <param name="pokeid"></param> public void DateBind(decimal Seq, string pokeid = null) { //HunheClass HunHeNowCigarette = new HunHeService_new(); List <T_PRODUCE_REPLENISHPLAN> list = RelenishimentClass.GetReplenishplan(); if (list.Count < 1) { //labMachineSeq.Text = Seq + "通道没有分拣数据,请选择其他通道!"; } //DgvNowView.DataSource = null; DgvNowView.DataSource = list; }