| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.SaleOrder.ReviewForm
- {
- public partial class frmCraftSplineUnit : FrmBase
- {
- UltraGrid grid1 = null;
- public frmCraftSplineUnit()
- {
- InitializeComponent();
- //UltraGrid grid = (UltraGrid)c_UltraGrid1;
- ////this.Controls.Remove(c_UltraGrid1);
- //grid1 = new UltraGrid();
- //this.Controls.Add(grid1);
- ////this.panel1.Controls.Add(grid);
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query":
- Query();
- break;
- case "Save":
- Save();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private void Query()
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CraftSplineUnit.query", null, ob);
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- }
- private void Save()
- {
- ArrayList list = new ArrayList();
- var rows = ultraGrid1.Rows.Where(a => a.GetValue("CHK") == "True");
- if (rows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择一条记录保存!");
- return;
- }
- foreach(var row in rows)
- {
- list.Add(row.GetValue("UNIT_CODE"));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认保存") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- ServerHelper.SetData("com.steering.pss.sale.order.CraftSplineUnit.save", new object[]{list}, ob);
- MessageUtil.ShowTips("保存成功!");
- }
- private void frmCraftSplineUnit_Load(object sender, EventArgs e)
- {
- //c_UltraGrid1.DisplayLayout.CopyFrom(ultraGrid1.DisplayLayout, PropertyCategories.All);
- try
- {
- this.Cursor = Cursors.WaitCursor;
- Query();
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
-
- }
- private void frmCraftSplineUnit_Shown(object sender, EventArgs e)
- {
- }
- private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
- {
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- ultraGrid1.UpdateData();
- if (e.Cell.Column.Key == "CHK")
- {
- UltraGridRow chkRow = e.Cell.Row;
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- if (row.Cells["CHK"].Value.ToString() == "True" && row != chkRow)
- {
- row.Cells["CHK"].Value = "False";
- row.Update();
- }
- }
- }
- }
- }
- }
|