internal async Task AddGridView(frmMain.GData gData, WorkStep key) { List <string> addrow = new List <string>(); if (key == WorkStep.FrontGear) { TB_GearFront tmp = gData._GearFront; tmp.Insert_Time = DateTime.Now; addrow.Add(tmp.Insert_Time.ToString()); addrow.Add(tmp.Work_Date.ToString()); addrow.Add(tmp.GearNo_4WD.ToString()); addrow.Add(tmp.GearNo_Front.ToString()); addrow.Add(tmp.Part_Name.ToString()); addrow.Add(tmp.FGear_G4_Min.ToString()); addrow.Add(tmp.FGear_G4_Val.ToString()); addrow.Add(tmp.FGear_G4_Max.ToString()); addrow.Add(tmp.FGear_G2_Min.ToString()); addrow.Add(tmp.FGear_G2_Val.ToString()); addrow.Add(tmp.FGear_G2_Max.ToString()); } else if (key == WorkStep.FrontCase) { TB_FrontCase tmp = gData._FrontCase; tmp.Insert_Time = DateTime.Now; addrow.Add(tmp.Insert_Time.ToString()); addrow.Add(tmp.Work_Date.ToString()); addrow.Add(tmp.FrontCase_Bar.ToString()); addrow.Add(tmp.Part_Name.ToString()); addrow.Add(tmp.FCase_4WD_Min.ToString()); addrow.Add(tmp.FCase_4WD_Val.ToString()); addrow.Add(tmp.FCase_4WD_Max.ToString()); addrow.Add(tmp.FCase_G4_Min.ToString()); addrow.Add(tmp.FCase_G4_Val.ToString()); addrow.Add(tmp.FCase_G4_Max.ToString()); } await Task.Run(() => DGVAddRow(key, addrow.ToArray())); }
internal async Task UpdateData(frmMain.GData gData, WorkStep key, bool bmaster = false) //frmMain.GData gData { List <string> addrow = new List <string>(); if (key == WorkStep.FrontGear) { TB_GearFront tmp = gData._GearFront; addrow.Add(tmp.Work_No.ToString()); addrow.Add(tmp.FGear_G2_Val.ToString()); addrow.Add(tmp.FGear_G4_Val.ToString()); Task.Run(() => GearFrontUpdate(gData, bmaster)); } else if (key == WorkStep.FrontCase) { TB_FrontCase tmp = gData._FrontCase; addrow.Add(tmp.Work_No.ToString()); addrow.Add(bmaster ? tmp.FrontCase_Bar : gData._WORKMASTER.Master_No); addrow.Add(tmp.FCase_4WD_Val.ToString()); addrow.Add(tmp.FCase_G4_Val.ToString()); Task.Run(() => CaseFrontUpdate(gData, bmaster)); } await Task.Run(() => DGVAddRow(key, addrow.ToArray())); }