コード例 #1
0
        public void FilterData(StringBuilder res = null)
        {
            if (DisableBaseFilterData)
            {
                return;
            }
            if (res == null)
            {
                res = GetAutoPropertyFilterString();
            }
            if (res.Length == 0 && vloader.NavigationExpression.Count != 0)
            {
                res.Append("&& All");
            }
            if (res.Length > 0)
            {
                vloader.FilterExpression = res.ToString().Trim().Substring(2).Trim();
            }
            else
            {
                if (vloader.FilterExpression != "All")
                {
                    vloader.FilterExpression = null;
                }
            }

            CounterPointSales.Refresh();
            NotifyPropertyChanged(x => this.CounterPointSales);
        }
コード例 #2
0
        public async Task DownloadCPSales(CounterPointSales c, int docSetId)
        {
            //WaterNutDBEntities db = BaseDataModel.db;//new WaterNutDBEntities(Properties.Settings.Default.WaterNutDBEntitiesConnection);
            if (docSetId != 0)
            {
                StatusModel.Timer("Downloading CP Sales...");
                using (var ctx = new WaterNutDBEntities()
                {
                    CommandTimeout = 0
                })
                {
                    await ctx.ExecuteStoreCommandAsync(@"
                            
                                    Delete from EntryData
                                    Where EntryDataId = @INVNumber

                                    Delete from EntryData_Sales
                                    Where EntryDataId = @INVNumber

                                    INSERT INTO EntryData
                                                      (EntryDataId, EntryDataDate)
                                    SELECT INVNO, DATE
                                    FROM     CounterPointSales
                                    WHERE  (INVNO = @INVNumber)

                                    INSERT INTO AsycudaDocumentSetEntryData
                                                      (EntryDataId, AsycudaDocumentSetId)
                                    SELECT INVNO, @AsycudaDocumentSetId
                                    FROM     CounterPointSales
                                    WHERE  (INVNO = @INVNumber)

                                    INSERT INTO EntryData_Sales
                                                      (EntryDataId, INVNumber, TaxAmount,CustomerName)
                                    SELECT distinct INVNO, INVNO AS Expr1,TAX_AMT, [CUSTOMER NAME]
                                    FROM     CounterPointSales
                                    WHERE  (INVNO = @INVNumber)

                                    INSERT INTO InventoryItems
                                                      (ItemNumber, Description)
                                    SELECT CounterPointSalesDetails.ITEM_NO, CounterPointSalesDetails.ITEM_DESCR
                                    FROM     CounterPointSalesDetails LEFT OUTER JOIN
                                                      InventoryItems AS InventoryItems_1 ON CounterPointSalesDetails.ITEM_NO = InventoryItems_1.ItemNumber
                                    WHERE  (CounterPointSalesDetails.INVNO = @INVNumber) AND (InventoryItems_1.ItemNumber IS NULL) AND Left(CounterPointSalesDetails.ITEM_NO,1) <>'*'

                                    INSERT INTO EntryDataDetails
                                                      (EntryDataId, LineNumber, ItemNumber, Quantity, Units, ItemDescription, Cost, UnitWeight, QtyAllocated)
                                    SELECT INVNO, SEQ_NO, ITEM_NO, QUANTITY, QTY_UNIT, ITEM_DESCR, COST, isnull(UNIT_WEIGHT,0), 0
                                    FROM     CounterPointSalesDetails
                                    WHERE  (INVNO = @INVNumber) AND Left(CounterPointSalesDetails.ITEM_NO,1) <>'*'",

                                                       new SqlParameter("@AsycudaDocumentSetId", docSetId),
                                                       new SqlParameter("@INVNumber", c.InvoiceNo)).ConfigureAwait(false);
                }
                StatusModel.Timer("Refreshing Sales Data");


                StatusModel.StopStatusUpdate();
            }
        }
コード例 #3
0
 public async Task DownloadCPSales(CounterPointSales counterPointSales, int p)
 {
     await WaterNut.DataSpace.CPSalesModel.Instance.DownloadCPSales(counterPointSales, p).ConfigureAwait(false);
 }
コード例 #4
0
 public async Task <CounterPointSales> CreateCounterPointSales(CounterPointSales entity)
 {
     return(await Channel.CreateCounterPointSales(entity).ConfigureAwait(false));
 }
コード例 #5
0
 public async Task DownloadCPSales(CounterPointSales counterPointSales, int p)
 {
     await Channel.DownloadCPSales(counterPointSales, p).ConfigureAwait(false);
 }