public override object GetValue(FileInOfficial fileInOfficial)
        {
            var objInfo = DbHelperOra.GetSingle($"select info from caseotherinfo where infotype = 'pubinfo' and caseno = '{fileInOfficial?.FilePatent?.s_OurNo}'");

            if (string.IsNullOrWhiteSpace(objInfo?.ToString()) || objInfo?.ToString().Split(';').Length < 3)
            {
                return(string.Empty);
            }
            var sInfo = objInfo?.ToString().Split(';')[2];

            if (sInfo == "1")
            {
                return
                    ("Since the published specification is identical with the specification as filed, we enclose herewith: (1) the notice and its English translation; and (2) one copy of the frontpage of the published application.  If you need the entire published application, please do not hesitate to contact us.");
            }
            if (sInfo == "2")
            {
                return
                    ("We enclose herewith: (1) the notice and its English translation; (2) the entire published application; and (3) our debit note on this matter.");
            }
            if (sInfo == "3")
            {
                return
                    ("We enclose herewith: (1) the notice and its English translation; (2) the entire published application. Our debit note on this matter will follow.");
            }
            return(string.Empty);
        }
        private void GenerateOutDoc(FileInOfficial fileInOfficial)
        {
            var fileTemplate = ObjectSpace.GetObjects <FileOutTemplate>(CriteriaOperator.Parse("s_FileCode = ? And s_ClientNo = ?", fileInOfficial.s_FileCode, fileInOfficial.FilePatent?.Client?.Code)).FirstOrDefault(f => (fileInOfficial.FilePatent?.s_ApplicantCodes ?? string.Empty).Split(';').Contains(f.s_ApplicantNo));//联合

            if (fileTemplate == null)
            {
                fileTemplate = ObjectSpace.FindObject <FileOutTemplate>(new GroupOperator(GroupOperatorType.And, new InOperator("s_ApplicantNo", (fileInOfficial.FilePatent?.s_ApplicantCodes ?? string.Empty).Split(';')), CriteriaOperator.Parse("s_FileCode = ? And IsNullOrEmpty(s_ClientNo)", fileInOfficial.s_FileCode)));//申请人
            }
            if (fileTemplate == null)
            {
                fileTemplate = ObjectSpace.FindObject <FileOutTemplate>(CriteriaOperator.Parse("s_FileCode = ? And s_ClientNo = ? And IsNullOrEmpty(s_ApplicantNo)", fileInOfficial.s_FileCode, fileInOfficial.FilePatent?.Client?.Code));//客户
            }
            if (fileTemplate == null)
            {
                fileTemplate = ObjectSpace.FindObject <FileOutTemplate>(CriteriaOperator.Parse("s_FileCode = ? And IsNullOrEmpty(s_ClientNo) And IsNullOrEmpty(s_ApplicantNo)", fileInOfficial.s_FileCode));//默认
            }
            if (fileTemplate == null || fileTemplate.TemplateData == null)
            {
                return;
            }
            using (var stream = new MemoryStream())
            {
                fileTemplate.TemplateData.SaveToStream(stream);
                var doc = DocX.Load(stream);
                stream.Close();

                ReplaceMark(fileInOfficial, doc);
                ReplaceMark(fileInOfficial, doc);//替换两遍,目的是替换标签内容中的标签

                using (var streamWrite = new MemoryStream())
                {
                    doc.SaveAs(streamWrite);
                    streamWrite.Position = 0;
                    if (fileInOfficial.OutFileData == null)
                    {
                        fileInOfficial.OutFileData = new FileData(fileInOfficial.Session);
                    }
                    var sFileName = fileTemplate.s_FileName;
                    foreach (Match match in Regex.Matches(fileTemplate.s_FileName, @"(?<=\[\[\[).*?(?=\]\]\])"))
                    {
                        if (!match.Success)
                        {
                            continue;
                        }
                        var markCode = MarkCodeCollection.Instanse.FirstOrDefault(m => m.MarkName == match.Value);
                        if (markCode == null)
                        {
                            continue;
                        }
                        sFileName = sFileName.Replace("[[[" + match.Value + "]]]", markCode.GetValue(fileInOfficial).ToString());
                    }
                    fileInOfficial.OutFileData.LoadFromStream(sFileName + ".docx", streamWrite);
                    streamWrite.Close();
                    fileInOfficial.Save();
                    fileInOfficial.Session.CommitTransaction();
                }
            }
        }
        public override object GetValue(FileInOfficial fileInOfficial)
        {
            var objHKCancel = DbHelperOra.GetSingle($"select FIRST_HK_CANCELLED from patentcase where ourno = '{fileInOfficial?.FilePatent?.s_OurNo}'");

            return(objHKCancel?.ToString().ToUpper() == "Y" ? @"In addition, please be advised that if a Chinese patent application for invention is to be protected in Hong Kong, it must be registered as a standard patent application in Hong Kong via the following two-stage registration system: (1) within six months from the publication date of the Chinese patent application, a Request to Record in Hong Kong must be filed; and (2) within six months from the date of announcement of the granting of the Chinese patent right by SIPO, or of the publication in Hong Kong of the Request to Record, whichever is later, a Request for Registration in Hong Kong must be filed. No grace period will be allowed when the above-mentioned 6-months term is over.
If you wish to entrust us to obtain patent protection for this application in Hong Kong, please send your instructions at least 30 days before the deadline. If we do not receive your instructions, we will not record this application in Hong Kong. The estimated cost of filing a request to record this application in Hong Kong is about US$670, including both the official fee and our service fee.  The filing deadline is:
[[[公开日|M6|EN]]]
No grace period will be allowed when the said 6-month term is over.  No other documents but a written letter of instructions from you is required if you wish to entrust us to obtain patent protection for this application in Hong Kong.  We prefer to receive your instructions at least 20 days before said deadline if you decide to record this case in Hong Kong." : string.Empty);
        }
        public override object GetValue(FileInOfficial fileInOfficial)
        {
            var objInfo = DbHelperOra.GetSingle($"select info from caseotherinfo where infotype = 'pubinfo' and caseno = '{fileInOfficial?.FilePatent?.s_OurNo}'");

            if (string.IsNullOrWhiteSpace(objInfo?.ToString()) || objInfo?.ToString().Split(';').Length < 3)
            {
                return(string.Empty);
            }
            return(objInfo?.ToString().Split(';')[1]);
        }
        public override object GetValue(FileInOfficial fileInOfficial)
        {
            var objName = DbHelperOra.GetSingle($"select OAGENT1 from patentcase where ourno = '{fileInOfficial?.FilePatent?.s_OurNo}'");

            if (string.IsNullOrWhiteSpace(objName?.ToString()))
            {
                return(string.Empty);
            }
            return(fileInOfficial.Session.FindObject <SysUser>(CriteriaOperator.Parse("Code = ?", objName.ToString()))?.EName);
        }
        public override object GetValue(FileInOfficial fileInOfficial)
        {
            var dr      = DbHelperOra.Query($"select APPLICANT1,APPLICANT2,APPLICANT3,APPLICANT4,APPLICANT5 from patentcase where ourno = '{fileInOfficial?.FilePatent?.s_OurNo}'").Tables[0].Rows[0];
            var listStr = new List <string>();

            for (var i = 1; i <= 5; i++)
            {
                if (!string.IsNullOrWhiteSpace(dr[$"APPLICANT{i}"]?.ToString()))
                {
                    listStr.Add(dr[$"APPLICANT{i}"]?.ToString());
                }
            }
            return(string.Join("; ", listStr));
        }
 public override object GetValue(FileInOfficial fileInOfficial)
 {
     return(fileInOfficial?.s_FileCode);
 }
 public override object GetValue(FileInOfficial fileInOfficial)
 {
     return(fileInOfficial?.dt_OfficialSendDate);
 }
 public override object GetValue(FileInOfficial fileInOfficial)
 {
     return(DbHelperOra.GetSingle($"select SE_DATE from patentcase where ourno = '{fileInOfficial?.FilePatent?.s_OurNo}'"));
 }
 public override object GetValue(FileInOfficial fileInOfficial)
 {
     return(fileInOfficial?.FilePatent?.s_OurNo);
 }
        public override object GetValue(FileInOfficial fileInOfficial)
        {
            var drs = DbHelperOra.Query($"select * from Generalalert where typeid = 'modification' and ourno = '{fileInOfficial?.FilePatent?.s_OurNo}'").Tables[0].Rows;

            return(drs.Count > 0 ? @"Pursuant to your instructions, we will file a voluntary amendment for the above–referenced application as soon as possible. If further amendments are needed, should the applicant(s) decide to do so, please let us know at least 20 days before the due date." : @"Should the applicant(s) decide to do so, please let us know at least 20 days before the due date.");
        }
        public override object GetValue(FileInOfficial fileInOfficial)
        {
            var objHKCancel = DbHelperOra.GetSingle($"select FIRST_HK_CANCELLED from patentcase where ourno = '{fileInOfficial?.FilePatent?.s_OurNo}'");

            return(objHKCancel?.ToString().ToUpper() != "Y" ? @"According to your general instruction, we will file the request to record in Hong Kong as soon as possible, and before the filing deadline, which is [[[公开日|M6|EN]]]." : string.Empty);
        }
 public override object GetValue(FileInOfficial fileInOfficial)
 {
     return(DateTime.Now.Date);
 }
예제 #14
0
 public abstract object GetValue(FileInOfficial fileInOfficial);
        private static void ReplaceMark(FileInOfficial fileInOfficial, DocX doc)
        {
            foreach (Match match in Regex.Matches(doc.Text, @"(?<=\[\[\[).*?(?=\]\]\])"))
            {
                if (!match.Success)
                {
                    continue;
                }
                var sValue    = string.Empty;
                var listParas = match.Value.Split('|').ToList();
                var markCode  = MarkCodeCollection.Instanse.FirstOrDefault(m => m.MarkName == listParas[0]);
                if (markCode == null)
                {
                    continue;
                }
                sValue = markCode.GetValue(fileInOfficial)?.ToString();
                if (markCode.DataType == DataType.DateTime)
                {
                    sValue = Convert.ToDateTime(sValue).ToString("yyyy/M/d", DateTimeFormatInfo.InvariantInfo);
                }

                if (listParas.Count >= 2 && !string.IsNullOrWhiteSpace(sValue))
                {
                    var dtValue   = Convert.ToDateTime(sValue);
                    var sPara     = listParas[1].ToUpper();
                    var nDaySeq   = sPara.IndexOf("D", StringComparison.Ordinal);
                    var nMonthSeq = sPara.IndexOf("M", StringComparison.Ordinal);
                    var nCount1   =
                        Convert.ToInt32(Regex.Match(sPara, @"[-]?\d+").Success ? Regex.Match(sPara, @"[-]?\d+").Value : "0");
                    var nCount2 =
                        Convert.ToInt32(Regex.Match(sPara, @"[-]?\d+").NextMatch().Success
                            ? Regex.Match(sPara, @"[-]?\d+").NextMatch().Value
                            : "0");
                    if (nDaySeq > -1 && nMonthSeq > -1)
                    {
                        dtValue = nMonthSeq < nDaySeq
                            ? dtValue.AddMonths(nCount1).AddDays(nCount2)
                            : dtValue.AddDays(nCount1).AddMonths(nCount2);
                    }
                    else if (nDaySeq > -1 && nMonthSeq < 0)
                    {
                        dtValue = dtValue.AddDays(nCount1);
                    }
                    else if (nMonthSeq > -1 && nDaySeq < 0)
                    {
                        dtValue = dtValue.AddMonths(nCount1);
                    }
                    sValue = dtValue.ToString("yyyy/M/d", DateTimeFormatInfo.InvariantInfo);
                    if (listParas.Count == 3)
                    {
                        var sFormat = listParas[2].ToUpper();
                        if (sFormat == "CN")
                        {
                            sValue = dtValue.ToString("yyyy年M月d日", DateTimeFormatInfo.InvariantInfo);
                        }
                        if (sFormat == "EN")
                        {
                            sValue = dtValue.ToString("MMMM d, yyyy", DateTimeFormatInfo.InvariantInfo);
                        }
                    }
                }

                doc.ReplaceText("[[[" + match.Value + "]]]", sValue ?? string.Empty);
            }
        }