public Main() { try { InitializeComponent(); DataSourceEntities entitiesDataSource = new DataSourceEntities(); //绑定数据类型 下拉列表(查询条件:支持导出工具且已实现入库) var availableDataTypes = from dataType in entitiesDataSource.S_DATA_RESOURCE_TYPES_DETAIL.Where( dataType => "Y".Equals(dataType.HASEXPORTER) && "Y".Equals(dataType.IMPLEMENTED_IMPORT_LOGIC) ).ToList() orderby dataType.ID ascending select new { diplayName = dataType.ID + "-" + dataType.CHINESE_NAME, selectedValue = dataType.CHINESE_NAME }; cbFileType.DisplayMember = "diplayName"; cbFileType.ValueMember = "selectedValue"; cbFileType.DataSource = availableDataTypes.ToList(); MessageUtil.setTbDetail = SetTextBoxDetail; MessageUtil.appendTbDetail = appendTextBoxDetail; //添加进度输出 MessageUtil.updateProgressIndicator = updateProgressIndicator; SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景. SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲 } catch (Exception ex) { MessageBox.Show($"启动失败,请确保安装了必备包内软件!!!\n错误详情:“{ex.Message}”"); throw; } }
private void getAndSetDataStoragePath(DataSourceEntities entitiesDataSource, string dataNum) { string addr1 = "", addr2 = "", recAddr = ""; var queriedBianMuEnumerator = entitiesDataSource.W_SJZYZTSXXX.Where(rec => (!string.IsNullOrEmpty(dataNum) && dataNum.Equals(rec.F_DATANUM))); var targetBianMu = queriedBianMuEnumerator.FirstOrDefault(); if (null == targetBianMu) { var message = "没有查询到指定类型的编目信息,请联系开发人员或手工指定提取数据位置"; MessageUtil.DoSetTBDetail(message); MessageBox.Show(message); } else { addr1 = targetBianMu.F_ONEADDRESS; if (!string.IsNullOrEmpty(addr1)) { addr1 = addr1.Trim(); } addr2 = targetBianMu.F_TWOADDRESS; if (!string.IsNullOrEmpty(addr2)) { addr2 = addr2.Trim(); } recAddr = targetBianMu.F_RECOVERYADDRESS; if (!string.IsNullOrEmpty(recAddr)) { recAddr = recAddr.Trim(); } } tbAddr1.Text = addr1; tbAddr2.Text = addr2; tbRecAddr.Text = recAddr; }
private void cbFileType_SelectedIndexChanged(object sender, EventArgs e) { if (-1 == cbFileType.SelectedIndex) { return; } var fileType = cbFileType.SelectedValue.ToString(); if (string.IsNullOrEmpty(fileType)) { MessageBox.Show("发生错误:数据类型为空,请重试!"); return; } var fDataNum = ""; //switch (fileType) //{ // case "中国商标": fDataNum = "DN0600"; break;//132 // case "马德里商标进入中国": fDataNum = "DN0603"; break;//136 // case "美国申请商标": fDataNum = "DN0605"; break;//138 // case "美国转让商标": fDataNum = "DN0606"; break;//139 // case "社内外知识产权图书题录数据": fDataNum = "DN0608"; break;//147 // case "中国法院判例初加工数据": fDataNum = "DN0610"; break;//162 // case "马德里商标购买数据": fDataNum = "DN0613"; break;//172 // case "中国集成电路布图公告及事务数据": fDataNum = "DN0615"; break;//183 // case "中国知识产权海关备案数据": fDataNum = "DN0616"; break;//184 // case "中国专利代理知识产权法律法规加工数据": fDataNum = "DN0135"; break; //180 // case "中国专利复审数据": fDataNum = "DN0046"; break;//194 // case "中国专利无效数据": fDataNum = "DN0507"; break;//195 // case "中国专利的判决书数据": fDataNum = "DN0506"; break;//196 // case "中国生物序列深加工数据-中文": fDataNum = "DN0045"; break;//209 // case "中国生物序列深加工数据-翻译": fDataNum = "DN0045"; break;//209 // case "中国中药专利翻译数据": fDataNum = "DN0052"; break;//210 // case "中国化学药物专利深加工数据": fDataNum = "DN0044"; break; //211 // // case "美国审判商标": fDataNum = "DN0607"; break;// //} //find the fDataNum by data resource type using (DataSourceEntities dataSourceEntities = new DataSourceEntities()) { var dataRes = dataSourceEntities.S_DATA_RESOURCE_TYPES_DETAIL.Where(Res => fileType.Equals(Res.CHINESE_NAME)).FirstOrDefault(); fDataNum = dataRes.F_DATA_NUM; if (string.IsNullOrWhiteSpace(fDataNum)) { MessageBox.Show("选择的数据类型没有编目编号,请联系管理员补充编目信息!"); return; } getAndSetDataStoragePath(dataSourceEntities, fDataNum.ToString()); } //清空文件路径 HDFilePaths = null; tbHDFilePath.Text = ""; }