public frmPartNumberConfig(UserInformation userInformation, System.Windows.Window window, int entityPrimaryKey, OperationMode operationMode, string title = "Part Number Configuration") { try { InitializeComponent(); CustPartNoDescription.Focus(); PartNumberCode = entityPrimaryKey; PartNumberConfigViewModel vm = new PartNumberConfigViewModel(userInformation, PartNumberCode, operationMode); this.DataContext = vm; window.Closing += vm.CloseMethodWindow; if (vm.CloseAction == null && window.IsNotNullOrEmpty()) { vm.CloseAction = new Action(() => window.Close()); } bll = new PartNumberConfiguration(userInformation); List <ProcessDesigner.Model.V_TABLE_DESCRIPTION> lstTableDescription = bll.GetTableColumnsSize("PartNumberConfig"); this.SetColumnLength <TextBox>(lstTableDescription); } catch (Exception ex) { throw ex.LogException(); } }
public frmPartNumberConfig(UserInformation userInformation, WPF.MDI.MdiChild mdiChild) { try { InitializeComponent(); CustPartNoDescription.Focus(); PartNumberCode = 0; PartNumberConfigViewModel vm = new PartNumberConfigViewModel(userInformation, PartNumberCode, OperationMode.AddNew); this.DataContext = vm; mdiChild.Closing += vm.CloseMethod; if (vm.CloseAction == null) { vm.CloseAction = new Action(() => mdiChild.Close()); } bll = new PartNumberConfiguration(userInformation); List <ProcessDesigner.Model.V_TABLE_DESCRIPTION> lstTableDescription = bll.GetTableColumnsSize("PartNumberConfig"); this.SetColumnLength <TextBox>(lstTableDescription); } catch (Exception ex) { throw ex.LogException(); } }