Exemple #1
0
        private void MyXml(CLAS.WritRow wr, System.Xml.XmlDocument xd)
        {
            System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='writ' and @id=" + wr.WritID.ToString() + "]");
            if (xe == null)
            {
                xe = xd.CreateElement("toc");
                xe.SetAttribute("type", "writ");
            }
            xe.SetAttribute("id", wr.WritID.ToString());

            string writtypeEng = "";
            string writtypeFre = "";

            if (!wr.IsTypeofWritCodeNull())
            {
                //JLL Yuck ... should move desc to view/dataset
                DataRow[] dr = myA.FM.Codes("TypeofWrit").Select("TypeofWritCode='" + wr.TypeofWritCode + "'", "");
                if (dr.Length == 1)
                {
                    writtypeEng = dr[0]["TypeofWritDescEng"].ToString();
                    writtypeFre = dr[0]["TypeofWritDescFre"].ToString();
                }
            }

            if (!wr.IsIssueRenewalDateNull())
            {
                xe.SetAttribute("titlee", wr.IssueRenewalDate.ToString("yyyy/MM/dd") + " - " + writtypeEng);
                xe.SetAttribute("titlef", wr.IssueRenewalDate.ToString("yyyy/MM/dd") + " - " + writtypeFre);
            }

            if (!wr.IsSheriffJurisdictionNull())
            {
                xe.SetAttribute("tooltipe", wr.SheriffJurisdiction);
                xe.SetAttribute("tooltipf", wr.SheriffJurisdiction);
            }


            if (xe.ParentNode == null)
            {
                System.Xml.XmlNode    xeJudg = xd.SelectSingleNode("//toc[@type='judgment' and @id=" + wr.JudgmentID.ToString() + "]");
                System.Xml.XmlElement xes    = (System.Xml.XmlElement)xeJudg.SelectSingleNode("fld[@type='writs']");

                if (xes == null)
                {
                    xes = xeJudg.OwnerDocument.CreateElement("fld");
                    xes.SetAttribute("type", "writs");
                    xes.SetAttribute("titlee", "Encumbrances");
                    xes.SetAttribute("titlef", "Grèvements");
                    xeJudg.AppendChild(xes);
                }
                xes.AppendChild(xe);
            }
        }
Exemple #2
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            string ObjectName = this.myWritDT.TableName;

            CLAS.WritRow dr = (CLAS.WritRow)ddr;
            switch (dc.ColumnName)
            {
            case "IssueRenewalDate":
                if (dr.IsIssueRenewalDateNull())
                {
                    throw new RequiredException(atriumBE.Properties.Resources.WritIssueRenewalDate);
                }
                if (dr.JudgmentRow.IsJudgmentDateNull())
                {
                    throw new RelatedException(atriumBE.Properties.Resources.WritIssueRenewalDate, atriumBE.Properties.Resources.JudgmentJudgmentDate);
                }
                myA.IsValidDate(atriumBE.Properties.Resources.WritIssueRenewalDate, dr.IssueRenewalDate, false, dr.JudgmentRow.JudgmentDate, DateTime.Today, atriumBE.Properties.Resources.JudgmentJudgmentDate, atriumBE.Properties.Resources.ValidationToday);
                break;

            case "ExpiryDate":
                if (dr.IsExpiryDateNull())
                {
                    throw new RequiredException(atriumBE.Properties.Resources.WritExpiryDate);
                }
                if (dr.IsIssueRenewalDateNull())
                {
                    throw new RelatedException(atriumBE.Properties.Resources.WritExpiryDate, atriumBE.Properties.Resources.WritIssueRenewalDate);
                }
                myA.IsValidDate(atriumBE.Properties.Resources.WritExpiryDate, dr.ExpiryDate, false, dr.IssueRenewalDate, DateTime.Today.AddYears(30), atriumBE.Properties.Resources.WritIssueRenewalDate, atriumBE.Properties.Resources.ValidationThirtyYearsLater);
                break;

            case "ExecutionorRegistrationNumber":
                if (dr.IsExecutionorRegistrationNumberNull())
                {
                    throw new RequiredException(atriumBE.Properties.Resources.WritExecutionorRegistrationNumber);
                }
                break;

            case "OfficeID":
                if (dr.IsOfficeIDNull())
                {
                    throw new RequiredException(atriumBE.Properties.Resources.ResourceManager.GetString(ObjectName + dc.ColumnName));
                }
                else if (!myA.CheckDomain(dr.OfficeID, myA.FM.Codes("officelist")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dc.Table.TableName, "Office List");
                }
                break;

            case "TypeofWritCode":
                if (dr.IsTypeofWritCodeNull())
                {
                    throw new RequiredException(atriumBE.Properties.Resources.ResourceManager.GetString(ObjectName + dc.ColumnName));
                }
                else if (!myA.CheckDomain(dr.TypeofWritCode, myA.FM.Codes("TypeofWrit")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Writ Type");
                }
                break;

            default:
                break;
            }
        }