public static void processLine(StdBELista balanceSheetQuery, ClassLine line)
        {
            line.conta = balanceSheetQuery.Valor("Conta");
            line.moeda = balanceSheetQuery.Valor("Moeda");

            //line.values.Add(d);
            line.values.Add((double)balanceSheetQuery.Valor("Mes00CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes01CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes02CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes03CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes04CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes05CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes06CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes07CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes08CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes09CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes10CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes11CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes12CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes13CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes14CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes15CR"));

            line.values.Add((double)balanceSheetQuery.Valor("Mes00DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes01DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes02DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes03DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes04DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes05DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes06DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes07DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes08DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes09DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes10DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes11DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes12DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes13DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes14DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes15DB"));

            line.values.Add((double)balanceSheetQuery.Valor("Mes01OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes02OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes03OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes04OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes05OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes06OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes07OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes08OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes09OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes10OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes11OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes12OR"));

            line.tipoLancamento = balanceSheetQuery.Valor("TipoLancamento");
            line.naturezaOR     = balanceSheetQuery.Valor("NaturezaOR");
        }
        private Year calculateMetric(int year, ClassLine class_data, bool t_left_side)
        {
            Year year_data = new Year();

            year_data.year = year;

            for (int i = 0; i < 12; i++)
            {
                Double month = -class_data.values[i + 1] + class_data.values[i + 17]; //- CR + DB
                year_data.addMonth(month);
            }
            return(year_data);
        }
        public static Dictionary <int, Dictionary <string, ClassLine> > GetBalanceSheet()
        {
            //OUTPUT
            Dictionary <int, Dictionary <string, ClassLine> > output = new Dictionary <int, Dictionary <string, ClassLine> >();

            //STABLISH PRIMAVERA COMMUNICATION
            if (!InitializeCompany())
            {
                return(output);
            }
            StdBELista balanceSheetQuery = PriEngine.Engine.Consulta("SELECT * FROM AcumuladosContas ORDER BY Ano DESC");

            //COMPLETE OUTPUT
            Dictionary <string, ClassLine> year_balance = new Dictionary <string, ClassLine>();
            int past_year = 0;

            while (!balanceSheetQuery.NoFim())
            {
                ClassLine line = new ClassLine();
                line.ano = balanceSheetQuery.Valor("Ano");

                //CHECK IF IT IS A NEW YEAR TO CREATE A NEW BALANCE
                if (line.ano != past_year && past_year != 0) //in the first case the years are different but we want to continue
                {
                    output.Add(past_year, year_balance);
                    year_balance = new Dictionary <string, ClassLine>();
                }

                processLine(balanceSheetQuery, line);
                if (line.tipoLancamento == "000")
                {
                    year_balance.Add(line.conta.ToString(), line);
                }

                past_year = line.ano;
                balanceSheetQuery.Seguinte();
            }

            //if there are no more lines the cycle will end, so we have to add the data outside
            output.Add(past_year, year_balance);

            return(output);
        }
예제 #4
0
        public static Dictionary<int, Dictionary<string, ClassLine>> GetBalanceSheet()
        {
            //OUTPUT
            Dictionary<int, Dictionary<string, ClassLine>> output = new Dictionary<int, Dictionary<string, ClassLine>>();

            //STABLISH PRIMAVERA COMMUNICATION
            if (!InitializeCompany())
                return output;
            StdBELista balanceSheetQuery = PriEngine.Engine.Consulta("SELECT * FROM AcumuladosContas ORDER BY Ano DESC");

            //COMPLETE OUTPUT
            Dictionary<string, ClassLine> year_balance = new Dictionary<string, ClassLine>();
            int past_year = 0;

            while (!balanceSheetQuery.NoFim())
            {
                ClassLine line = new ClassLine();
                line.ano = balanceSheetQuery.Valor("Ano");

                //CHECK IF IT IS A NEW YEAR TO CREATE A NEW BALANCE
                if (line.ano != past_year && past_year != 0) //in the first case the years are different but we want to continue
                {
                    output.Add(past_year, year_balance);
                    year_balance = new Dictionary<string, ClassLine>();
                }

                processLine(balanceSheetQuery, line);
                if (line.tipoLancamento == "000")
                    year_balance.Add(line.conta.ToString(), line);

                past_year = line.ano;
                balanceSheetQuery.Seguinte();
            }

            //if there are no more lines the cycle will end, so we have to add the data outside
            output.Add(past_year, year_balance);

            return output;
        }
예제 #5
0
 public override Drower CreateDrower(IFigur selectedFigur, Brush brush, IFill fill)
 {
     abstractDrower = new ClassLine(brush, null, null);
     return(abstractDrower);
 }
