void SOProcesser_Loaded(object sender, RoutedEventArgs e) { CommonDataFacade = new CommonDataFacade(Page); SOInternalMemoFacade = new Facades.SOInternalMemoFacade(Page); SOQueryFacade = new SOQueryFacade(Page); SOFacade = new SOFacade(Page); LoadPage(); }
private void btnBatchAbandon_Click(object sender, RoutedEventArgs e) { List <int> list = new List <int>(); var dynamic = this.dataGridList.ItemsSource as dynamic; if (dynamic != null) { foreach (var item in dynamic) { if (item.IsCheck == true) { list.Add((int)item["SysNo"]); } } } if (list.Count == 0) { this.Window.Alert(ResSO.Msg_PleaseSelect); return; } Window.Confirm(ResSO.Info_AbandonConfirm, (s, confirmEvent) => { if (confirmEvent.DialogResult == DialogResultType.OK) { UCReasonCodePicker content = new UCReasonCodePicker(); content.ReasonCodeType = ReasonCodeType.Order; content.Dialog = Window.ShowDialog(ResSOMaintain.Info_SOMaintain_AbandSO, content, (obj, args) => { if (args.Data != null) { KeyValuePair <string, string> data = (KeyValuePair <string, string>)args.Data; (new SOFacade(this.Page)).AbandonSO(list, false, (vm) => { if (vm != null) { SOInternalMemoFacade SOInternalMemoFacade = new SOInternalMemoFacade(); for (int i = 0; i < list.Count; i++) { SOInternalMemoFacade.Create(new SOInternalMemoInfo { SOSysNo = list[i], Content = data.Value, LogTime = DateTime.Now, ReasonCodeSysNo = int.Parse(data.Key), CompanyCode = CPApplication.Current.CompanyCode, Status = SOInternalMemoStatus.FollowUp }, null); } Bind(); Window.Alert(ResSOMaintain.Info_SOMaintain_SO_Abanded, MessageType.Information); } }); } }); } }); }
public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); m_commonFacade = new CommonDataFacade(this); m_facade = new SOInternalMemoFacade(this); spConditions.DataContext = m_query = new SOInternalMemoQueryFilter(); IniPageData(); }