public FrmProperty(Framework.Entity.Chapter chapter) { InitializeComponent(); Framework.Entity.Model model = (Framework.Entity.Model)utilService.FindById(new Framework.Entity.Model(), chapter.Model); System.Reflection.Assembly ass = System.Reflection.Assembly.LoadFrom(System.Windows.Forms.Application.ExecutablePath.Replace("\\" + System.Windows.Forms.Application.StartupPath, "")); PropertyGrid.SelectedObject = ass.CreateInstance(model.Class); System.Collections.ArrayList templateList = contentService.GetContentTemplateByTitle(chapter.Title); foreach (Framework.Entity.Template template in templateList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = template.Title; item.Value = template; CbxType.Items.Add(item); } if (model.Name == "模板工程专项概况") { CbxType.SelectedIndex = 2; CbxType.Visible = false; LbType.Visible = false; } else { CbxType.Items.RemoveAt(2); CbxType.SelectedIndex = 0; } }
private void BtnSubmit_Click(object sender, System.EventArgs e) { System.Collections.ArrayList array = new System.Collections.ArrayList(); double sum1 = 0; if (@class.GetType().Equals(new Framework.Model.ConcreteProject().GetType())) { System.Collections.ArrayList array1 = new System.Collections.ArrayList(); System.Collections.ArrayList array2 = new System.Collections.ArrayList(); System.Collections.ArrayList array3 = new System.Collections.ArrayList(); for (int i = 0; i < DataGridView1.Rows.Count; i++) { sum1 = sum1 + System.Convert.ToDouble(DataGridView1.Rows[i].Cells[2].Value); array1.Add(new object[] { i + 1, DataGridView1.Rows[i].Cells[1].Value, DataGridView1.Rows[i].Cells[2].Value, DataGridView1.Rows[i].Cells[3].Value }); } for (int i = 0; i < DataGridView2.Rows.Count; i++) { array2.Add(new object[] { i + 1, DataGridView2.Rows[i].Cells[1].Value, DataGridView2.Rows[i].Cells[2].Value, DataGridView2.Rows[i].Cells[3].Value }); } for (int i = 0; i < DataGridView3.Rows.Count; i++) { array3.Add(new object[] { i + 1, DataGridView3.Rows[i].Cells[1].Value, DataGridView3.Rows[i].Cells[2].Value }); } array.Add(array1); array.Add(array2); array.Add(array3); } object[] data = new object[] { Data1.Value, Data2.Value, Data3.Value }; Framework.Class.ComboItem item = (Framework.Class.ComboItem)CbxType.SelectedItem; CreateModuleIntance((Framework.Entity.Template)item.Value, array, @class, data); this.Close(); }
private void BtnSubmit_Click(object sender, System.EventArgs e) { double p1 = 0, p2 = 0, p3 = 0, p4 = 0; for (int i = 0; i < DataGridView.Rows.Count; i++) { if (DataGridView.Rows[i].Cells[0].Value != null) { if (DataGridView.Rows[i].Cells[0].Value.ToString().Equals("电动机")) { p1 += System.Convert.ToDouble(DataGridView.Rows[i].Cells[1].Value); } else if (DataGridView.Rows[i].Cells[0].Value.ToString().Equals("电焊机")) { p2 += System.Convert.ToDouble(DataGridView.Rows[i].Cells[1].Value); } else if (DataGridView.Rows[i].Cells[0].Value.ToString().Equals("室内照明")) { p3 += System.Convert.ToDouble(DataGridView.Rows[i].Cells[1].Value); } else if (DataGridView.Rows[i].Cells[0].Value.ToString().Equals("室外照明")) { p4 += System.Convert.ToDouble(DataGridView.Rows[i].Cells[1].Value); } } } double sum = System.Convert.ToDouble(IpK1.Text) * p1 / System.Convert.ToDouble(IpCos.Value) + System.Convert.ToDouble(IpK2.Text) * p2 + IpK3.Value * p3 + IpK4.Value * p4; object[] obj = new object[] { p1, p2, p3, p4, IpCos.Value, IpK1.Text, IpK2.Text, IpK3.Value, IpK4.Value, sum }; Framework.Class.ComboItem item = (Framework.Class.ComboItem)CbxType.SelectedItem; CreateModuleIntance((Framework.Entity.Template)item.Value, null, @class, obj); this.Close(); }
private void BtnSave_Click(object sender, System.EventArgs e) { module.Title = TbxName.Text; module.Class = TbxClass.Text; module.Position = CbxPosition.SelectedIndex; module.Image = CbxImage.SelectedIndex; if (CbxType.SelectedIndex == Framework.Entity.Module.ROOT) { module.Pid = Framework.Entity.Module.ROOT; module.Level = Framework.Entity.Module.ROOT; } else { Framework.Class.ComboItem item = (Framework.Class.ComboItem)CbxRoot.SelectedItem; module.Pid = System.Convert.ToInt32(item.Value); module.Level = Framework.Entity.Module.CHILD; } if (flag) { utilService.Update(module); } else { utilService.Insert(module); } RefreshIntance(); this.Close(); }
public FrmUseWater(Framework.Entity.Chapter chapter, object type) { InitializeComponent(); @class = type; System.Collections.ArrayList templateList = contentService.GetContentTemplateByTitle(chapter.Title); foreach (Framework.Entity.Template template in templateList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = template.Title; item.Value = template; CbxType.Items.Add(item); } CbxType.SelectedIndex = 0; }
private void BtnSave_Click(object sender, System.EventArgs e) { Framework.Entity.Chapter newChapter = new Framework.Entity.Chapter(); if (flag) { newChapter = chapter; } else { if (chapter.Title != null) { newChapter.Pid = chapter.Id; } else { newChapter.Pid = Framework.Entity.Chapter.ROOT; } } newChapter.Title = TbxName.Text; newChapter.Description = TbxDescription.Text; Framework.Class.ComboItem item = (Framework.Class.ComboItem)CbxModule.SelectedItem; newChapter.Module = System.Convert.ToInt32(item.Value); newChapter.State = CbxState.SelectedIndex; item = (Framework.Class.ComboItem)CbxModel.SelectedItem; newChapter.Model = System.Convert.ToInt32(item.Value); // int type;//章节属于哪个工程 if (CbxBasicType.Checked & CbxSpecialType.Checked) { newChapter.Type = 9;//所有工程 } else if (CbxSpecialType.Checked) { newChapter.Type = 1;//专项工程 } else { newChapter.Type = 0;//基本工程 } if (flag) { utilService.Update(newChapter); } else { utilService.Insert(newChapter); } RefreshIntance(); this.Close(); }
private void CbxType_SelectedIndexChanged(object sender, System.EventArgs e) { if (CbxType.SelectedIndex == Framework.Entity.Module.ROOT) { CbxRoot.Enabled = false; CbxRoot.Items.Clear(); } else { CbxRoot.Enabled = true; System.Collections.ArrayList rootList = authorityService.GetRootModule(Framework.Entity.Module.ALL); foreach (Framework.Entity.Module root in rootList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = root.Title; item.Value = root.Id; CbxRoot.Items.Add(item); } CbxRoot.SelectedIndex = 0; } }
private void BtnSubmit_Click(object sender, System.EventArgs e) { System.Collections.ArrayList array = new System.Collections.ArrayList(); // ateTime dt = dateTimePicker.Value; System.DateTime dtStart = dateTimeStart.Value; int timeStartYear = dtStart.Year; int timeStartMonth = dtStart.Month; int timeStartDay = dtStart.Day; System.DateTime dtEnd = dateTimeEnd.Value; int timeEndYear = dtEnd.Year; int timeEndMonth = dtEnd.Month; int timeEndDay = dtEnd.Day; int count = 0; for (int i = 0; i < DataGridView3.RowCount; i++) { if (DataGridView3.Rows[i].Cells[0].Value.ToString().Equals("True")) { array.Add(new object[] { DataGridView3.Rows[i].Cells[1].Value }); count++; } } for (int i = 0; i < DataGridView4.RowCount; i++) { if (DataGridView4.Rows[i].Cells[0].Value.ToString().Equals("True")) { array.Add(new object[] { DataGridView4.Rows[i].Cells[1].Value }); } } array.Add(new object[] { count }); object[] data = new object[] { DataGridView1.Rows[0].Cells[1].Value, DataGridView1.Rows[0].Cells[2].Value, DataGridView1.Rows[0].Cells[3].Value, DataGridView1.Rows[0].Cells[4].Value, DataGridView1.Rows[0].Cells[5].Value, DataGridView1.Rows[0].Cells[6].Value, DataGridView1.Rows[0].Cells[7].Value, DataGridView1.Rows[0].Cells[8].Value, DataGridView1.Rows[0].Cells[9].Value, DataGridView1.Rows[0].Cells[10].Value, timeStartYear, timeStartMonth, timeStartDay, timeEndYear, timeEndMonth, timeEndDay }; Framework.Class.ComboItem item = (Framework.Class.ComboItem)CbxType.SelectedItem; CreateModuleIntance((Framework.Entity.Template)item.Value, array, @class, data); this.Close(); }
private void BtnSubmit_Click(object sender, System.EventArgs e) { System.Collections.ArrayList array = new System.Collections.ArrayList(); double sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0; if (@class.GetType().Equals(new Framework.Model.UseWater().GetType())) { System.Collections.ArrayList array1 = new System.Collections.ArrayList(); System.Collections.ArrayList array2 = new System.Collections.ArrayList(); System.Collections.ArrayList array3 = new System.Collections.ArrayList(); System.Collections.ArrayList array4 = new System.Collections.ArrayList(); for (int i = 0; i < DataGridView1.Rows.Count; i++) { if (DataGridView1.Rows[i].Cells[0].Value != null) { sum1 = sum1 + System.Convert.ToDouble(DataGridView1.Rows[i].Cells[1].Value) * System.Convert.ToDouble(DataGridView1.Rows[i].Cells[2].Value); array1.Add(new object[] { i + 1, DataGridView1.Rows[i].Cells[0].Value, DataGridView1.Rows[i].Cells[1].Value, DataGridView1.Rows[i].Cells[2].Value, DataGridView1.Rows[i].Cells[3].Value }); } } for (int i = 0; i < DataGridView2.Rows.Count; i++) { if (DataGridView2.Rows[i].Cells[0].Value != null) { sum2 = sum2 + System.Convert.ToDouble(DataGridView2.Rows[i].Cells[1].Value) * System.Convert.ToDouble(DataGridView2.Rows[i].Cells[2].Value); array2.Add(new object[] { i + 1, DataGridView2.Rows[i].Cells[0].Value, DataGridView2.Rows[i].Cells[1].Value, DataGridView2.Rows[i].Cells[2].Value }); } } for (int i = 0; i < DataGridView3.Rows.Count; i++) { if (DataGridView3.Rows[i].Cells[0].Value != null) { sum3 = sum3 + System.Convert.ToDouble(DataGridView3.Rows[i].Cells[1].Value) * System.Convert.ToDouble(DataGridView3.Rows[i].Cells[2].Value); array3.Add(new object[] { i + 1, DataGridView3.Rows[i].Cells[0].Value, DataGridView3.Rows[i].Cells[1].Value, DataGridView3.Rows[i].Cells[2].Value }); } } for (int i = 0; i < DataGridView4.Rows.Count; i++) { if (DataGridView4.Rows[i].Cells[0].Value != null) { sum4 = sum4 + System.Convert.ToDouble(DataGridView4.Rows[i].Cells[1].Value) * System.Convert.ToDouble(DataGridView4.Rows[i].Cells[2].Value); array4.Add(new object[] { i + 1, DataGridView4.Rows[i].Cells[0].Value, DataGridView4.Rows[i].Cells[1].Value, DataGridView4.Rows[i].Cells[2].Value }); } } if (array1.Count == 0) { DevComponents.DotNetBar.MessageBoxEx.Show("请添加工程用水量记录!", "提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation); TabControl.SelectedTabIndex = 0; return; } else if (array2.Count == 0) { DevComponents.DotNetBar.MessageBoxEx.Show("请添加施工机械用水量记录!", "提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation); TabControl.SelectedTabIndex = 1; return; } else if (array3.Count == 0) { DevComponents.DotNetBar.MessageBoxEx.Show("请添加工地生活用水量记录!", "提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation); TabControl.SelectedTabIndex = 2; return; } else if (array4.Count == 0) { DevComponents.DotNetBar.MessageBoxEx.Show("请添加生活区生活用水量记录!", "提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation); TabControl.SelectedTabIndex = 3; return; } array.Add(array1); array.Add(array2); array.Add(array3); array.Add(array4); } double q1 = (IpK1.Value * sum1 * IpK2.Value) / (IpT1.Value * IpB1.Value * 8 * 3600); double q2 = (IpK3.Value * sum2 * IpK4.Value) / (8 * 3600); double q3 = (IpK5.Value * sum3) / (IpB2.Value * 8 * 3600); double q4 = (IpK6.Value * sum4) / (24 * 3600); double q5 = IpQ5.Value; double q = q5 + (q1 + q2 + q3 + q4) / 2; double d = System.Math.Sqrt((4 * q) / (System.Math.PI * IpV.Value * 1000)); object[] data = new object[] { IpK1.Value, IpK2.Value, IpK3.Value, IpK4.Value, IpK5.Value, IpK6.Value, IpT1.Value, IpB1.Value, IpB2.Value, sum1, sum2, sum3, sum4, q1, q2, q3, q4, q5, q, IpV.Value, d, d * 1000 }; Framework.Class.ComboItem item = (Framework.Class.ComboItem)CbxType.SelectedItem; CreateModuleIntance((Framework.Entity.Template)item.Value, array, @class, data);//4.通过delegate数据变量执行实例方法 this.Close(); }
public FrmConcreteProject(Framework.Entity.Chapter chapter, object type) { InitializeComponent(); @class = type; System.Collections.ArrayList templateList = contentService.GetContentTemplateByTitle(chapter.Title); foreach (Framework.Entity.Template template in templateList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = template.Title; item.Value = template; CbxType.Items.Add(item); } CbxType.SelectedIndex = 0; { #region /*�Ͷ�����*/ DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "ѡ����"; colChoice.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colName.HeaderText = "��������"; colName.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colNumber = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colNumber.HeaderText = "ÿ������"; colNumber.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRemarks = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRemarks.HeaderText = "��ע"; colRemarks.Width = 309; object[,] machines = new object[,]{ {"���鳤" , "�н�ǿʩ����֯��������Ϥ������ʩ��������"}, {"����","�����飬��֤�ϸڡ�"}, {"Ĩ��","�������߹��������Ĩ�澭�飬��֤�ϸڡ�"}, {"�ӹ�","�нӹܾ��飬����������"}, {"�չ�","�ܹ��Կ࣬�����࣬����ָ��"} }; for (int i = 0; i < 5; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i, 0]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView1.SelectedRows[0].Cells[1].Value = btnItem.Text; switch (btnItem.Text) { case "���鳤": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[0, 1]; break; case "����": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[1, 1]; break; case "Ĩ��": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[2, 1]; break; case "�ӹ�": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[3, 1]; break; case "�չ�": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[4, 1]; break; } DataGridView1.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView1.Columns.Add(colChoice); DataGridView1.Columns.Add(colName); DataGridView1.Columns.Add(colNumber); DataGridView1.Columns.Add(colRemarks); #endregion } { #region/*������ */ DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "ѡ���е"; colChoice.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colName.HeaderText = "��е����"; colName.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colNumber = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colNumber.HeaderText = "����"; colNumber.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colPower = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colPower.HeaderText = "���ʣ�KW��"; colPower.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRemarks = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRemarks.HeaderText = "��ע"; colRemarks.Width = 209; object[] machines2 = new object[]{ "�������ó�","��������","BL12���ϸ�","���ӳ�","ľĨ","��Ĩ�θ�","����","�־��","��ˢ" }; for (int i = 0; i < 9; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines2[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView2.SelectedRows[0].Cells[1].Value = btnItem.Text; DataGridView2.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView2.Columns.Add(colChoice); DataGridView2.Columns.Add(colName); DataGridView2.Columns.Add(colNumber); DataGridView2.Columns.Add(colPower); DataGridView2.Columns.Add(colRemarks); #endregion } { #region/*������ԭ����Ҫ�� */ DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "ѡ��ԭ����"; colChoice.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colName.HeaderText = "ԭ��������"; colName.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRemarks = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRemarks.HeaderText = "��ע"; colRemarks.Width = 409; object[,] machines3 = new object[,]{ {"ɰ" , "ѡ���д�ɰ��ƽ������������0.5mm����������1%����ɰ�ӵĺ�ʯ������ˮ���������������ҽ���վ�����ֳ�ȡ��ʵ�⣬��֤�������ϸ���ʩ����ϱ�ʩ����"}, {"ʯ��","ѡ����ʯ��Ҫ��������1%����麬����0.5%��ѹ��ָ��ֵ��10�����������ܾ�֮����1��3��1��4֮�䡣"}, {"ˮ��","������ͨ������ˮ�࣬ˮ�����������ȡ�����ԣ������Ժϸ��ʹ�á�"}, {"���ͼ�","�������ͼ�Ӧ���г����ϸ�֤����Ʒ�������ϣ���������Ӧ���ұ���Ҫ������Ч�ڻ��ܳ��ı��ͼ�����ʹ�á�"}, {"��ú��","ѡ�â��Żң��������ϱ�����߳����ϸ�֤"}, {"���ͼ�","ѡ��MEA��ʹ���������Բ������������ٻ�����������Ӧ����ǿ�ŵķ�ˮ�������������ϱ�����߳����ϸ�֤����������֤��"}, {"ˮ","������ˮ�����ྻ����ˮ"} }; for (int i = 0; i < 7; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines3[i, 0]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView3.SelectedRows[0].Cells[1].Value = btnItem.Text; switch (btnItem.Text) { case "ɰ": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[0, 1]; break; case "ʯ��": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[1, 1]; break; case "ˮ��": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[2, 1]; break; case "���ͼ�": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[3, 1]; break; case "��ú��": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[4, 1]; break; case "���ͼ�": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[5, 1]; break; case "ˮ": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[6, 1]; break; } DataGridView3.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView3.Columns.Add(colChoice); DataGridView3.Columns.Add(colName); DataGridView3.Columns.Add(colRemarks); #endregion } }
public FrmArrayList(Framework.Entity.Chapter chapter, object type) { InitializeComponent(); @class = type; System.Collections.ArrayList templateList = contentService.GetContentTemplateByTitle(chapter.Title); foreach (Framework.Entity.Template template in templateList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = template.Title; item.Value = template; CbxType.Items.Add(item); } CbxType.SelectedIndex = 0; if (@class.GetType().Equals(new Framework.Model.PlanLabor().GetType())) { System.Windows.Forms.DataGridViewCheckBoxColumn colState = new System.Windows.Forms.DataGridViewCheckBoxColumn(true); colState.ThreeState = false; colState.Width = 30; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colType = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colType.HeaderText = "工种"; colType.Width = 80; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colBase = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colBase.HeaderText = "基础施工阶段"; colBase.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colMain = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colMain.HeaderText = "主体施工阶段"; colMain.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colFitup = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colFitup.HeaderText = "基础施工阶段"; colFitup.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colLast = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colLast.HeaderText = "收尾阶段"; colLast.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colPrepare = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colPrepare.HeaderText = "准备阶段"; colPrepare.Width = 100; DataGridView.Columns.Add(colState); DataGridView.Columns.Add(colType); DataGridView.Columns.Add(colBase); DataGridView.Columns.Add(colMain); DataGridView.Columns.Add(colFitup); DataGridView.Columns.Add(colLast); DataGridView.Columns.Add(colPrepare); } else if (@class.GetType().Equals(new Framework.Model.PlanMachine().GetType())) { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择设备"; colChoice.Width = 70; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colName.HeaderText = "设备名称"; colName.Width = 180; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colType = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colType.HeaderText = "设备型号"; colType.Width = 180; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colFunction = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colFunction.HeaderText = "性能"; colFunction.Width = 180; object[,] machines = new object[, ] { { "塔吊", new string[] { "QTZ31.5&315-KN·m", "QTZ40&400KN·m", "QTZ50&500KN·m", "QTZ63&630KN·m" } }, { "施工电梯", new string[] { "SCD200/200&100m/200m" } }, { "砼搅拌机", new string[] { "JDC350&350L/560L", "JS500&500L/800L", "JS75&750L/1200L" } }, { "挖掘机(反铲)", new string[] { "Atlas3306LC&31500&1.90", "Atlas2606LC&25000&1.50", "Atlas2006LC&18000&1.00", "Atlas2306LC&22000&1.20", "BonnyCE400-6&40000&2.00", "BonnyCE650-6&66000&4.00" } } }; for (int i = 0; i < 4; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i, 0]; string[] types = (string[])machines[i, 1]; for (int j = 0; j < types.Length; j++) { DevComponents.DotNetBar.ButtonItem btnChildItem = new DevComponents.DotNetBar.ButtonItem(); string[] info = types[j].ToString().Split('&'); btnChildItem.Text = info[0]; btnChildItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DevComponents.DotNetBar.ButtonItem item = sender as DevComponents.DotNetBar.ButtonItem; DataGridView.SelectedRows[0].Cells[1].Value = item.Parent.Text; DataGridView.SelectedRows[0].Cells[2].Value = info[0]; DataGridView.SelectedRows[0].Cells[3].Value = info[1]; DataGridView.Refresh(); }); btnItem.SubItems.Add(btnChildItem); } colChoice.SubItems.Add(btnItem); } DataGridView.Columns.Add(colChoice); DataGridView.Columns.Add(colName); DataGridView.Columns.Add(colType); DataGridView.Columns.Add(colFunction); } else if (@class.GetType().Equals(new Framework.Model.PlanMaterial().GetType())) { // DevComponents.DotNetBar.Controls.DataGridViewComboBoxExColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewComboBoxExColumn(); System.Windows.Forms.DataGridViewComboBoxColumn colName = new System.Windows.Forms.DataGridViewComboBoxColumn(); colName.HeaderText = "材料名称"; colName.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colNumber = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colNumber.HeaderText = "进场数量"; colNumber.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colUnit = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colUnit.HeaderText = "单位"; colUnit.Width = 80; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colPlan = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colPlan.HeaderText = "进场计划"; colPlan.Width = 160; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRemarks = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRemarks.HeaderText = "备注"; colRemarks.Width = 150; DataGridView.Columns.Add(colName); DataGridView.Columns.Add(colNumber); DataGridView.Columns.Add(colUnit); DataGridView.Columns.Add(colPlan); DataGridView.Columns.Add(colRemarks); } else if (@class.GetType().Equals(new Framework.Model.ManageMember().GetType())) { System.Windows.Forms.DataGridViewCheckBoxColumn colState = new System.Windows.Forms.DataGridViewCheckBoxColumn(true); colState.ThreeState = false; colState.Width = 30; System.Windows.Forms.DataGridViewTextBoxColumn colName = new System.Windows.Forms.DataGridViewTextBoxColumn(); colName.HeaderText = "姓名"; colName.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colWork = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colWork.HeaderText = "职务"; colWork.Width = 120; System.Windows.Forms.DataGridViewComboBoxColumn colTitle = new System.Windows.Forms.DataGridViewComboBoxColumn(); colTitle.HeaderText = "职称"; colTitle.Width = 120; colTitle.Items.Add("高级工程师"); colTitle.Items.Add("工程师"); colTitle.Items.Add("助理工程师"); colTitle.Items.Add("经济师"); colTitle.Items.Add("会计师"); System.Windows.Forms.DataGridViewTextBoxColumn colDuty = new System.Windows.Forms.DataGridViewTextBoxColumn(); colDuty.HeaderText = "工作责任"; colDuty.Width = 120; System.Windows.Forms.DataGridViewTextBoxColumn colRemarks = new System.Windows.Forms.DataGridViewTextBoxColumn(); colRemarks.HeaderText = "备注"; colRemarks.Width = 120; DataGridView.Columns.Add(colState); DataGridView.Columns.Add(colName); DataGridView.Columns.Add(colWork); DataGridView.Columns.Add(colTitle); DataGridView.Columns.Add(colDuty); DataGridView.Columns.Add(colRemarks); } else if (@class.GetType().Equals(new Framework.Model.PrepareMaterial().GetType())) { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择材料"; colChoice.Width = 150; DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn(); colName.HeaderText = "材料名称"; colName.Width = 460; object[] machines = new object[] { "发泡陶瓷保温板", "复合水泥发泡保温板", "加气混凝土板", "岩棉板(条)", "蓝海板", "其它" }; for (int i = 0; i < 6; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView.SelectedRows[0].Cells[1].Value = btnItem.Text; DataGridView.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView.Columns.Add(colChoice); DataGridView.Columns.Add(colName); } else if (@class.GetType().Equals(new Framework.Model.PrepareMachineTool().GetType())) { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择机具"; colChoice.Width = 150; DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn(); colName.HeaderText = "机具名称"; colName.Width = 460; object[] machines = new object[] { "抹子", "砂纸", "2m靠尺", "弹线墨盒", "多用刀", "铲刀", "阴阳角抿子", "电动搅拌机", "角磨机", "其它" }; for (int i = 0; i < 10; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView.SelectedRows[0].Cells[1].Value = btnItem.Text; DataGridView.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView.Columns.Add(colChoice); DataGridView.Columns.Add(colName); } else if (@class.GetType().Equals(new Framework.Model.PrepareMaterial().GetType())) { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择屋面做法"; colChoice.Width = 150; DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn(); colName.HeaderText = "屋面做法"; colName.Width = 460; object[] machines = new object[] { "发泡陶瓷保温板", "复合水泥发泡保温板", "加气混凝土板", "岩棉板(条)", "蓝海板", "其它" }; for (int i = 0; i < 6; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView.SelectedRows[0].Cells[1].Value = btnItem.Text; DataGridView.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView.Columns.Add(colChoice); DataGridView.Columns.Add(colName); } }
private void BtnSubmit_Click(object sender, System.EventArgs e) { System.Collections.ArrayList array = new System.Collections.ArrayList(); if (@class.GetType().Equals(new Framework.Model.PlanLabor().GetType())) { int sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum5 = 0; for (int i = 0; i < DataGridView.RowCount; i++) { if (DataGridView.Rows[i].Cells[0].Value.ToString().Equals("True")) { for (int j = 2; j < 7; j++) { FormatValue(DataGridView.Rows[i].Cells[j], 0); } sum1 += System.Convert.ToInt32(DataGridView.Rows[i].Cells[2].Value); sum2 += System.Convert.ToInt32(DataGridView.Rows[i].Cells[3].Value); sum3 += System.Convert.ToInt32(DataGridView.Rows[i].Cells[4].Value); sum4 += System.Convert.ToInt32(DataGridView.Rows[i].Cells[5].Value); sum5 += System.Convert.ToInt32(DataGridView.Rows[i].Cells[6].Value); array.Add(new object[] { DataGridView.Rows[i].Cells[1].Value, DataGridView.Rows[i].Cells[2].Value, DataGridView.Rows[i].Cells[3].Value, DataGridView.Rows[i].Cells[4].Value, DataGridView.Rows[i].Cells[5].Value }); } } if (array.Count > 0) { array.Add(new object[] { "总和", sum1, sum2, sum3, sum4, sum5 }); } } else if (@class.GetType().Equals(new Framework.Model.PlanMachine().GetType())) { for (int i = 0; i < DataGridView.RowCount; i++) { array.Add(new object[] { i + 1, DataGridView.Rows[i].Cells[1].Value, DataGridView.Rows[i].Cells[2].Value, DataGridView.Rows[i].Cells[3].Value }); } } else if (@class.GetType().Equals(new Framework.Model.PlanMaterial().GetType())) { for (int i = 0; i < DataGridView.RowCount; i++) { if (DataGridView.Rows[i].Cells[0].Value != null) { FormatValue(DataGridView.Rows[i].Cells[1], 0); FormatValue(DataGridView.Rows[i].Cells[3], ""); FormatValue(DataGridView.Rows[i].Cells[4], ""); array.Add(new object[] { i + 1, DataGridView.Rows[i].Cells[0].Value, DataGridView.Rows[i].Cells[1].Value, DataGridView.Rows[i].Cells[2].Value, DataGridView.Rows[i].Cells[3].Value, DataGridView.Rows[i].Cells[4].Value }); } } } else if (@class.GetType().Equals(new Framework.Model.ManageMember().GetType())) { for (int i = 0; i < DataGridView.RowCount; i++) { if (DataGridView.Rows[i].Cells[0].Value.ToString().Equals("True")) { for (int j = 1; j < 6; j++) { FormatValue(DataGridView.Rows[i].Cells[j], ""); } array.Add(new object[] { i + 1, DataGridView.Rows[i].Cells[1].Value, DataGridView.Rows[i].Cells[2].Value, DataGridView.Rows[i].Cells[3].Value, DataGridView.Rows[i].Cells[4].Value, DataGridView.Rows[i].Cells[5].Value }); } } } else if (@class.GetType().Equals(new Framework.Model.PrepareMaterial().GetType())) { for (int i = 0; i < DataGridView.RowCount; i++) { array.Add(new object[] { i + 1, DataGridView.Rows[i].Cells[1].Value }); } } else if (@class.GetType().Equals(new Framework.Model.PrepareMachineTool().GetType())) { int MXindex = CbxType.SelectedIndex; array.Add(new object[] { 0, MXindex }); for (int i = 0; i < DataGridView.RowCount; i++) { array.Add(new object[] { i + 1, DataGridView.Rows[i].Cells[1].Value }); } } Framework.Class.ComboItem item = (Framework.Class.ComboItem)CbxType.SelectedItem; CreateModuleIntance((Framework.Entity.Template)item.Value, array, @class); this.Close(); }
public FrmClimateFeature(Framework.Entity.Chapter chapter, object type) { InitializeComponent(); @class = type; System.Collections.ArrayList templateList = contentService.GetContentTemplateByTitle(chapter.Title); foreach (Framework.Entity.Template template in templateList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = template.Title; item.Value = template; CbxType.Items.Add(item); } CbxType.SelectedIndex = 0; { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "ѡ�����"; colChoice.Width = 50; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colCity = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colCity.HeaderText = "����"; colCity.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colYearAvgTemp = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colYearAvgTemp.HeaderText = "��ƽ������"; colYearAvgTemp.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colColdestMonth = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colColdestMonth.HeaderText = "�����·�"; colColdestMonth.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colColdAvgTemp = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colColdAvgTemp.HeaderText = "����ƽ������"; colColdAvgTemp.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colHottestMonth = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colHottestMonth.HeaderText = "�����·�"; colHottestMonth.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colHotAvgTemp = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colHotAvgTemp.HeaderText = "����ƽ������"; colHotAvgTemp.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colAvgMonthPrecipitation = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colAvgMonthPrecipitation.HeaderText = "��ƽ����ˮ��"; colAvgMonthPrecipitation.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colSummerPrecipitationAccounts = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colSummerPrecipitationAccounts.HeaderText = "�ļ���ˮ��ռȫ�����"; colSummerPrecipitationAccounts.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colWinterConstruction = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colWinterConstruction.HeaderText = "����ʩ������"; colWinterConstruction.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRainConstruction = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRainConstruction.HeaderText = "����ʩ������"; colRainConstruction.Width = 100; DataGridView1.Columns.Add(colChoice); DataGridView1.Columns.Add(colCity); DataGridView1.Columns.Add(colYearAvgTemp); DataGridView1.Columns.Add(colColdestMonth); DataGridView1.Columns.Add(colColdAvgTemp); DataGridView1.Columns.Add(colHottestMonth); DataGridView1.Columns.Add(colHotAvgTemp); DataGridView1.Columns.Add(colAvgMonthPrecipitation); DataGridView1.Columns.Add(colSummerPrecipitationAccounts); DataGridView1.Columns.Add(colWinterConstruction); DataGridView1.Columns.Add(colRainConstruction); DataGridView1.Rows.Add(); object[] strCity = new object[] { "����", "���", "�Ϻ�", "����" }; string[] strYearAvgTemp = new string[] { "1��", "2��", "3��", "4��" }; string[] strColdestMonth = new string[] { "1��", "2��", "3��", "4��" }; string[] strColdAvgTemp = new string[] { "1��", "2��", "3��", "4��" }; string[] strHottestMonth = new string[] { "1��", "2��", "3��", "4��" }; string[] strHotAvgTemp = new string[] { "1��", "2��", "3��", "4��" }; string[] strAvgMonthPrecipitation = new string[] { "10ml", "20ml", "30ml", "40ml" }; string[] strSummerPrecipitationAccounts = new string[] { "10%", "20%", "30%", "40%" }; string[] strWinterConstruction = new string[] { "1��", "2��", "3��", "4��" }; string[] strRainConstruction = new string[] { "1��", "2��", "3��", "4��" }; for (int i = 0; i < strCity.Length; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)strCity[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView1.SelectedRows[0].Cells[1].Value = btnItem.Text; for (int j = 0; j < strCity.Length; j++) { if (btnItem.Text == strCity[j].ToString()) { DataGridView1.Rows[0].Cells[2].Value = strYearAvgTemp[j]; DataGridView1.Rows[0].Cells[3].Value = strColdestMonth[j]; DataGridView1.Rows[0].Cells[4].Value = strColdAvgTemp[j]; DataGridView1.Rows[0].Cells[5].Value = strHottestMonth[j]; DataGridView1.Rows[0].Cells[6].Value = strHotAvgTemp[j]; DataGridView1.Rows[0].Cells[7].Value = strAvgMonthPrecipitation[j]; DataGridView1.Rows[0].Cells[8].Value = strSummerPrecipitationAccounts[j]; DataGridView1.Rows[0].Cells[9].Value = strWinterConstruction[j]; DataGridView1.Rows[0].Cells[10].Value = strRainConstruction[j]; break; } } DataGridView1.Refresh(); }); colChoice.SubItems.Add(btnItem); } } }
public FrmConcreteProject(Framework.Entity.Chapter chapter, object type) { InitializeComponent(); @class = type; System.Collections.ArrayList templateList = contentService.GetContentTemplateByTitle(chapter.Title); foreach (Framework.Entity.Template template in templateList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = template.Title; item.Value = template; CbxType.Items.Add(item); } CbxType.SelectedIndex = 0; { #region /*劳动力准备*/ DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择工种"; colChoice.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colName.HeaderText = "工种名称"; colName.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colNumber = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colNumber.HeaderText = "每班人数"; colNumber.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRemarks = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRemarks.HeaderText = "备注"; colRemarks.Width = 309; object[,] machines = new object[, ] { { "班组长", "有较强施工组织能力,熟悉混凝土施工方法。" }, { "振捣手", "有振捣经验,持证上岗。" }, { "抹面", "必须是瓦工出身,有抹面经验,持证上岗。" }, { "接管", "有接管经验,操作熟练。" }, { "普工", "能够吃苦,不怕脏,听从指挥" } }; for (int i = 0; i < 5; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i, 0]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView1.SelectedRows[0].Cells[1].Value = btnItem.Text; switch (btnItem.Text) { case "班组长": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[0, 1]; break; case "振捣手": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[1, 1]; break; case "抹面": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[2, 1]; break; case "接管": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[3, 1]; break; case "普工": DataGridView1.SelectedRows[0].Cells[3].Value = (string)machines[4, 1]; break; } DataGridView1.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView1.Columns.Add(colChoice); DataGridView1.Columns.Add(colName); DataGridView1.Columns.Add(colNumber); DataGridView1.Columns.Add(colRemarks); #endregion } { #region/*机具准备 */ DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择机械"; colChoice.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colName.HeaderText = "机械名称"; colName.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colNumber = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colNumber.HeaderText = "数量"; colNumber.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colPower = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colPower.HeaderText = "功率(KW)"; colPower.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRemarks = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRemarks.HeaderText = "备注"; colRemarks.Width = 209; object[] machines2 = new object[] { "混凝土泵车", "环保型振动棒", "BL12布料杆", "架子车", "木抹", "铁抹刮杠", "线绳", "钢卷尺", "棕刷" }; for (int i = 0; i < 9; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines2[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView2.SelectedRows[0].Cells[1].Value = btnItem.Text; DataGridView2.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView2.Columns.Add(colChoice); DataGridView2.Columns.Add(colName); DataGridView2.Columns.Add(colNumber); DataGridView2.Columns.Add(colPower); DataGridView2.Columns.Add(colRemarks); #endregion } { #region/*混凝土原材料要求 */ DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择原材料"; colChoice.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colName.HeaderText = "原材料名称"; colName.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRemarks = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRemarks.HeaderText = "备注"; colRemarks.Width = 409; object[,] machines3 = new object[, ] { { "砂", "选用中粗砂,平均粒径不大于0.5mm,含泥量≤1%,对砂子的含石量、含水量在商砼生产厂家搅拌站进行现场取样实测,保证混凝土严格按照施工配合比施工。" }, { "石子", "选用砾石,要求含泥量≤1%,泥块含量≤0.5%,压碎指标值≤10,最大粒径与管径之比在1:3~1:4之间。" }, { "水泥", "采用普通硅酸盐水泥,水泥进场后立即取样送试,安定性合格后方可使用。" }, { "泵送剂", "进场泵送剂应具有出厂合格证及产品技术资料,并符合相应国家标准的要求,超过有效期或受潮的泵送剂不得使用。" }, { "粉煤灰", "选用Ⅱ级干排灰,进场材料必须出具出厂合格证" }, { "膨胀剂", "选用MEA,使混凝土得以补偿收缩,减少混凝土的收缩应力增强砼的防水能力。进场材料必须出具出厂合格证及厂家资质证书" }, { "水", "市政供水管网洁净自来水" } }; for (int i = 0; i < 7; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines3[i, 0]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView3.SelectedRows[0].Cells[1].Value = btnItem.Text; switch (btnItem.Text) { case "砂": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[0, 1]; break; case "石子": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[1, 1]; break; case "水泥": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[2, 1]; break; case "泵送剂": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[3, 1]; break; case "粉煤灰": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[4, 1]; break; case "膨胀剂": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[5, 1]; break; case "水": DataGridView3.SelectedRows[0].Cells[2].Value = (string)machines3[6, 1]; break; } DataGridView3.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView3.Columns.Add(colChoice); DataGridView3.Columns.Add(colName); DataGridView3.Columns.Add(colRemarks); #endregion } }
private void FrmChapter_Load(object sender, System.EventArgs e) { CbxState.Items.Add("启用"); CbxState.Items.Add("禁用"); CbxState.SelectedIndex = 0; System.Collections.ArrayList moduleList = authorityService.GetContentModule(); foreach (Framework.Entity.Module module in moduleList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = module.Title; item.Value = module.Id; CbxModule.Items.Add(item); } CbxModule.SelectedIndex = 0; Framework.Class.ComboItem defualtItem = new Framework.Class.ComboItem(); defualtItem.Text = "不使用模型"; defualtItem.Value = 0; CbxModel.Items.Add(defualtItem); System.Collections.ArrayList modelList = contentService.GetAllModel(); foreach (Framework.Entity.Model model in modelList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = model.Name; item.Value = model.Id; CbxModel.Items.Add(item); } CbxModel.SelectedIndex = 0; if (flag) { if (chapter.Pid != Framework.Entity.Chapter.ROOT) { Framework.Entity.Chapter pChapter = (Framework.Entity.Chapter)utilService.FindById(chapter, chapter.Pid); LbParent.Text = pChapter.Title; } else { LbParent.Text = "顶级"; } TbxName.Text = chapter.Title; TbxDescription.Text = chapter.Description; int index = 0; foreach (Framework.Entity.Module module in moduleList) { if (module.Id == chapter.Module) { CbxModule.SelectedIndex = index; } index++; } index = 0; foreach (Framework.Entity.Model model in modelList) { if (model.Id == chapter.Model) { CbxModel.SelectedIndex = index + 1; } index++; } switch (chapter.Type) { case 0: //基本类型 CbxBasicType.Checked = true; CbxSpecialType.Checked = false; break; case 1: //专项类型 CbxBasicType.Checked = false; CbxSpecialType.Checked = true; break; case 9: //所有类型 CbxBasicType.Checked = true; CbxSpecialType.Checked = true; break; default: CbxBasicType.Checked = true; CbxSpecialType.Checked = false; break; } CbxState.SelectedIndex = chapter.State; } else { if (chapter.Title != null) { LbParent.Text = chapter.Title; } switch (chapter.Type) { case 0: //基本类型 CbxBasicType.Checked = true; CbxSpecialType.Checked = false; break; case 1: //专项类型 CbxBasicType.Checked = false; CbxSpecialType.Checked = true; break; case 9: //所有类型 CbxBasicType.Checked = true; CbxSpecialType.Checked = true; break; default: CbxBasicType.Checked = true; CbxSpecialType.Checked = false; break; } } }
public FrmClimateFeature(Framework.Entity.Chapter chapter, object type) { InitializeComponent(); @class = type; System.Collections.ArrayList templateList = contentService.GetContentTemplateByTitle(chapter.Title); foreach (Framework.Entity.Template template in templateList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = template.Title; item.Value = template; CbxType.Items.Add(item); } CbxType.SelectedIndex = 0; { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择城市"; colChoice.Width = 50; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colCity = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colCity.HeaderText = "城市"; colCity.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colYearAvgTemp = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colYearAvgTemp.HeaderText = "年平均气温"; colYearAvgTemp.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colColdestMonth = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colColdestMonth.HeaderText = "最冷月份"; colColdestMonth.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colColdAvgTemp = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colColdAvgTemp.HeaderText = "冷月平均气温"; colColdAvgTemp.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colHottestMonth = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colHottestMonth.HeaderText = "最热月份"; colHottestMonth.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colHotAvgTemp = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colHotAvgTemp.HeaderText = "热月平均气温"; colHotAvgTemp.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colAvgMonthPrecipitation = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colAvgMonthPrecipitation.HeaderText = "月平均降水量"; colAvgMonthPrecipitation.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colSummerPrecipitationAccounts = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colSummerPrecipitationAccounts.HeaderText = "夏季降水量占全年比例"; colSummerPrecipitationAccounts.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colWinterConstruction = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colWinterConstruction.HeaderText = "冬期施工日期"; colWinterConstruction.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRainConstruction = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRainConstruction.HeaderText = "雨期施工日期"; colRainConstruction.Width = 100; DataGridView1.Columns.Add(colChoice); DataGridView1.Columns.Add(colCity); DataGridView1.Columns.Add(colYearAvgTemp); DataGridView1.Columns.Add(colColdestMonth); DataGridView1.Columns.Add(colColdAvgTemp); DataGridView1.Columns.Add(colHottestMonth); DataGridView1.Columns.Add(colHotAvgTemp); DataGridView1.Columns.Add(colAvgMonthPrecipitation); DataGridView1.Columns.Add(colSummerPrecipitationAccounts); DataGridView1.Columns.Add(colWinterConstruction); DataGridView1.Columns.Add(colRainConstruction); DataGridView1.Rows.Add(); object[] strCity = new object[] { "北京", "天津", "上海", "广州" }; string[] strYearAvgTemp = new string[] { "1℃", "2℃", "3℃", "4℃" }; string[] strColdestMonth = new string[] { "1月", "2月", "3月", "4月" }; string[] strColdAvgTemp = new string[] { "1℃", "2℃", "3℃", "4℃" }; string[] strHottestMonth = new string[] { "1月", "2月", "3月", "4月" }; string[] strHotAvgTemp = new string[] { "1℃", "2℃", "3℃", "4℃" }; string[] strAvgMonthPrecipitation = new string[] { "10ml", "20ml", "30ml", "40ml" }; string[] strSummerPrecipitationAccounts = new string[] { "10%", "20%", "30%", "40%" }; string[] strWinterConstruction = new string[] { "1月", "2月", "3月", "4月" }; string[] strRainConstruction = new string[] { "1月", "2月", "3月", "4月" }; for (int i = 0; i < strCity.Length; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)strCity[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView1.SelectedRows[0].Cells[1].Value = btnItem.Text; for (int j = 0; j < strCity.Length; j++) { if (btnItem.Text == strCity[j].ToString()) { DataGridView1.Rows[0].Cells[2].Value = strYearAvgTemp[j]; DataGridView1.Rows[0].Cells[3].Value = strColdestMonth[j]; DataGridView1.Rows[0].Cells[4].Value = strColdAvgTemp[j]; DataGridView1.Rows[0].Cells[5].Value = strHottestMonth[j]; DataGridView1.Rows[0].Cells[6].Value = strHotAvgTemp[j]; DataGridView1.Rows[0].Cells[7].Value = strAvgMonthPrecipitation[j]; DataGridView1.Rows[0].Cells[8].Value = strSummerPrecipitationAccounts[j]; DataGridView1.Rows[0].Cells[9].Value = strWinterConstruction[j]; DataGridView1.Rows[0].Cells[10].Value = strRainConstruction[j]; break; } } DataGridView1.Refresh(); }); colChoice.SubItems.Add(btnItem); } } }
private void BtnSubmit_Click(object sender, System.EventArgs e) { Framework.Class.ComboItem item = (Framework.Class.ComboItem)CbxType.SelectedItem; CreateModuleIntance(PropertyGrid.SelectedObject, (Framework.Entity.Template)item.Value); this.Close(); }
public FrmArrayList(Framework.Entity.Chapter chapter, object type) { InitializeComponent(); @class = type; System.Collections.ArrayList templateList = contentService.GetContentTemplateByTitle(chapter.Title); foreach (Framework.Entity.Template template in templateList) { Framework.Class.ComboItem item = new Framework.Class.ComboItem(); item.Text = template.Title; item.Value = template; CbxType.Items.Add(item); } CbxType.SelectedIndex = 0; if (@class.GetType().Equals(new Framework.Model.PlanLabor().GetType())) { System.Windows.Forms.DataGridViewCheckBoxColumn colState = new System.Windows.Forms.DataGridViewCheckBoxColumn(true); colState.ThreeState = false; colState.Width = 30; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colType = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colType.HeaderText = "工种"; colType.Width = 80; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colBase = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colBase.HeaderText = "基础施工阶段"; colBase.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colMain = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colMain.HeaderText = "主体施工阶段"; colMain.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colFitup = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colFitup.HeaderText = "基础施工阶段"; colFitup.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colLast = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colLast.HeaderText = "收尾阶段"; colLast.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colPrepare = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colPrepare.HeaderText = "准备阶段"; colPrepare.Width = 100; DataGridView.Columns.Add(colState); DataGridView.Columns.Add(colType); DataGridView.Columns.Add(colBase); DataGridView.Columns.Add(colMain); DataGridView.Columns.Add(colFitup); DataGridView.Columns.Add(colLast); DataGridView.Columns.Add(colPrepare); } else if (@class.GetType().Equals(new Framework.Model.PlanMachine().GetType())) { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择设备"; colChoice.Width = 70; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colName.HeaderText = "设备名称"; colName.Width = 180; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colType = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colType.HeaderText = "设备型号"; colType.Width = 180; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colFunction = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colFunction.HeaderText = "性能"; colFunction.Width = 180; object[,] machines = new object[,]{ {"塔吊",new string[]{"QTZ31.5&315-KN·m","QTZ40&400KN·m","QTZ50&500KN·m","QTZ63&630KN·m"}}, {"施工电梯",new string[]{"SCD200/200&100m/200m"}}, {"砼搅拌机",new string[]{"JDC350&350L/560L","JS500&500L/800L","JS75&750L/1200L"}}, {"挖掘机(反铲)",new string[]{"Atlas3306LC&31500&1.90","Atlas2606LC&25000&1.50","Atlas2006LC&18000&1.00","Atlas2306LC&22000&1.20","BonnyCE400-6&40000&2.00","BonnyCE650-6&66000&4.00"}} }; for (int i = 0; i < 4; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i, 0]; string[] types = (string[])machines[i, 1]; for (int j = 0; j < types.Length; j++) { DevComponents.DotNetBar.ButtonItem btnChildItem = new DevComponents.DotNetBar.ButtonItem(); string[] info = types[j].ToString().Split('&'); btnChildItem.Text = info[0]; btnChildItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DevComponents.DotNetBar.ButtonItem item = sender as DevComponents.DotNetBar.ButtonItem; DataGridView.SelectedRows[0].Cells[1].Value = item.Parent.Text; DataGridView.SelectedRows[0].Cells[2].Value = info[0]; DataGridView.SelectedRows[0].Cells[3].Value = info[1]; DataGridView.Refresh(); }); btnItem.SubItems.Add(btnChildItem); } colChoice.SubItems.Add(btnItem); } DataGridView.Columns.Add(colChoice); DataGridView.Columns.Add(colName); DataGridView.Columns.Add(colType); DataGridView.Columns.Add(colFunction); } else if (@class.GetType().Equals(new Framework.Model.PlanMaterial().GetType())) { // DevComponents.DotNetBar.Controls.DataGridViewComboBoxExColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewComboBoxExColumn(); System.Windows.Forms.DataGridViewComboBoxColumn colName = new System.Windows.Forms.DataGridViewComboBoxColumn(); colName.HeaderText = "材料名称"; colName.Width = 120; DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn colNumber = new DevComponents.DotNetBar.Controls.DataGridViewIntegerInputColumn(); colNumber.HeaderText = "进场数量"; colNumber.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colUnit = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colUnit.HeaderText = "单位"; colUnit.Width = 80; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colPlan = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colPlan.HeaderText = "进场计划"; colPlan.Width = 160; DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn colRemarks = new DevComponents.DotNetBar.Controls.DataGridViewTextBoxDropDownColumn(); colRemarks.HeaderText = "备注"; colRemarks.Width = 150; DataGridView.Columns.Add(colName); DataGridView.Columns.Add(colNumber); DataGridView.Columns.Add(colUnit); DataGridView.Columns.Add(colPlan); DataGridView.Columns.Add(colRemarks); } else if (@class.GetType().Equals(new Framework.Model.ManageMember().GetType())) { System.Windows.Forms.DataGridViewCheckBoxColumn colState = new System.Windows.Forms.DataGridViewCheckBoxColumn(true); colState.ThreeState = false; colState.Width = 30; System.Windows.Forms.DataGridViewTextBoxColumn colName = new System.Windows.Forms.DataGridViewTextBoxColumn(); colName.HeaderText = "姓名"; colName.Width = 100; DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn colWork = new DevComponents.DotNetBar.Controls.DataGridViewLabelXColumn(); colWork.HeaderText = "职务"; colWork.Width = 120; System.Windows.Forms.DataGridViewComboBoxColumn colTitle = new System.Windows.Forms.DataGridViewComboBoxColumn(); colTitle.HeaderText = "职称"; colTitle.Width = 120; colTitle.Items.Add("高级工程师"); colTitle.Items.Add("工程师"); colTitle.Items.Add("助理工程师"); colTitle.Items.Add("经济师"); colTitle.Items.Add("会计师"); System.Windows.Forms.DataGridViewTextBoxColumn colDuty = new System.Windows.Forms.DataGridViewTextBoxColumn(); colDuty.HeaderText = "工作责任"; colDuty.Width = 120; System.Windows.Forms.DataGridViewTextBoxColumn colRemarks = new System.Windows.Forms.DataGridViewTextBoxColumn(); colRemarks.HeaderText = "备注"; colRemarks.Width = 120; DataGridView.Columns.Add(colState); DataGridView.Columns.Add(colName); DataGridView.Columns.Add(colWork); DataGridView.Columns.Add(colTitle); DataGridView.Columns.Add(colDuty); DataGridView.Columns.Add(colRemarks); } else if (@class.GetType().Equals(new Framework.Model.PrepareMaterial().GetType())) { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择材料"; colChoice.Width = 150; DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn(); colName.HeaderText = "材料名称"; colName.Width = 460; object[] machines = new object[]{ "发泡陶瓷保温板" , "复合水泥发泡保温板", "加气混凝土板", "岩棉板(条)", "蓝海板", "其它"}; for (int i = 0; i < 6; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView.SelectedRows[0].Cells[1].Value = btnItem.Text; DataGridView.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView.Columns.Add(colChoice); DataGridView.Columns.Add(colName); } else if (@class.GetType().Equals(new Framework.Model.PrepareMachineTool().GetType())) { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择机具"; colChoice.Width = 150; DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn(); colName.HeaderText = "机具名称"; colName.Width = 460; object[] machines = new object[]{ "抹子","砂纸","2m靠尺","弹线墨盒","多用刀","铲刀","阴阳角抿子","电动搅拌机","角磨机","其它"}; for (int i = 0; i < 10; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView.SelectedRows[0].Cells[1].Value = btnItem.Text; DataGridView.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView.Columns.Add(colChoice); DataGridView.Columns.Add(colName); } else if (@class.GetType().Equals(new Framework.Model.PrepareMaterial().GetType())) { DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn colChoice = new DevComponents.DotNetBar.Controls.DataGridViewButtonXColumn(); colChoice.HeaderText = "选择屋面做法"; colChoice.Width = 150; DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn colName = new DevComponents.DotNetBar.Controls.DataGridViewMaskedTextBoxAdvColumn(); colName.HeaderText = "屋面做法"; colName.Width = 460; object[] machines = new object[]{ "发泡陶瓷保温板" , "复合水泥发泡保温板", "加气混凝土板", "岩棉板(条)", "蓝海板", "其它"}; for (int i = 0; i < 6; i++) { DevComponents.DotNetBar.ButtonItem btnItem = new DevComponents.DotNetBar.ButtonItem(); btnItem.Text = (string)machines[i]; btnItem.Click += new System.EventHandler(delegate(object sender, System.EventArgs args) { DataGridView.SelectedRows[0].Cells[1].Value = btnItem.Text; DataGridView.Refresh(); }); colChoice.SubItems.Add(btnItem); } DataGridView.Columns.Add(colChoice); DataGridView.Columns.Add(colName); } }