Exemplo n.º 1
0
        private void SalesOrderPopup_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
        {
            TargetViewId = "SOHeader_NewSO";
            IObjectSpace objectSpace = Application.CreateObjectSpace();
            SOHeader     newOrder    = objectSpace.CreateObject <SOHeader>();

            newOrder.CustomerNumber   = objectSpace.GetObject <Customer>((Customer)View.CurrentObject);
            newOrder.SalesRep         = newOrder.CustomerNumber.SalesRep;
            newOrder.SalesOrderDate   = DateTime.Now;
            newOrder.SOStatus         = SalesOrderStatus.New;
            newOrder.ShippingType     = newOrder.CustomerNumber.ShippingType;
            newOrder.SalesOrderNumber = "test0001";
            if (newOrder.ShippingType == null)
            {
                newOrder.ShippingType = ApplicationOptions.getDefaultShippingType(objectSpace);
            }

            e.View         = Application.CreateDetailView(objectSpace, TargetViewId, true, newOrder);
            e.View.Caption = e.View.Caption + " - " + newOrder.CustomerNumber.CustomerName;
        }