| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Core.Mes.Client.Comm.Control;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.StlMes.Client.Plan.Order.JGGXPln
- {
- public partial class ComPlineTimeCtrl : UserControl
- {
- private ComPlineTimeBLL plineTimeBLL;
- /// <summary>
- /// 小时能力(t/h)
- /// </summary>
- double hrCapcty = 0;
- /// <summary>
- /// 产线代码
- /// </summary>
- private string plinecode = "";
- /// <summary>
- /// 产线描述
- /// </summary>
- private string plinename = "";
- public ComPlineTimeCtrl()
- {
- InitializeComponent();
- }
- public ComPlineTimeCtrl(System.Windows.Forms.Control container, OpeBase ob)
- {
- InitializeComponent();
- plineTimeBLL = new ComPlineTimeBLL(ob);
- container.Container.Add(this);
- this.Dock = DockStyle.Fill;
- }
- public void ComBLL(OpeBase ob)
- {
- plineTimeBLL = new ComPlineTimeBLL(ob);
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="inMaterialNo"></param>
- /// <param name="outMaterialNo"></param>
- public void Query(string inMaterialNo, string outMaterialNo)
- {
- DataTable dt = plineTimeBLL.Query(inMaterialNo, outMaterialNo);
- GridHelper.CopyDataToDatatable(dt, dataTablePline, true);
- PlanComm.setGridActivation(ultraGridPline.DisplayLayout.Bands[0], "CHC");
- }
- /// <summary>
- /// 设置勾选的产线
- /// </summary>
- public void setPline(string codePl)
- {
- ultraGridPline.UpdateData();
- IQueryable<UltraGridRow> chRow = ultraGridPline.Rows.AsQueryable().Where("PLINE_CODE = '" + codePl + "'");
- if (chRow.Count() == 1)
- {
- UltraGridRow uRow = chRow.First<UltraGridRow>();
- uRow.Cells["CHC"].Value = true;
- plinecode = uRow.Cells["PLINE_CODE"].Value.ToString();
- plinename = uRow.Cells["PLINE_NAME"].Value.ToString();
- double.TryParse(uRow.Cells["HR_CAPCTY"].Value.ToString(), out hrCapcty);
- }
- }
- private void ultraGridPline_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- if (e.Cell.Column.Key.Equals("CHC"))
- {
- if (Convert.ToBoolean(e.Cell.Row.Cells["CHC"].Text))
- {
- plinecode = e.Cell.Row.Cells["PLINE_CODE"].Value.ToString();
- plinename = e.Cell.Row.Cells["PLINE_NAME"].Value.ToString();
- double.TryParse(e.Cell.Row.Cells["HR_CAPCTY"].Value.ToString(), out hrCapcty);
- foreach (UltraGridRow uRow in ultraGridPline.Rows)
- {
- if (uRow != e.Cell.Row)
- {
- uRow.Cells["CHC"].Value = false;
- }
- }
- }
- else
- {
- e.Cell.Row.Cells["CHC"].Value = true;
- }
- }
- }
- /// <summary>
- /// 小时能力(t/h)
- /// </summary>
- public double HrCapcty
- {
- get { return hrCapcty; }
- set { hrCapcty = value; }
- }
- /// <summary>
- /// 产线代码
- /// </summary>
- public string Plinecode
- {
- get { return plinecode; }
- set { plinecode = value; }
- }
- /// <summary>
- /// 产线描述
- /// </summary>
- public string Plinename
- {
- get { return plinename; }
- set { plinename = value; }
- }
- /// <summary>
- /// 生产时间
- /// </summary>
- public System.Windows.Forms.DateTimePicker DateTimeProdu
- {
- get { return dateTimeProdu; }
- set { dateTimeProdu = value; }
- }
- /// <summary>
- /// 获取Grid
- /// </summary>
- public Infragistics.Win.UltraWinGrid.UltraGrid UltraGridPline
- {
- get { return ultraGridPline; }
- }
- }
- }
|