/// <summary> /// 获取工厂指定工业的生产线集合 /// </summary> /// <param name="strFactoryId"></param> /// <param name="strProcessId"></param> /// <returns></returns> public AssemblyLineInfoCollection GetAssemblyLineInfoCollection(string strFactoryId, string strProcessId) { try { AssemblyLineInfoCollection infos = new AssemblyLineInfoCollection(); string strSQL = "select *from v_assemblylineinfo where FactoryId=?FactoryId and ProcessId=?ProcessId"; List <MySqlParameter> sqlParameters = new List <MySqlParameter> { new MySqlParameter("?FactoryId", strFactoryId), new MySqlParameter("?ProcessId", strProcessId) }; AssemblyLineInfo info = new AssemblyLineInfo(); CreateDataList <AssemblyLineInfo>(infos, strSQL, sqlParameters, info, null); return(infos); } catch (Exception ex) { throw ex; } }
private void LoadAssemblyLineList() { try { string strFactoryId = "G01"; DataHelper dataHelper = new DataHelper(); AssemblyLineInfoCollection assemblyLines = dataHelper.GetAssemblyLineInfoCollection(strFactoryId); //写入列表 foreach (AssemblyLineInfo assembly in assemblyLines) { int index = this.dvAssLine.Rows.Add(); this.dvAssLine.Rows[index].Cells[0].Value = assembly.AssemblyLineId; this.dvAssLine.Rows[index].Cells[1].Value = assembly.FactoryId; this.dvAssLine.Rows[index].Cells[2].Value = assembly.ProcessId; this.dvAssLine.Rows[index].Cells[3].Value = assembly.ProcessTitle; this.dvAssLine.Rows[index].Cells[4].Value = assembly.AssemblyLineTitle; //DataGridViewButtonColumn buttons = new DataGridViewButtonColumn(); //{ // buttons.HeaderText = "Sales"; // buttons.Text = "Sales"; // buttons.UseColumnTextForButtonValue = true; // buttons.AutoSizeMode = // DataGridViewAutoSizeColumnMode.AllCells; // buttons.FlatStyle = FlatStyle.Standard; // buttons.CellTemplate.Style.BackColor = Color.Honeydew; // buttons.DisplayIndex = 0; //} //this.dvAssLine.Rows[index].Cells[6] = } } catch (Exception ex) { } }