Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        protected virtual void dataResivedForINVOICE(DataSet pDataSet)
        {
            IPagedSource pagedSource;
            DataTable    tab = pDataSet.Tables[TableINVOICE.TABLE];

            cellBindingHeader = new ImplCellReltions(tab);



            tab.ColumnChanged += new DataColumnChangeEventHandler(tableINVOICEColumnChanged);



            /////CURRENCY///////////////////////////////////////////////////////////////////////


            //ToolColumn.add(tab, TableSTLINE.E_DUMMY__RATE, typeof(double));
            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__CUR, typeof(short));
            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__CURCODE, typeof(string));

            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__REPRATE, typeof(double));



            //string _extp = "IIF({1} <> 0,{0}/{1},0)";

            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__TOTSURCHARGE, typeof(double));
            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__TOTDISCOUNT, typeof(double));
            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__TOT, typeof(double));
            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__TOTNET, typeof(double));

            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__REPTOTSURCHARGE, typeof(double));
            //new RowColumnsBindingInnerExpr(tab, new string[] { TableINVOICE.E_DUMMY__TOTSURCHARGE, TableINVOICE.E_DUMMY__REPRATE }, TableINVOICE.E_DUMMY__REPTOTSURCHARGE, _extp, null);
            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__REPTOTDISCOUNT, typeof(double));
            //new RowColumnsBindingInnerExpr(tab, new string[] { TableINVOICE.E_DUMMY__TOTDISCOUNT, TableINVOICE.E_DUMMY__REPRATE }, TableINVOICE.E_DUMMY__REPTOTDISCOUNT, _extp, null);
            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__REPTOT, typeof(double));
            //new RowColumnsBindingInnerExpr(tab, new string[] { TableINVOICE.E_DUMMY__TOT, TableINVOICE.E_DUMMY__REPRATE }, TableINVOICE.E_DUMMY__REPTOT, _extp, null);
            //ToolColumn.add(tab, TableINVOICE.E_DUMMY__REPTOTNET, typeof(double));
            //new RowColumnsBindingInnerExpr(tab, new string[] { TableINVOICE.E_DUMMY__TOTNET, TableINVOICE.E_DUMMY__REPRATE }, TableINVOICE.E_DUMMY__REPTOTNET, _extp, null);


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


            /////////////////////////////////////////////////////////////////
            ToolColumn.add(tab, TableINVOICE.E_DUMMY__SOURCEWHNAME, typeof(string));
            pagedSource = new PagedSourceWarehouse(environment);
            new RowColumnsBindingDBRelations(tab, pagedSource,
                                             new string[] { TableINVOICE.SOURCEINDEX },
                                             new string[] { TableWHOUSE.NR },
                                             new string[] { TableINVOICE.E_DUMMY__SOURCEWHNAME },
                                             new string[] { TableWHOUSE.NAME },
                                             UpdateTypeFlags.activeOnRelColumn | UpdateTypeFlags.disableEditCancel | UpdateTypeFlags.setTypeDefaultToDrivedChild,
                                             null);

            //new RowColumnsBindingDBRelations(tab, new PagedSourceClient(environment),
            //  new string[] { TableINVOICE.CLIENTREF },
            //  new string[] { TableCLCARD.LOGICALREF },
            //  new string[] { string.Empty, string.Empty, TableINVOICE.DISCPER, TableINVOICE.PRCLIST },
            //  new string[] { TableCLCARD.CODE, TableCLCARD.DEFINITION_, TableCLCARD.DISCPER, TableCLCARD.PRCLIST },
            //  UpdateTypeFlags.activateIgnorLast2DrivedChilCols | UpdateTypeFlags.setTypeDefaultToDrivedChild | UpdateTypeFlags.resetIfAllCurrentRelColsAreDefaultOrNull,
            //  null);

            new RowColumnsBindingDBRelations(tab, new PagedSourceClient(environment),
                                             new string[] { TableINVOICE.CLIENTREF },
                                             new string[] { TableCLCARD.LOGICALREF },
                                             new string[] { },
                                             new string[] { TableCLCARD.CODE, TableCLCARD.DEFINITION_, TableCLCARD.BARCODE },
                                             UpdateTypeFlags.setTypeDefaultToDrivedChild | UpdateTypeFlags.resetIfAllCurrentRelColsAreDefaultOrNull,
                                             null);

            /////////////////////////////////////////////////////////
        }