//国内优先权 public int TPCasePriority(int _rowid, DataRow dr, string commDB, SqlConnection _connection) { int result = 0; #region string sNo = dr["我方卷号"].ToString().Trim(); int Country = _dbHelper.GetIDbyName(dr["优先权国家"].ToString().Trim(), 1, _connection); int nCaseID = _dbHelper.GetIDbyName(sNo, 2, _connection); if (nCaseID.Equals(0)) { _dbHelper.InsertLog(0, sNo, _rowid, "国内-优先权", "国内-优先权-" + _rowid, "未找到“我方卷号”为:" + sNo, "", commDB, _connection); return(result); } else { result = 1; InsertTPCasePriority(nCaseID, Country, dr, "国内-优先权", _rowid, commDB, _connection); } UpdateSeq(nCaseID, commDB, _connection); if (dr["优先权国家"].ToString().Trim().Equals("中国")) //B为主案 { var _tCaseRelative = new TCaseRelative(); _tCaseRelative.InsertInto(dr["优先权号"].ToString().Trim(), nCaseID, _rowid, "国内-优先权", commDB, _connection); } #endregion return(result); }
//香港优先权 public int HongKangPriority(int rowid, DataRow dr, string commDB, SqlConnection _connection) { int Country = _dbHelper.GetIDbyName(dr["优先权国家"].ToString().Trim(), 1, _connection); int HKNum = _dbHelper.GetIDbyName(dr["我方卷号"].ToString().Trim(), 2, _connection); if (HKNum.Equals(0)) { _dbHelper.InsertLog(0, dr["我方卷号"].ToString().Trim(), rowid, "香港-优先权", "香港-优先权-" + rowid, "未找到“我方卷号”为:" + dr["我方卷号"].ToString(), "", commDB, _connection); return(0); } else { string strSql = "SELECT a.n_CaseID FROM tcase_Base a left join TPCase_Patent b on a.n_CaseID=b.n_CaseID left join TPCase_OrigPatInfo c on b.n_OrigPatInfoID=c.n_ID " + "where c.s_CaseSerial='" + dr["我方卷号"].ToString().Trim() + "'"; DataTable table = _dbHelper.GetDataTablebySql(strSql, _connection); if (table.Rows.Count > 0) { for (int i = 0; i < table.Rows.Count; i++) { int HkNu = int.Parse(table.Rows[i]["n_CaseID"].ToString()); InsertTPCasePriority(HkNu, Country, dr, "香港-优先权", rowid, commDB, _connection); if (dr["优先权国家"].ToString().Trim().Equals("中国")) //B为主案 { var _tCaseRelative = new TCaseRelative(); _tCaseRelative.InsertInto(dr["优先权号"].ToString().Trim(), HKNum, rowid, "香港-优先权", commDB, _connection); } UpdateSeq(HKNum, commDB, _connection); } return(1); } else { _dbHelper.InsertLog(HKNum, "", rowid, "香港-优先权", "香港-优先权-" + rowid, "未查到香港案件的原案信息,无法添加优先权信息", strSql.Replace("'", "''"), commDB, _connection); } return(0); } }