コード例 #1
0
        protected virtual void dataResivedForKSLINES(DataSet pDataSet)
        {
            // IPagedSource pagedSource;
            DataTable tab = pDataSet.Tables[TableKSLINES.TABLE];

            cellBindingHeader = new ImplCellReltions(tab);

            CellAutomationDB dbAutomation;

            dbAutomation = new CellAutomationDB(tab, new PagedSourceClient(environment),
                                                new string[] { TableKSLINES.CLIENTREF },
                                                new string[] { TableCLCARD.LOGICALREF },
                                                new string[] { },
                                                new string[] { TableCLCARD.CODE, TableCLCARD.DEFINITION_, TableCLCARD.BARCODE },
                                                UpdateTypeFlags.resetIfAllCurrentRelColsAreDefaultOrNull,
                                                null);

            cellBindingHeader.addRelation(dbAutomation.getTriggerColumns(), dbAutomation, null);
        }
コード例 #2
0
        protected virtual void dataResivedForSTLINE(DataSet pDataSet)
        {
            //IPagedSource pagedSource;
            DataTable tab = pDataSet.Tables[TableSTLINE.TABLE];

            cellBindingLines = new ImplCellReltions(tab);



            tab.ColumnChanged += new DataColumnChangeEventHandler(tableSTLINEColumnChanged);
            tab.RowChanged    += new DataRowChangeEventHandler(tableSTLINERowChanged);
            tab.RowDeleted    += new DataRowChangeEventHandler(tableSTLINERowDeleted);
            /////CURRENCY///////////////////////////////////////////////////////////////////////
            ToolColumn.add(tab, TableSTLINE.E_DUMMY__TOTAL, typeof(double));
            ToolColumn.add(tab, TableSTLINE.E_DUMMY__PRICE, typeof(double));
            //ToolColumn.add(tab, TableSTLINE.E_DUMMY__RATE, typeof(double));

            //ToolColumn.add(tab, TableSTLINE.E_DUMMY__REPTOTAL, typeof(double));
            //ToolColumn.add(tab, TableSTLINE.E_DUMMY__REPPRICE, typeof(double));
            //ToolColumn.add(tab, TableSTLINE.E_DUMMY__REPRATE, typeof(double));

            ////////////BIND AND INHERIT/////////////////////////////////////////

            new TablesColumnsBinding(
                pDataSet.Tables[TableINVOICE.TABLE],
                pDataSet.Tables[TableSTLINE.TABLE],
                new string[] {
                TableINVOICE.CANCELLED,
                TableINVOICE.CLIENTREF,
                TableINVOICE.DATE_,
                TableINVOICE.SOURCEINDEX,
                //TableINVOICE.E_DUMMY__REPRATE,
                TableINVOICE.PRCLIST
            }
                , new string[] {
                TableSTLINE.CANCELLED,
                TableSTLINE.CLIENTREF,
                TableSTLINE.DATE_,
                TableSTLINE.SOURCEINDEX,
                //TableSTLINE.E_DUMMY__REPRATE,
                TableSTLINE.PRCLIST
            }, true);

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

            //MAIN//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            for (int i = 0; i < count; ++i) //Now 1
            {
                CellAutomationSimpleExp cellExpes = new CellAutomationSimpleExp(
                    new string[] { TableSTLINE.AMOUNT, arrPriceCols[i], arrTotalCols[i] },
                    new IEvaluator[] { new CalcDoubleDiv(2, 1), new CalcDoubleDiv(2, 0), new CalcDoubleMult(0, 1) },
                    // new string[] { "IIF({1}<>0,{2}/{1},0)", "IIF({0}<>0,{2}/{0},0)", "{0}*{1}" },
                    new string[] { TableSTLINE.AMOUNT, arrPriceCols[i], arrTotalCols[i] });
                cellBindingLines.addRelation(new string[] { TableSTLINE.AMOUNT, arrPriceCols[i], arrTotalCols[i] }, cellExpes, bpArrMain[i] = new BlockPoint(), new ImplValidRowStockPriced());
            }
            //PRICE FROM LOC//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            for (int i = 1; i < count; ++i)
            {
                CellAutomationSimpleExp cellExpes = new CellAutomationSimpleExp(
                    new string[] { arrPriceCols[i] },
                    new IEvaluator[] { new CalcDoubleMult(0, 1) },
                    // new string[] { "{0}*{1}" },
                    new string[] { TableSTLINE.PRICE, arrRateCols[i] });
                cellBindingLines.addRelation(new string[] { TableSTLINE.PRICE, arrRateCols[i] }, cellExpes, bpArrPriceXFromLoc[i] = new BlockPoint(), null);
            }
            //TOTAL FROM LOC//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            for (int i = 1; i < count; ++i)
            {
                CellAutomationSimpleExp cellExpes = new CellAutomationSimpleExp(
                    new string[] { arrTotalCols[i] },
                    new IEvaluator[] { new CalcDoubleMult(0, 1) },
                    // new string[] { "{0}*{1}" },
                    new string[] { TableSTLINE.TOTAL, arrRateCols[i] });
                cellBindingLines.addRelation(new string[] { TableSTLINE.TOTAL, arrRateCols[i] }, cellExpes, bpArrTotalXFromLoc[i] = new BlockPoint(), null);
            }
            ////////////////////////////////////////////////////////////////////////////////////
            setUsedCurrency(ConstUsedCur.national);


            ////////////////////////////////////////////////////////////////////////////////////
            CellAutomationDB dbAutomation;

            dbAutomation = new CellAutomationDB(tab, new PagedSourceMaterial(environment),
                                                new string[] { TableSTLINE.STOCKREF },
                                                new string[] { TableITEMS.LOGICALREF },
                                                new string[] { },
                                                new string[] { TableITEMS.CODE, TableITEMS.NAME },
                                                UpdateTypeFlags.resetIfAllCurrentRelColsAreDefaultOrNull,
                                                validatorLineMatOrPromo);

            cellBindingLines.addRelation(dbAutomation.getTriggerColumns(), dbAutomation, validatorLineMatOrPromo);
            dbAutomation = new CellAutomationDB(tab, new PagedSourceMaterial(environment),
                                                new string[] { TableSTLINE.STOCKREF },
                                                new string[] { TableITEMS.LOGICALREF },
                                                new string[] { /* TableSTLINE.DISCPER, */ TableSTLINE.UINFO1, TableSTLINE.UINFO2, TableSTLINE.UNIT, TableSTLINE.UNITREF },
                                                new string[] { /* TableITEMS.DISCPER,*/ TableITEMS.UNITCF1, TableITEMS.UNITCF1, TableITEMS.UNIT1, TableITEMS.UNITREF1 },
                                                UpdateTypeFlags.activeOnRelColumn | UpdateTypeFlags.disableEditCancel | UpdateTypeFlags.setTypeDefaultToDrivedChild,
                                                validatorLineMatOrPromo);

            cellBindingLines.addRelation(dbAutomation.getTriggerColumns(), dbAutomation, validatorLineMatOrPromo);



            //
            //



            new RowDeleteWatcher(tab, null, new string[] { TableSTLINE.TOTAL }, new object[] { 0.0 });



            bindForLineType(tab);
            bindForDistributeSums(tab);
            bindForPromo(tab);
        }