private void newOrderToolStripMenuItem_Click(object sender, EventArgs e) { var order = new SalesOrderHeaderEntity { CustomerID = 17018, ContactID = 4975, BillToAddressID = 14810, ShipToAddressID = 14810 }; ((FrmMain)MdiParent).LaunchChildForm(typeof(SalesOrderHeaderEntity), order); }
/// <summary> setups the sync logic for member _salesOrderHeader</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncSalesOrderHeader(IEntityCore relatedEntity) { if (_salesOrderHeader != relatedEntity) { DesetupSyncSalesOrderHeader(true, true); _salesOrderHeader = (SalesOrderHeaderEntity)relatedEntity; this.PerformSetupSyncRelatedEntity(_salesOrderHeader, new PropertyChangedEventHandler(OnSalesOrderHeaderPropertyChanged), "SalesOrderHeader", AdventureWorks.Dal.Adapter.v50.RelationClasses.StaticSalesOrderHeaderSalesReasonRelations.SalesOrderHeaderEntityUsingSalesOrderIdStatic, true, new string[] { }); } }
protected SalesOrderHeaderSalesReasonEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _salesOrderHeader = (SalesOrderHeaderEntity)info.GetValue("_salesOrderHeader", typeof(SalesOrderHeaderEntity)); if (_salesOrderHeader != null) { _salesOrderHeader.AfterSave += new EventHandler(OnEntityAfterSave); } _salesReason = (SalesReasonEntity)info.GetValue("_salesReason", typeof(SalesReasonEntity)); if (_salesReason != null) { _salesReason.AfterSave += new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Removes the sync logic for member _salesOrderHeader</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncSalesOrderHeader(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity(_salesOrderHeader, new PropertyChangedEventHandler(OnSalesOrderHeaderPropertyChanged), "SalesOrderHeader", AdventureWorks.Dal.Adapter.v50.RelationClasses.StaticSalesOrderHeaderSalesReasonRelations.SalesOrderHeaderEntityUsingSalesOrderIdStatic, true, signalRelatedEntity, "SalesOrderHeaderSalesReasons", resetFKFields, new int[] { (int)SalesOrderHeaderSalesReasonFieldIndex.SalesOrderId }); _salesOrderHeader = null; }
public FrmOrderEdit(SalesOrderHeaderEntity order) : this() { _order = order; }
/// <summary> /// Gets the related customer view of SalesOrder 46117. Example 5.27 pg63. /// </summary> /// <returns></returns> /// <remarks> /// SELECT [SALES].[SALESORDERHEADER].[SALESORDERID] AS [SALESORDERID], /// [SALES].[SALESORDERHEADER].[REVISIONNUMBER], /// [SALES].[SALESORDERHEADER].[ORDERDATE], /// [SALES].[SALESORDERHEADER].[DUEDATE], /// [SALES].[SALESORDERHEADER].[SHIPDATE], /// [SALES].[SALESORDERHEADER].[STATUS], /// [SALES].[SALESORDERHEADER].[ONLINEORDERFLAG], /// [SALES].[SALESORDERHEADER].[SALESORDERNUMBER], /// [SALES].[SALESORDERHEADER].[PURCHASEORDERNUMBER], /// [SALES].[SALESORDERHEADER].[ACCOUNTNUMBER], /// [SALES].[SALESORDERHEADER].[CustomerID] AS [CustomerID], /// [SALES].[SALESORDERHEADER].[CONTACTID] AS [CONTACTID], /// [SALES].[SALESORDERHEADER].[SALESPERSONID] AS [SALESPERSONID], /// [SALES].[SALESORDERHEADER].[TERRITORYID] AS [TERRITORYID], /// [SALES].[SALESORDERHEADER].[BILLTOADDRESSID] AS [BILLTOADDRESSID], /// [SALES].[SALESORDERHEADER].[SHIPTOADDRESSID] AS [SHIPTOADDRESSID], /// [SALES].[SALESORDERHEADER].[SHIPMETHODID] AS [SHIPMETHODID], /// [SALES].[SALESORDERHEADER].[CREDITCARDID] AS [CREDITCARDID], /// [SALES].[SALESORDERHEADER].[CREDITCARDAPPROVALCODE], /// [SALES].[SALESORDERHEADER].[CURRENCYRATEID] AS [CURRENCYRATEID], /// [SALES].[SALESORDERHEADER].[SUBTOTAL], /// [SALES].[SALESORDERHEADER].[TAXAMT], /// [SALES].[SALESORDERHEADER].[FREIGHT], /// [SALES].[SALESORDERHEADER].[TOTALDUE], /// [SALES].[SALESORDERHEADER].[COMMENT], /// [SALES].[SALESORDERHEADER].[ROWGUID] AS [ROWGUID], /// [SALES].[SALESORDERHEADER].[MODIFIEDDATE] /// FROM [SALES].[SALESORDERHEADER] /// WHERE (([SALES].[SALESORDERHEADER].[SALESORDERID] = @SalesOrderId1)) /// . /// SELECT [SALES].[VINDIVIDUALCUSTOMER].[CustomerID] AS [CustomerID], /// [SALES].[VINDIVIDUALCUSTOMER].[TITLE], /// [SALES].[VINDIVIDUALCUSTOMER].[FIRSTNAME], /// [SALES].[VINDIVIDUALCUSTOMER].[MIDDLENAME], /// [SALES].[VINDIVIDUALCUSTOMER].[LASTNAME], /// [SALES].[VINDIVIDUALCUSTOMER].[SUFFIX], /// [SALES].[VINDIVIDUALCUSTOMER].[PHONE], /// [SALES].[VINDIVIDUALCUSTOMER].[EMAILADDRESS], /// [SALES].[VINDIVIDUALCUSTOMER].[EMAILPROMOTION], /// [SALES].[VINDIVIDUALCUSTOMER].[ADDRESSTYPE], /// [SALES].[VINDIVIDUALCUSTOMER].[ADDRESSLINE1], /// [SALES].[VINDIVIDUALCUSTOMER].[ADDRESSLINE2], /// [SALES].[VINDIVIDUALCUSTOMER].[CITY], /// [SALES].[VINDIVIDUALCUSTOMER].[STATEPROVINCENAME], /// [SALES].[VINDIVIDUALCUSTOMER].[POSTALCODE], /// [SALES].[VINDIVIDUALCUSTOMER].[COUNTRYREGIONNAME], /// [SALES].[VINDIVIDUALCUSTOMER].[DEMOGRAPHICS] /// FROM [SALES].[VINDIVIDUALCUSTOMER] /// WHERE (([SALES].[VINDIVIDUALCUSTOMER].[CustomerID] = @CustomerID1)) /// </remarks> public static CustomerViewRelatedEntity GetCustomerViewRelatedCollection() { var order = new SalesOrderHeaderEntity(46117); return(order.CustomerViewRelated); }
private void EditOrder(SalesOrderHeaderEntity order) { ((FrmMain)MdiParent).LaunchChildForm(typeof(FrmOrderEdit), order); }
/// <summary>Konvertira entitet u business object.</summary> protected SalesOrderHeader(SalesOrderHeaderEntity entity) : base(entity) { }
/// <summary>Po potrebi konvertira entity u business objekt.</summary> public static SalesOrderHeader ConvertEntityToBusinessObject(SalesOrderHeaderEntity entity) { SalesOrderHeader bizobj = entity as SalesOrderHeader; if (bizobj == null) bizobj = new SalesOrderHeader(entity); return bizobj; }