private void PTB_Execute(object sender, PopupWindowShowActionExecuteEventArgs e) { e.PopupWindow.View.ObjectSpace.CommitChanges(); IObjectSpace objectSpace = Application.CreateObjectSpace(); ItemPTB currentPTBChange = objectSpace.GetObject <ItemPTB>((ItemPTB)e.PopupWindowViewCurrentObject); currentPTBChange.ItemNumber.CurrentPTB = currentPTBChange.PTB; currentPTBChange.Save(); objectSpace.CommitChanges(); View.ObjectSpace.Refresh(); View.Refresh(); // item.MinPrice = e.PopupWindow.View<ItemMinHistory>.CurrentObject.ItemMin; MessageOptions options = new MessageOptions(); options.Duration = 20000; options.Message = string.Format("PTB has been changed for Item: {0} to {1}", currentPTBChange.ItemNumber.ItemNumber, currentPTBChange.PTB.ToString()); options.Type = InformationType.Success; options.Web.Position = InformationPosition.Right; options.Win.Caption = "Success"; options.Win.Type = WinMessageType.Alert; options.Duration = 10000; Application.ShowViewStrategy.ShowMessage(options); }
private void Ptb_popWindowParms_execute(object sender, CustomizePopupWindowParamsEventArgs e) { TargetViewId = "ItemPTB_Maint"; IObjectSpace objectSpace = Application.CreateObjectSpace(); ItemPTB newPTB = objectSpace.CreateObject <ItemPTB>(); newPTB.ItemNumber = objectSpace.GetObject <Items>((Items)View.CurrentObject); // newPTB.Employee = Employee.CurrentUserId; newPTB.CreatedDate = DateTime.Now; newPTB.PTB = newPTB.ItemNumber.CurrentPTB; e.View = Application.CreateDetailView(objectSpace, TargetViewId, true, newPTB); e.View.Caption = "PTB Maint - " + newPTB.ItemNumber.ItemNumber; e.Maximized = false; e.IsSizeable = true; }