private bool Call_TEST_STOCKIN(string STOCK_NO) { // Application.DoEvents(); bool C_Flag = false; int Cur_Rec = 0; int Tot_Rec = 0; int Err_Rec = 0; DataTable dt = OperateDB.getNewTable(OperateDB.Get_Wip_Tracking("STORENUMBER", STOCK_NO), string.Format("LOCSTATION<>'{0}'", MYGROUP)); Tot_Rec = dt.Rows.Count; string _StrErr = string.Empty; foreach (DataRow dr in dt.Rows) { _StrErr = OperateDB.TEST_MAIN_ONLY(dr["ESN"].ToString(), MYGROUP, Section, MYGROUP + "1", EmpLoyee, Line_Name); Cur_Rec = Cur_Rec + 1; progressBarX1.Value = (int)(Math.Round((decimal)Cur_Rec / Tot_Rec, 2) * 100); //Convert.ToInt32((Convert.ToDouble(Cur_Rec / Tot_Rec) * 100)); progressBarX1.Update(); progressBarX1.Text = (Tot_Rec - Cur_Rec).ToString(); progressBarX1.Update(); if (Cur_Rec % 50 == 0) { System.Threading.Thread.Sleep(200); this.Refresh(); } if (_StrErr != "OK") { Err_Rec = Err_Rec + 1; LabError.Visible = true; LabError.Text = "NG Count-->" + Err_Rec.ToString(); } } return(C_Flag); }
private static void UPDATE_WIPSTATION(string STOCK_NO) { DataTable dt = OperateDB.Get_Wip_Tracking("STORENUMBER", STOCK_NO, "DISTINCT WOID"); foreach (DataRow dr in dt.Rows) { Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("WOID", dr["WOID"].ToString()); dic.Add("STORENUMBER", STOCK_NO); dic.Add("WIPSTATION", OperateDB.GetWOLoc(dr["WOID"].ToString())); List <string> ListFields = new List <string>(); ListFields = new List <string>(); ListFields.Add("WOID"); ListFields.Add("STORENUMBER"); OperateDB.UPDATE_WIP_TRACKING(dic, ListFields); } }
/// <summary> /// 检查产品状态 1 没有数据,2有报废,3有不良 /// </summary> /// <returns></returns> private int CHECK_ERROR() { int Flag = 0; DataTable dt = OperateDB.Get_Wip_Tracking(sCmd, InputStr); InputData = dt; if (dt.Rows.Count == 0) { Flag = 1; return(Flag); } if (OperateDB.getNewTable(dt, string.Format("SCRAPFLAG<>'{0}'", "0")).Rows.Count > 0) { Flag = 2; } if (OperateDB.getNewTable(dt, string.Format("ERRFLAG<>'{0}'", "0")).Rows.Count > 0) { Flag = 3; } My_MoNumber = dt.Rows[0]["WOID"].ToString(); return(Flag); }