| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 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;
- using Core.Mes.Client.Comm.Tool;
- namespace Core.StlMes.Client.SaleOrder.ReviewForm
- {
- public partial class FrmOrderPrdcrBack : FrmBase
- {
- public FrmOrderPrdcrBack()
- {
- InitializeComponent();
- }
- private DataTable dt = new DataTable();
- public DataTable Dt
- {
- get { return dt; }
- set { dt = value; }
- }
- private void FrmOrderPrdcrBack_Load(object sender, EventArgs e)
- {
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "Confirm":
- Confirm();
- break;
- case "Close":
- ExitForm();
- break;
- }
- }
- private void Confirm()
- {
- ultraGrid1.UpdateData();
- if (HasFailRsn())
- {
- MessageUtil.ShowWarning("请将回退原因维护完整!");
- return;
- }
- this.Dt = dataTable1;
- this.DialogResult = DialogResult.OK;
- }
- private void ExitForm()
- {
- this.Close();
- }
- /// <summary>
- /// 是否存在失败原因 True 存在 False 未填入
- /// </summary>
- /// <returns></returns>
- private bool HasFailRsn()
- {
- ultraGrid1.UpdateData();
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- if (row.Cells["FAIL_RSN"].Value.ToString() == "")
- {
- return true;
- }
- }
- return false;
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugr = ultraGrid1.ActiveRow;
- if (ugr == null)
- return;
- for (int i = 0; i < ugr.Cells.Count; i++)
- {
- if (!ugr.Cells[i].Column.Key.Equals("FAIL_RSN"))
- ugr.Cells[i].Activation = Activation.ActivateOnly;
- }
- }
- }
- }
|