예제 #6
0
        // 复制分类号条目
        int BuildClassRecords(
            string strBiblioDbNameParam,
            string strClassFromStyle,
            string strClassTableName,
            long lOldCount,
            ref long lProgress,
            ref long lIndex,
            out string strError)
        {
            strError = "";
            int nRet = 0;
            lProgress += lIndex;

            using (SQLiteConnection connection = new SQLiteConnection(this._connectionString))
            {
                connection.Open();

                string strQueryXml = "";

                long lRet = this.Channel.SearchBiblio(stop,
                    strBiblioDbNameParam,
                    "", // 
                    -1,
                    strClassFromStyle,     // "__id",
                    "left", // this.textBox_queryWord.Text == "" ? "left" : "exact",    // 原来为left 2007/10/18 changed
                    "zh",
                    null,   // strResultSetName
                    "",    // strSearchStyle
                    "keyid", //strOutputStyle, // (bOutputKeyCount == true ? "keycount" : ""),
                    out strQueryXml,
                    out strError);
                if (lRet == -1)
                {
                    if (this.Channel.ErrorCode == ErrorCode.FromNotFound)
                        return 0;
                    return -1;
                }
                if (lRet == 0)
                    return 0;

                long lHitCount = lRet;

                AdjustProgressRange(lOldCount, lHitCount);

                long lStart = lIndex;
                long lCount = lHitCount - lIndex;
                DigitalPlatform.CirculationClient.localhost.Record[] searchresults = null;

                // string strStyle = "id,cols,format:@coldef:*/barcode|*/department|*/readerType|*/name";
                string strStyle = "keyid,id,key";

                // 装入浏览格式
                List<ClassLine> lines = new List<ClassLine>();
                for (; ; )
                {
                    Application.DoEvents();	// 出让界面控制权

                    if (stop != null && stop.State != 0)
                    {
                        strError = "检索共命中 " + lHitCount.ToString() + " 条,已装入 " + lStart.ToString() + " 条,用户中断...";
                        return -1;
                    }

                    lRet = this.Channel.GetSearchResult(
                        stop,
                        null,   // strResultSetName
                        lStart,
                        lCount,
                        strStyle, // bOutputKeyCount == true ? "keycount" : "id,cols",
                        "zh",
                        out searchresults,
                        out strError);
                    if (lRet == -1)
                    {
                        strError = "检索共命中 " + lHitCount.ToString() + " 条,已装入 " + lStart.ToString() + " 条," + strError;
                        return -1;
                    }

                    if (lRet == 0)
                    {
                        return 0;
                    }

                    // 处理浏览结果
                    foreach (DigitalPlatform.CirculationClient.localhost.Record searchresult in searchresults)
                    {
                        // DigitalPlatform.CirculationClient.localhost.Record searchresult = searchresults[i];

                        ClassLine line = new ClassLine();
                        line.BiblioRecPath = searchresult.Path;
                        if (searchresult.Keys != null && searchresult.Keys.Length > 0)
                            line.Class = searchresult.Keys[0].Key;
                        lines.Add(line);

                    }

#if NO
                    if (lines.Count >= INSERT_BATCH
                        || ((lStart + searchresults.Length >= lHitCount || lCount - searchresults.Length <= 0) && lines.Count > 0)
                        )
#endif
                    {
                        // 插入一批分类号记录
                        nRet = ClassLine.AppendClassLines(
                            connection,
                            strClassTableName,
                            lines,
                            out strError);
                        if (nRet == -1)
                            return -1;

                        lIndex += lines.Count;
                        lines.Clear();
                    }

                    lStart += searchresults.Length;
                    lCount -= searchresults.Length;

                    // lIndex += searchresults.Length;
                    lProgress += searchresults.Length;
                    // stop.SetProgressValue(lProgress);
                    SetProgress(lProgress);

                    stop.SetMessage(strBiblioDbNameParam + " " + strClassFromStyle + " " + lStart.ToString() + "/" + lHitCount.ToString() + " "
                        + GetProgressTimeString(lProgress));
                     
                    if (lStart >= lHitCount || lCount <= 0)
                        break;
                }

                if (lines.Count > 0)
                {
                    Debug.Assert(false, "");
                } 

                return 0;
            }
        }
