Exemplo n.º 1
0
        public static string GetOurNo(string sCaseNo, ref EnumsAll.CaseType caseType)
        {
            var dtResult =
                DbHelperOra.Query($"select ourno from patentcase where ourno like '{sCaseNo.Replace("'", "''")}%'").Tables[0];

            if (dtResult.Rows.Count > 0)
            {
                caseType = EnumsAll.CaseType.Internal;
                return(dtResult.Rows[0][0].ToString());
            }


            dtResult =
                DbHelperOra.Query($"select ourno from fcase where ourno like '{sCaseNo.Replace("'", "''")}%'").Tables[0];
            if (dtResult.Rows.Count > 0)
            {
                caseType = EnumsAll.CaseType.Foreign;
                return(dtResult.Rows[0][0].ToString());
            }

            dtResult =
                DbHelperOra.Query($"select hk_app_ref from ex_hkcase where hk_app_ref like '{sCaseNo.Replace("'", "''")}%'")
                .Tables[0];
            if (dtResult.Rows.Count > 0)
            {
                caseType = EnumsAll.CaseType.Hongkong;
                return(dtResult.Rows[0][0].ToString());
            }

            return(string.Empty);
        }
        public void GetCaseInfo()
        {
            EnumsAll.CaseType caseType = EnumsAll.CaseType.Internal;
            var sOurNo = CommonFunction.GetOurNo(_sOurNo, ref caseType);

            if (string.IsNullOrEmpty(sOurNo))
            {
                return;
            }
            s_OurNo = sOurNo;
            switch (caseType)
            {
            case EnumsAll.CaseType.Internal:
            {
                var dr = DbHelperOra.Query(
                    $"select RECEIVED,CLIENT,CLIENT_NAME,APPL_CODE1,APPLICANT1,APPLICANT_CH1,APPL_CODE2,APPLICANT2,APPLICANT_CH2,APPL_CODE3,APPLICANT3,APPLICANT_CH3,APPL_CODE4,APPLICANT4,APPLICANT_CH4,APPL_CODE5,APPLICANT5,APPLICANT_CH5 from PATENTCASE where OURNO = '{_sOurNo}'").Tables[0].Rows[0];
                if (!string.IsNullOrWhiteSpace(dr["RECEIVED"].ToString()))
                {
                    dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString());
                }
                if (!string.IsNullOrWhiteSpace(dr["CLIENT"].ToString()))
                {
                    Client =
                        Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dr["CLIENT"]}'")) ??
                        new Corporation(Session)
                    {
                        Code = dr["CLIENT"].ToString(),
                        Name = dr["CLIENT_NAME"].ToString()
                    }
                }
                ;

                Applicants.ToList().ForEach(a => Applicants.Remove(a));
                for (int i = 1; i <= 5; i++)
                {
                    if (!string.IsNullOrWhiteSpace(dr[$"APPL_CODE{i}"].ToString()))
                    {
                        Applicants.Add(
                            Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dr[$"APPL_CODE{i}"]}'")) ??
                            new Corporation(Session)
                            {
                                Code = dr[$"APPL_CODE{i}"].ToString(),
                                Name =
                                    string.IsNullOrWhiteSpace(dr[$"APPLICANT{i}"].ToString())
                                                ? dr[$"APPLICANT_CH{i}"].ToString()
                                                : dr[$"APPLICANT{i}"].ToString()
                            });
                    }
                }
                break;
            }

            case EnumsAll.CaseType.Foreign:
            {
                var dr = DbHelperOra.Query(
                    $"select RECEIVED from FCASE where OURNO = '{_sOurNo}'")
                         .Tables[0].Rows[0];
                if (!string.IsNullOrWhiteSpace(dr["RECEIVED"].ToString()))
                {
                    dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString());
                }

                var dt         = DbHelperOra.Query($"select EID,ROLE,ORIG_NAME,TRAN_NAME,ENT_ORDER from FCASE_ENT_REL where OURNO = '{_sOurNo}'").Tables[0];
                var tempclient = dt.Select("ROLE = 'CLI' OR ROLE = 'APPCLI'");
                if (tempclient.Length > 0)
                {
                    Client =
                        Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{tempclient[0]["EID"]}'")) ??
                        new Corporation(Session)
                    {
                        Code = tempclient[0]["EID"].ToString(),
                        Name = !string.IsNullOrWhiteSpace(tempclient[0]["ORIG_NAME"].ToString())
                                                ? tempclient[0]["ORIG_NAME"].ToString()
                                                : tempclient[0]["TRAN_NAME"].ToString()
                    }
                }
                ;

                var tempagency = dt.Select("ROLE = 'AGT'");
                if (tempagency.Length > 0)
                {
                    Agency =
                        Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{tempagency[0]["EID"]}'")) ??
                        new Corporation(Session)
                    {
                        Code = tempagency[0]["EID"].ToString(),
                        Name = !string.IsNullOrWhiteSpace(tempagency[0]["ORIG_NAME"].ToString())
                                                ? tempagency[0]["ORIG_NAME"].ToString()
                                                : tempagency[0]["TRAN_NAME"].ToString()
                    }
                }
                ;


                Applicants.ToList().ForEach(a => Applicants.Remove(a));
                foreach (var dataRow in dt.Select("ROLE = 'APP' OR ROLE = 'APPCLI'", "ENT_ORDER ASC"))
                {
                    Applicants.Add(
                        Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dataRow["EID"]}'")) ??
                        new Corporation(Session)
                        {
                            Code = dataRow["EID"].ToString(),
                            Name =
                                !string.IsNullOrWhiteSpace(dataRow["ORIG_NAME"].ToString())
                                            ? dataRow["ORIG_NAME"].ToString()
                                            : dataRow["TRAN_NAME"].ToString()
                        });
                }
                break;
            }

            case EnumsAll.CaseType.Hongkong:
            {
                var dr = DbHelperOra.Query($"select cn_app_ref,RECEIVED from ex_hkcase where hk_app_ref = '{_sOurNo}'").Tables[0].Rows[0];
                if (!string.IsNullOrWhiteSpace(dr["RECEIVED"]?.ToString()))
                {
                    dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString());
                }
                if (!string.IsNullOrWhiteSpace(dr["cn_app_ref"]?.ToString()))
                {
                    var drCN = DbHelperOra.Query(
                        $"select RECEIVED,CLIENT,CLIENT_NAME,APPL_CODE1,APPLICANT1,APPLICANT_CH1,APPL_CODE2,APPLICANT2,APPLICANT_CH2,APPL_CODE3,APPLICANT3,APPLICANT_CH3,APPL_CODE4,APPLICANT4,APPLICANT_CH4,APPL_CODE5,APPLICANT5,APPLICANT_CH5 from PATENTCASE where OURNO = '{dr["cn_app_ref"]?.ToString()}'").Tables[0].Rows[0];
                    if (!string.IsNullOrWhiteSpace(drCN["CLIENT"].ToString()))
                    {
                        Client =
                            Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{drCN["CLIENT"]}'")) ??
                            new Corporation(Session)
                        {
                            Code = drCN["CLIENT"].ToString(),
                            Name = drCN["CLIENT_NAME"].ToString()
                        }
                    }
                    ;

                    Applicants.ToList().ForEach(a => Applicants.Remove(a));
                    for (int i = 1; i <= 5; i++)
                    {
                        if (!string.IsNullOrWhiteSpace(drCN[$"APPL_CODE{i}"].ToString()))
                        {
                            Applicants.Add(
                                Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{drCN[$"APPL_CODE{i}"]}'")) ??
                                new Corporation(Session)
                                {
                                    Code = drCN[$"APPL_CODE{i}"].ToString(),
                                    Name =
                                        string.IsNullOrWhiteSpace(drCN[$"APPLICANT{i}"].ToString())
                                                    ? drCN[$"APPLICANT_CH{i}"].ToString()
                                                    : drCN[$"APPLICANT{i}"].ToString()
                                });
                        }
                    }
                }
                break;
            }
            }
            Save();
        }
    }
