private void ShowEditWindow() { String caption = ItemText; if (dt == InventoryDocumentType.InvDocImport) { WinAddEditImportItem w = new WinAddEditImportItem(dt); w.ViewData = (MInventoryTransactionImport)currentViewObj; w.Caption = CLanguage.getValue("edit") + " " + caption; w.Mode = "E"; w.ShowDialog(); if (w.HasModified) { vw.IsModified = true; } } else if ((dt == InventoryDocumentType.InvDocExport) || (dt == InventoryDocumentType.InvDocXfer)) { WinAddEditExportItem w = new WinAddEditExportItem(dt); w.ViewData = currentViewObj; w.LocationObj = (vw as MInventoryDoc).LocationObj; w.Caption = CLanguage.getValue("edit") + " " + caption; w.Mode = "E"; w.ShowDialog(); if (w.HasModified) { vw.IsModified = true; } } else if ((dt == InventoryDocumentType.InvDocAdjust) && adjustByDelta) { WinAddEditAdjustItem w = new WinAddEditAdjustItem(dt); w.ViewData = currentViewObj; w.Caption = CLanguage.getValue("edit") + " " + caption; w.Mode = "E"; w.ShowDialog(); if (w.HasModified) { vw.IsModified = true; } } }
private void cmdAdd_Click(object sender, RoutedEventArgs e) { String caption = ItemText; if (dt == InventoryDocumentType.InvDocImport) { WinAddEditImportItem w = new WinAddEditImportItem(dt); w.Caption = (String)(sender as Button).Content + " " + caption; w.Mode = "A"; w.ParentView = (vw as MInventoryDoc); w.ShowDialog(); if (w.HasModified) { vw.IsModified = true; } } else if ((dt == InventoryDocumentType.InvDocExport) || (dt == InventoryDocumentType.InvDocXfer)) { WinAddEditExportItem w = new WinAddEditExportItem(dt); w.Caption = (String)(sender as Button).Content + " " + caption; w.DocumentDate = (vw as MInventoryDoc).DocumentDate; w.LocationObj = (vw as MInventoryDoc).LocationObj; w.Mode = "A"; w.ParentView = (vw as MInventoryDoc); w.ShowDialog(); if (w.HasModified) { vw.IsModified = true; } } else if ((dt == InventoryDocumentType.InvDocAdjust) && adjustByDelta) { WinAddEditAdjustItem w = new WinAddEditAdjustItem(dt); w.Caption = (String)(sender as Button).Content + " " + caption; w.Mode = "A"; w.ParentView = (vw as MInventoryDoc); w.ShowDialog(); if (w.HasModified) { vw.IsModified = true; } } }