Пример #1
0
        private void MyXml(CLAS.CostRow r, System.Xml.XmlDocument xd)
        {
            System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='cost' and @id=" + r.CostID.ToString() + "]");
            if (xe == null)
            {
                xe = xd.CreateElement("toc");
                xe.SetAttribute("type", "cost");
            }
            xe.SetAttribute("id", r.CostID.ToString());
            //xe.SetAttribute("judgmentid", wr.JudgmentID.ToString());
            //xe.SetAttribute("officeid",wr.OfficeID.ToString());
            //xe.SetAttribute("postjudgmentactivitycode", wr.PostJudgmentActivityCode.ToString());
            string costdate   = "[Cost Date Missing]";
            string costamount = "";

            if (!r.IsCostDateNull())
            {
                costdate = r.CostDate.ToString("yyyy/MM/dd");
            }

            if (!r.IsCostAmountNull())
            {
                costamount = r.CostAmount.ToString("C");
            }
            xe.SetAttribute("titlee", costdate + " - " + costamount);
            xe.SetAttribute("titlef", costdate + " - " + costamount);

            if (!r.IsPostJudgmentActivityCodeNull())
            {
                //JLL Yuck ... should move desc to view/dataset
                DataRow[] dr = myA.FM.Codes("PostJudgmentActivity").Select("PostJudgmentActivityCode='" + r.PostJudgmentActivityCode + "'", "");
                if (dr.Length == 1)
                {
                    xe.SetAttribute("tooltipe", dr[0]["PostJudgmentActivityDescEng"].ToString());
                    xe.SetAttribute("tooltipf", dr[0]["PostJudgmentActivityDescFre"].ToString());
                }
            }

            if (xe.ParentNode == null)
            {
                System.Xml.XmlNode    xeJudg = xd.SelectSingleNode("//toc[@type='judgment' and @id=" + r.JudgmentID.ToString() + "]");
                System.Xml.XmlElement xes    = (System.Xml.XmlElement)xeJudg.SelectSingleNode("fld[@type='costs']");
                if (xes == null)
                {
                    xes = xeJudg.OwnerDocument.CreateElement("fld");
                    xes.SetAttribute("type", "costs");
                    xes.SetAttribute("titlee", "Costs");
                    xes.SetAttribute("titlef", "Coûts");
                    xeJudg.AppendChild(xes);
                }
                xes.AppendChild(xe);
            }
        }
Пример #2
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            CLAS.CostRow dr = (CLAS.CostRow)ddr;
            switch (dc.ColumnName)
            {
            case CostFields.CostAmount:
                if (dr.IsCostAmountNull() || dr.CostAmount <= 0)
                {
                    throw new AtriumException(Resources.MustBeGreaterThanZero, Resources.CostCostAmount);
                }
                break;

            case CostFields.RateType:
                if (dr.IsNull(dc))
                {
                    throw new RequiredException(Resources.ResourceManager.GetString("Cost" + dc.ColumnName));
                }
                else if (!myA.CheckDomain(dr.RateType, myA.FM.Codes("InterestRateType")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Interest Rate Type");
                }
                break;

            case CostFields.InterestRate:
            case CostFields.CostDate:
                if (dr.IsNull(dc))
                {
                    throw new RequiredException(Resources.ResourceManager.GetString("Cost" + dc.ColumnName));
                }
                break;

            case CostFields.PostJudgmentActivityCode:
                if (dr.IsNull(dc))
                {
                    throw new RequiredException(Resources.ResourceManager.GetString("Cost" + dc.ColumnName));
                }
                else if (!myA.CheckDomain(dr.PostJudgmentActivityCode, myA.FM.Codes("PostJudgmentActivity")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Post Judgment Activity Type");
                }
                break;

            default:
                break;
            }
        }