using System; using System.Windows; using System.Data; using SSWMS.Common; using System.Collections.Generic; namespace SSWMS.Client { public partial class RECORD_INTERFACE : AvalonDock.DocumentContent { public RECORD_INTERFACE() { InitializeComponent(); DocumentContent_Loaded(null, null); } private void DocumentContent_Loaded(object sender, RoutedEventArgs e) { try { this.ucRecord.dgData.U_WindowName = "COMMON"; this.ucRecord.dgData.U_XmlTableName = "V_RECORD_INTERFACE"; this.ucRecord.dgData.U_TableName = "V_RECORD_INTERFACE"; this.ucRecord.dgData.U_OrderField = "RECORD_LIST_ID"; this.ucRecord.dgData.U_AllowOperatData = false; this.ucRecord.dgData.U_AllowChecked = true; this.ucRecord.U_InitControl(); } catch (Exception ex) { MessageDialog.ShowException(ex); } } private void bInterface_Click(object sender, RoutedEventArgs e) { try { DataRowView[] drvArray = this.ucRecord.dgData.U_GetCheckDataRow(); if (drvArray.Length == 0) { MessageDialog.ShowException("请选择库存"); return; } if (MessageDialog.ShowDialog($"确认执行调用接口")) { List lRecordID = new List(); foreach (DataRowView drv in drvArray) { int iRecordID = Convert.ToInt32(drv["RECORD_ID"]); if (!lRecordID.Contains(iRecordID)) { lRecordID.Add(iRecordID); } } string sResult = string.Empty; bool bResult = WCFChannel._I_ManageService.RecordInterface(lRecordID, MainApp._USER.USER_NAME, out sResult); if (bResult) { //this.bRefresh_Click(null, null); this.ucRecord.U_InitControlData(); } MessageDialog.ShowResult(bResult, sResult); } } catch (Exception ex) { MessageDialog.ShowException(ex); } } private void bComplete_Click(object sender, RoutedEventArgs e) { try { DataRowView[] drvArray = this.ucRecord.dgData.U_GetCheckDataRow(); if (drvArray.Length == 0) { MessageDialog.ShowException("请选择库存"); return; } if (MessageDialog.ShowDialog($"确认执行异常完成")) { List lRecordID = new List(); foreach (DataRowView drv in drvArray) { int iRecordID = Convert.ToInt32(drv["RECORD_ID"]); if (!lRecordID.Contains(iRecordID)) { lRecordID.Add(iRecordID); } } string sResult = string.Empty; bool bResult = WCFChannel._I_ManageService.RecordComplete(lRecordID, MainApp._USER.USER_NAME, out sResult); if (bResult) { //this.bRefresh_Click(null, null); this.ucRecord.U_InitControlData(); } MessageDialog.ShowResult(bResult, sResult); } } catch (Exception ex) { MessageDialog.ShowException(ex); } } private void bRefresh_Click(object sender, RoutedEventArgs e) { this.ucRecord.U_InitControl(); } } }