Beispiel #1
0
        public static DS_SyncSalesOrderDetail.T_SalesOrderDetail_InvalidDataTable GetInvalidSalesOrderDetail()
        {
            var serverDateTime = SynchronizationManager.GetDate(ObjectNames.None, true);

            using (var ds = new DataSet("root"))
            {
                var header = SalesManager.GetSalesOrderHeader(serverDateTime.Date, false);
                var detail = SalesManager.GetSalesOrderDetail(serverDateTime.Date, false);
                header.RemoveColumns(true,
                                     header.SalesOrderIDColumn,
                                     header.BranchIDColumn,
                                     header.OrderDateColumn,
                                     header.OverheadNumberColumn,
                                     header.CustomerIDColumn,
                                     header.SubTotalColumn,
                                     header.TaxAmtColumn,
                                     header.FreightColumn,
                                     header.CurrencyCodeColumn,
                                     header.CurrencyRateIDColumn,
                                     header.PaymentMethodIDColumn,
                                     header.RevisionNumberColumn,
                                     header.StatusColumn,
                                     header.ModifiedUserIDColumn,
                                     header.ModifiedDateColumn,
                                     header.ApproverUserIDColumn,
                                     header.rowguidColumn
                                     );

                detail.RemoveColumns(true, detail.SalesOrderDetailIDColumn,
                                     detail.SalesOrderIDColumn,
                                     detail.ProductLocationIDColumn,
                                     detail.SaleQtyColumn,
                                     detail.UnitPriceColumn,
                                     detail.UnitPriceDiscountColumn,
                                     detail.OrdinalNumberColumn,
                                     detail.ModifiedUserIDColumn,
                                     detail.ModifiedDateColumn,
                                     detail.ActionColumn
                                     );

                ds.Tables.Add(header);
                ds.Tables.Add(detail);
                ds.SetColumnMappingType();
                return(GetInvalidSalesOrderDetail(ds.GetBytesData()));
            }
        }
Beispiel #2
0
        public static void SynchronizeSalesOrder(int id, DataTable cardhandle, DataTable operation)
        {
            var serverDateTime = SynchronizationManager.GetDate(ObjectNames.None, true);
            var header         = id == 0 ? SalesManager.GetSalesOrderHeader(serverDateTime.Date, false) : SalesManager.GetSalesOrderHeader(id, false);
            var detail         = id == 0 ? SalesManager.GetSalesOrderDetail(serverDateTime.Date, false) : SalesManager.GetSalesOrderDetail(id, false);

            if (cardhandle == null)
            {
                cardhandle = id == 0 ? CardManager.GetCardHandle(serverDateTime.Date, false) : CardManager.GetCardHandle(id, false);
            }
            if (operation == null)
            {
                operation = new DS_Operation.T_OperationDataTable();
            }


            using (var ds = new DataSet("root"))
            {
                header.RemoveColumns(true,
                                     header.SalesOrderIDColumn,
                                     header.BranchIDColumn,
                                     header.OrderDateColumn,
                                     header.OverheadNumberColumn,
                                     header.CustomerIDColumn,
                                     header.SubTotalColumn,
                                     header.TaxAmtColumn,
                                     header.FreightColumn,
                                     header.CurrencyCodeColumn,
                                     header.CurrencyRateIDColumn,
                                     header.PaymentMethodIDColumn,
                                     header.RevisionNumberColumn,
                                     header.StatusColumn,
                                     header.ModifiedUserIDColumn,
                                     header.ModifiedDateColumn,
                                     header.ApproverUserIDColumn,
                                     header.rowguidColumn
                                     );

                detail.RemoveColumns(true, detail.SalesOrderDetailIDColumn,
                                     detail.SalesOrderIDColumn,
                                     detail.ProductLocationIDColumn,
                                     detail.SaleQtyColumn,
                                     detail.UnitPriceColumn,
                                     detail.UnitPriceDiscountColumn,
                                     detail.OrdinalNumberColumn,
                                     detail.ModifiedUserIDColumn,
                                     detail.ModifiedDateColumn,
                                     detail.ActionColumn
                                     );

                ds.Tables.Add(header);
                ds.Tables.Add(detail);
                ds.Tables.Add(cardhandle);
                ds.Tables.Add(operation);
                ds.SetColumnMappingType();
                Synchronize(ObjectNames.SalesOrderHeader, BaseGlobalVariable.UserID, BaseGlobalVariable.ServerDateTime, DatabaseAction.Synchronize, true, ds.GetBytesData());


                ds.Tables.Remove(detail);
                ds.Tables.Remove(cardhandle);
                ds.Tables.Remove(operation);
                header.RemoveColumns(true, header.SalesOrderIDColumn);
                Synchronize(ObjectNames.SalesOrderHeader, BaseGlobalVariable.UserID, BaseGlobalVariable.ServerDateTime, DatabaseAction.Synchronize, false, ds.GetBytesData());
            }
        }