예제 #7
0
        public static void processLine(StdBELista balanceSheetQuery, ClassLine line)
        {
            line.conta = balanceSheetQuery.Valor("Conta");
            line.moeda = balanceSheetQuery.Valor("Moeda");

            //line.values.Add(d);
            line.values.Add((double)balanceSheetQuery.Valor("Mes00CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes01CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes02CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes03CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes04CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes05CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes06CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes07CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes08CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes09CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes10CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes11CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes12CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes13CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes14CR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes15CR"));

            line.values.Add((double)balanceSheetQuery.Valor("Mes00DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes01DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes02DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes03DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes04DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes05DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes06DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes07DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes08DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes09DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes10DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes11DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes12DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes13DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes14DB"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes15DB"));

            line.values.Add((double)balanceSheetQuery.Valor("Mes01OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes02OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes03OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes04OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes05OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes06OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes07OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes08OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes09OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes10OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes11OR"));
            line.values.Add((double)balanceSheetQuery.Valor("Mes12OR"));

            line.tipoLancamento = balanceSheetQuery.Valor("TipoLancamento");
            line.naturezaOR = balanceSheetQuery.Valor("NaturezaOR");
        }
예제 #8
0
        private void InitDockLayout()
        {
            _mapForm      = new ControlMapForm();
            _mapForm.Text = "GIS地图";
            _mapForm.Show(dockPanel1, DockState.Document);
            _mapForm.CloseButton = false;
            _mapForm.UiInitAndInvoke();
            _mapForm.Activate();



            MouseMoveOperator mouseMoveOperate;
            MouseDownOperator mouseDownOperate;

            sfHandle = new ShapeFileHandle(_mapForm.Map);

            #region 加载gis地图
            string[] str = { @"D:\光纤传感监测系统\Monitor\Monitor\data\底图.shp", @"D:\光纤传感监测系统\Monitor\Monitor\data\省界WGS 84.shp", @"D:\光纤传感监测系统\Monitor\Monitor\data\海缆WGS 84.tif" };
            mapLayer        = new MapLayer();
            MainLayerHandle = mapLayer.AddLayer(_mapForm.Map, str, "底图");

            _mapForm.MainLayerHandle = MainLayerHandle;
            _mapForm.SetMainLayerHandle();
            #endregion


            //	_mapForm.Map.ZoomToMaxExtents();
            _mapForm.Map.ZoomToLayer(MainLayerHandle);



            #region  在地图上划线
            ClassLine line      = new ClassLine();
            ClassLine line_1    = new ClassLine();
            GisPoint  gisPoint  = new GisPoint();
            LineSet   lineSet   = new LineSet(tkMapColor.Yellow, 6.0f, tkDashStyle.dsSolid);
            LineSet   lineSet_1 = new LineSet(tkMapColor.Red, 5.0f, tkDashStyle.dsCustom);
            gisPoint.connectToDB("Data Source=" + new DirectoryInfo("../../../../").FullName + "Monitor\\Monitor\\data\\data.db");
            gisPoint.readData();
            gisPoint.InitLineData(line);
            line_1.startX = gisPoint.m_PointList[15].X;
            line_1.startY = gisPoint.m_PointList[15].Y;
            line_1.endX   = gisPoint.m_PointList[20].X;
            line_1.endY   = gisPoint.m_PointList[20].Y;

            drawLine = new classDrawLine(_mapForm.Map);
            drawLine.WriteLine(line, lineSet);
            drawLine.WriteLine(line_1, lineSet_1);
            #endregion

            #region   在gis地图中添加ais数据
            //1、获取数据库中数据
            SqliteData sqlite = new SqliteData("Data Source=" + new DirectoryInfo("../../../../").FullName +
                                               "Monitor\\Monitor\\data\\data.db");
            DataTable gisData = sqlite.readData("Point");

            //2、实例化AISData类
            ais           = new AISData(_mapForm.Map, gisData);
            drawPoint_Ais = new classDrawPoint(MapForm.Map);

            //3、在地图上加载ais数据
            pointSet = new PointSet("AisReal", tkDefaultPointSymbol.dpsTriangleUp, tkMapColor.Red, 16);
            drawPoint_Ais.CreatPoint(ais.point, pointSet);
            drawPoint_Ais.EditAttribute();
            sfHandle.AddMouseMoveShapeFile("Ais", drawPoint_Ais.LayerHandle);
            #endregion


            #region
            drawPoint = new classDrawPoint(_mapForm.Map);
            var pnt = new ClassPoint();
            pnt.x   = 121.907567728461;
            pnt.y   = 30.8729913928844;
            pnt.str = "图片详情";
            string path = new DirectoryInfo("../../../../").FullName + "Monitor\\Monitor\\data\\ship3.png";
            drawPoint.AddPicture(pnt, path);
            drawPoint.EditAttribute();
            sfHandle.AddMouseDownShapeFile("pic", drawPoint.LayerHandle);
            #endregion


            _mapForm.Sf_MouseMove = sfHandle.Sf_MouseMove;
            _mapForm.Sf_MouseDown = sfHandle.Sf_MouseDown;


            mouseMoveOperate = new MouseMoveOperator(Operation.AddLabel);
            mouseDownOperate = new MouseDownOperator(Operation.AddLabel);

            //传入委托
            MapForm.MouseMoveOperate = mouseMoveOperate;
            MapForm.mouseDownOperate = mouseDownOperate;

            //var point = new ClassPoint();
            //point.x = 121.907567728461;
            //point.y = 30.8739913928844;
            //addText = new classAddText(_mapForm.Map, MainLayerHandle);
            //addText.AddText(point.x, point.y);
        }