using System; using System.Windows; using System.Data; using SSWMS.Common; namespace SSWMS.Client { public partial class STORAGE_DELETE : AvalonDock.DocumentContent { public STORAGE_DELETE() { InitializeComponent(); DocumentContent_Loaded(null, null); } private void DocumentContent_Loaded(object sender, RoutedEventArgs e) { this.ucQueryStorage.U_Query += new UC.ucQuickQuery.U_QueryEventHandler((sQueryWhere) => { this.ucGridStorage.U_AppendWhere = sQueryWhere; this.ucGridStorage.U_InitControl(); }); this.ucQueryStorage.U_WindowName = "COMMON"; this.ucQueryStorage.U_XmlTableName = "V_STORAGE_LIST"; this.ucQueryStorage.U_InitControl(); this.ucGridStorage.U_WindowName = "COMMON"; this.ucGridStorage.U_XmlTableName = "V_STORAGE_LIST"; this.ucGridStorage.U_TableName = "V_STORAGE_LIST"; this.ucGridStorage.U_OrderField = "STORAGE_ID,STORAGE_LIST_ID"; this.ucGridStorage.U_AllowOperatData = false; this.ucGridStorage.U_AllowChecked = true; this.ucGridStorage.U_InitControl(); } private void Refresh() { this.ucQueryStorage.U_InitControl(); this.ucGridStorage.U_AppendWhere = string.Empty; this.ucGridStorage.U_InitControl(); } private void bSave_Click(object sender, RoutedEventArgs e) { try { DataRowView[] drvArray = this.ucGridStorage.U_GetCheckDataRow(); if (drvArray.Length == 0) { MessageDialog.ShowException("请选择库存"); return; } if (MessageDialog.ShowDialog("确认执行删除操作")) { bool bResult = true; string sResult = string.Empty; string sSingleResult = string.Empty; foreach (DataRowView drv in drvArray) { if (WCFChannel._I_StorageService.DeleteStorage(Convert.ToInt32(drv["STORAGE_ID"]), Convert.ToInt32(drv["STORAGE_LIST_ID"]), MainApp._USER.USER_NAME, out sSingleResult)) { sResult += String.Format("\n托盘条码 {0} 删除成功", drv["STOCK_BARCODE"].ToString()); } else { bResult = false; sResult += String.Format("\n托盘条码 {0} 删除失败 {1}", drv["STOCK_BARCODE"].ToString(), sSingleResult); } } this.Refresh(); MessageDialog.ShowResult(bResult, sResult); } } catch (Exception ex) { MessageDialog.ShowException(ex); } } private void bRefresh_Click(object sender, RoutedEventArgs e) { this.Refresh(); } } }