Ejemplo n.º 1
0
        /// <summary>
        ///
        /// 20131024华迪添加接口属性:分块编号[productArea]
        /// </summary>
        /// <param name="catalog"></param>
        /// <returns></returns>
        private string SaveToDb(ICatalogItem catalog)
        {
            MonitorProductInfo info = new MonitorProductInfo();

            //fir ,fog
            info.productType = catalog.Info.GetPropertyValue("ProductIdentify");
            //tjcp:统计产品  xxcp;信息列表  sgcp:栅格产品 ztcp:专题产品   slcp:矢量产品 dhcp:动画产品
            info.productDataType     = catalog.Info.GetPropertyValue("CatalogDef");         //VectorProduct、
            info.productIdentify     = catalog.Info.GetPropertyValue("SubProductIdentify"); //DBLV,0CSR,"PLST";
            info.productIdentifyName = catalog.Info.GetPropertyValue("CatalogItemCN");      //"火点二值图";
            info.satellite           = catalog.Info.GetPropertyValue("Satellite");
            info.sensor             = catalog.Info.GetPropertyValue("Sensor");
            info.subProductType     = "";                                               //通常为空
            info.orbitDateTime      = DateTime.Parse(catalog.Info.GetPropertyValue("OrbitDateTime"));
            info.info               = new Info();
            info.info.orbitDateTime = info.orbitDateTime;
            info.info.satellite     = info.satellite;
            info.info.sensor        = info.sensor;
            info.productArea        = catalog.Info.GetPropertyValue("Region");
            if (string.IsNullOrWhiteSpace(info.productDataType))
            {
            }
            string dir = _client.getDataDir(info);

            if (catalog.Info.Properties.ContainsKey(CatalogTreeView.ToDBInfoKey))
            {
                catalog.Info.Properties[CatalogTreeView.ToDBInfoKey] = CatalogTreeView.ToDBInfoValue;
            }
            else
            {
                catalog.Info.Properties.Add(CatalogTreeView.ToDBInfoKey, CatalogTreeView.ToDBInfoValue);
            }
            string infoFilename = System.IO.Path.ChangeExtension(catalog.FileName, ".info");

            catalog.Info.SaveTo(infoFilename);

            string[] extFiles = GetExtFiles(catalog.FileName);
            info.extendFiles = ExtFilesToString(extFiles);

            CopyFile(dir, catalog.FileName);
            if (extFiles != null && extFiles.Length != 0)
            {
                for (int i = 0; i < extFiles.Length; i++)
                {
                    CopyFile(dir, extFiles[i]);
                }
            }

            string productFilename = System.IO.Path.GetFileName(catalog.FileName);

            info.productFileName = productFilename;
            info.productFilePath = dir;

            //SaveToDb(info.productIdentify, info);
            return(dir);
        }
Ejemplo n.º 2
0
 private void btnToDb_Click(object sender, EventArgs e)
 {
     try
     {
         btnToDb.Enabled = false;
         if (_catalogTreeView == null)
         {
             MsgBox.ShowInfo("没有数据");
             return;
         }
         ICatalogItem[] items = _catalogTreeView.GetCheckedItem();
         if (items == null || items.Length == 0)
         {
             MsgBox.ShowInfo("没有数据");
             return;
         }
         OnProgress(0);
         for (int i = 0; i < items.Length; i++)
         {
             OnProgress((int)((i + 1.0) / items.Length));
             string dir = SaveToDb(items[i]);
         }
         //by chennan 20140930 修改入库传入产品标识
         MonitorProductInfo info = new MonitorProductInfo();
         info.productType = items[0].Info.GetPropertyValue("ProductIdentify");
         //
         SaveToDb(null, info);
         OnSendMessage("入库请求已提交完成");
         MsgBox.ShowInfo("入库请求已提交完成");
     }
     catch (Exception ex)
     {
         OnSendMessage(ex.Message);
         MsgBox.ShowInfo(ex.Message);
     }
     finally
     {
         LoadData();
         btnToDb.Enabled = true;
         OnProgress(0);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// public boolean saveFir(Map<String,MonitorProductInfo> firMap) {
 /// PLST.
 /// </summary>
 private void SaveToDb(string key, MonitorProductInfo info)
 {
     _client.saveProductInfo(info);
 }