using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System; using System.Collections; using System.Data; using System.Windows.Forms; namespace Core.StlMes.Client.Qcm { class DtMscBl : DtBaseQcm { private CtrlMscBl _ctrlMscBl; private UltraGridRow[] _rows; public DtMscBl(CtrlMscBl ctrlMscBl) { _ctrlMscBl = ctrlMscBl; RegistQuery(Query, "DefaultQuery"); RegistAction(Add, ActionType.Add); RegistAction(Modify, ActionType.Modify); RegistAction(Save, ActionType.Save); RegistAction(Delete, ActionType.Delete); RegistAction(Resume, ActionType.Resume); RegistAction(SubMitAudit, ActionType.SubMitAudit); RegistAction(Audit, ActionType.Audit); RegistAction(Group, ActionType.Group); } protected void Query() { FrmProPSCMSC2 frm = _ctrlMscBl.FrmProPscMsc2; UltraGrid gridMsc = frm.ControlMsc.GridMsc; CheckBox checkBox = frm.ckbDeleteFilter; if (gridMsc.ActiveRow == null) return; string msc = frm.ControlMsc.MscRow.Cells["MSC"].Value.ToString(); ArrayList list = new ArrayList(); list.Add(msc); DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.queryWithMsc", new Object[] { list }, frm.ob); GridHelper.CopyDataToDatatable(dt, _ctrlMscBl.DataTableBl, true); GridHelper.RefreshAndAutoSize(_ctrlMscBl.GridBl); } protected bool Add() { throw new NotImplementedException(); } protected bool Group() { FrmProPSCMSC2 frm = _ctrlMscBl.FrmProPscMsc2; ArrayList list = new ArrayList(); PopupGroup popupGroup = new PopupGroup(); if (popupGroup.ShowDialog() == DialogResult.OK) { foreach (UltraGridRow row in _rows) { ArrayList listSub = new ArrayList(); listSub.Add(popupGroup.NumGroupNum.Value.ToString()); listSub.Add(row.Cells["MSC"].Value.ToString()); listSub.Add(row.Cells["PSC_BL"].Value.ToString()); list.Add(listSub); } ServerHelper.SetData("com.steering.pss.qcm.BLCodeManage.group", new object[] { list }, frm.ob); } else { return false; } return true; } protected bool Modify() { throw new NotImplementedException(); } protected bool Save() { throw new NotImplementedException(); } protected bool Delete() { throw new NotImplementedException(); } protected bool Resume() { throw new NotImplementedException(); } protected bool SubMitAudit() { throw new NotImplementedException(); } protected bool Audit() { throw new NotImplementedException(); } protected override bool CheckData(ActionType actionType, out ArrayList parm, out string msg) { msg = ""; parm = new ArrayList(); UltraGrid gridMsc = _ctrlMscBl.FrmProPscMsc2.ControlMsc.GridMsc; if (gridMsc.ActiveRow == null) { msg = "请先维护冶金规范,然后再进行操作!"; return false; } return true; } protected ArrayList[] GetParms(ActionType actionType) { return new ArrayList[1]; } protected override bool IsSelectData(ActionType actionType, out string msg) { msg = ""; _rows = GridHelper.GetRowsWithKey(_ctrlMscBl.GridBl, new string[] { "CHK" }, new string[] { "True" }); if (_rows.Length == 0) { return false; } return true; } private static DataTable GetMscTabByMsc(string msc, OpeBase ob) { DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.CoreFrmProPSCMSC2.getComMscByMsc", new object[] { msc }, ob); return dt; } } }