Exemplo n.º 3
0
        public void GetPatentInfo()
        {
            EnumsAll.CaseType caseType = EnumsAll.CaseType.Internal;
            var sOurNo = CommonFunction.GetOurNo(_sOurNo, ref caseType);

            if (string.IsNullOrEmpty(sOurNo))
            {
                return;
            }
            s_OurNo = sOurNo;
            switch (caseType)
            {
            case EnumsAll.CaseType.Internal:
            {
                var dr = DbHelperOra.Query(
                    $"select RECEIVED,CLIENT,CLIENT_NAME,APPL_CODE1,APPLICANT1,APPLICANT_CH1,APPL_CODE2,APPLICANT2,APPLICANT_CH2,APPL_CODE3,APPLICANT3,APPLICANT_CH3,APPL_CODE4,APPLICANT4,APPLICANT_CH4,APPL_CODE5,APPLICANT5,APPLICANT_CH5,TITLE_CHINESE,CLIENT_NUMBER,FILING_DUE,TITLE from PATENTCASE where OURNO = '{_sOurNo}'").Tables[0].Rows[0];
                s_Name = dr["TITLE_CHINESE"].ToString();
                if (string.IsNullOrWhiteSpace(s_Name))
                {
                    s_Name = dr["TITLE"].ToString();
                }
                s_ClientRef = dr["CLIENT_NUMBER"].ToString();

                if (!string.IsNullOrWhiteSpace(dr["RECEIVED"].ToString()))
                {
                    dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString());
                }
                if (!string.IsNullOrWhiteSpace(dr["FILING_DUE"].ToString()))
                {
                    dt_FilingDeadline = Convert.ToDateTime(dr["FILING_DUE"].ToString());
                }
                if (!string.IsNullOrWhiteSpace(dr["CLIENT"].ToString()))
                {
                    Client =
                        Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dr["CLIENT"]}'")) ??
                        new Corporation(Session)
                    {
                        Code = dr["CLIENT"].ToString(),
                        Name = dr["CLIENT_NAME"].ToString()
                    }
                }
                ;
                Applicants.ToList().ForEach(a => Applicants.Remove(a));
                for (int i = 1; i <= 5; i++)
                {
                    if (!string.IsNullOrWhiteSpace(dr[$"APPL_CODE{i}"].ToString()))
                    {
                        Applicants.Add(
                            Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dr[$"APPL_CODE{i}"]}'")) ??
                            new Corporation(Session)
                            {
                                Code = dr[$"APPL_CODE{i}"].ToString(),
                                Name =
                                    string.IsNullOrWhiteSpace(dr[$"APPLICANT{i}"].ToString())
                                                ? dr[$"APPLICANT_CH{i}"].ToString()
                                                : dr[$"APPLICANT{i}"].ToString()
                            });
                    }
                }
                var objDate =
                    DbHelperOra.GetSingle(
                        $"select duedate from generalalert where typeid = 'tohandle_presubmit' and comments like '%返稿发明人%' and ourno = '{s_OurNo}'");
                if (objDate != null)
                {
                    dt_ReturnInventorDate = Convert.ToDateTime(objDate);
                }
                objDate = DbHelperOra.GetSingle(
                    $"select duedate from generalalert where typeid = 'tohandle_presubmit' and comments like '%返稿工程师%' and ourno = '{s_OurNo}'");
                if (objDate != null)
                {
                    dt_ReturnIPRDate = Convert.ToDateTime(objDate);
                }
                break;
            }

            case EnumsAll.CaseType.Foreign:
            {
                var dr = DbHelperOra.Query(
                    $"select RECEIVED,CTITLE,TITLE from FCASE where OURNO = '{_sOurNo}'")
                         .Tables[0].Rows[0];
                if (!string.IsNullOrWhiteSpace(dr["RECEIVED"].ToString()))
                {
                    dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString());
                }
                s_Name = dr["CTITLE"].ToString();
                if (string.IsNullOrWhiteSpace(s_Name))
                {
                    s_Name = dr["TITLE"].ToString();
                }
                var dt         = DbHelperOra.Query($"select EID,ROLE,ORIG_NAME,TRAN_NAME,ENT_ORDER from FCASE_ENT_REL where OURNO = '{_sOurNo}'").Tables[0];
                var tempclient = dt.Select("ROLE = 'CLI' OR ROLE = 'APPCLI'");
                if (tempclient.Length > 0)
                {
                    Client =
                        Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{tempclient[0]["EID"]}'")) ??
                        new Corporation(Session)
                    {
                        Code = tempclient[0]["EID"].ToString(),
                        Name = !string.IsNullOrWhiteSpace(tempclient[0]["ORIG_NAME"].ToString())
                                                ? tempclient[0]["ORIG_NAME"].ToString()
                                                : tempclient[0]["TRAN_NAME"].ToString()
                    }
                }
                ;

                Applicants.ToList().ForEach(a => Applicants.Remove(a));
                foreach (var dataRow in dt.Select("ROLE = 'APP' OR ROLE = 'APPCLI'", "ENT_ORDER ASC"))
                {
                    Applicants.Add(
                        Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dataRow["EID"]}'")) ??
                        new Corporation(Session)
                        {
                            Code = dataRow["EID"].ToString(),
                            Name =
                                !string.IsNullOrWhiteSpace(dataRow["ORIG_NAME"].ToString())
                                            ? dataRow["ORIG_NAME"].ToString()
                                            : dataRow["TRAN_NAME"].ToString()
                        });
                }
                break;
            }
            }
            var sOurNoShort = s_OurNo.Substring(0, s_OurNo.IndexOf("-", StringComparison.Ordinal));

            if (sOurNoShort.Contains("I"))
            {
                s_PatentType = EnumsAll.PatentType.发明;
            }
            else if (sOurNoShort.Contains("U"))
            {
                s_PatentType = EnumsAll.PatentType.实用新型;
            }
            else if (sOurNoShort.Contains("D"))
            {
                s_PatentType = EnumsAll.PatentType.外观设计;
            }
            else if (sOurNoShort.Contains("CR"))
            {
                s_PatentType = EnumsAll.PatentType.软件著作权;
            }
            Save();
        }
    }