public override void MoreInfo(string linkTable, int linkId) { switch (linkTable.ToLower()) { case "writ": CLAS.WritRow wr = FM.GetCLASMng().DB.Writ.FindByWritID(linkId); atriumDB_JudgmentDataTableBindingSource.Position = atriumDB_JudgmentDataTableBindingSource.Find("JudgmentID", wr.JudgmentID); atriumDB_WritDataTableBindingSource.Position = atriumDB_WritDataTableBindingSource.Find("WritID", linkId); uiTab1.SelectedTab = uiTabPage2; pnlAllContainer.ScrollControlIntoView(uiTabPage2); break; case "cost": CLAS.CostRow cr = FM.GetCLASMng().DB.Cost.FindByCostID(linkId); atriumDB_JudgmentDataTableBindingSource.Position = atriumDB_JudgmentDataTableBindingSource.Find("JudgmentID", cr.JudgmentID); atriumDB_CostDataTableBindingSource.Position = atriumDB_CostDataTableBindingSource.Find("CostID", linkId); uiTab1.SelectedTab = uiTabPage3; pnlAllContainer.ScrollControlIntoView(uiTabPage3); break; default: atriumDB_JudgmentDataTableBindingSource.Position = atriumDB_JudgmentDataTableBindingSource.Find("JudgmentID", linkId); uiTab1.SelectedTab = uiTabPage1; navId = linkId; break; } ApplySecurity(CurrentRow()); ApplyBRJudgment(); }
protected override void BeforeUpdate(DataRow ddr) { CLAS.CostRow dr = (CLAS.CostRow)ddr; this.BeforeChange(CostFields.CostAmount, dr); this.BeforeChange(CostFields.CostDate, dr); this.BeforeChange(CostFields.InterestRate, dr); this.BeforeChange(CostFields.PostJudgmentActivityCode, dr); this.BeforeChange(CostFields.RateType, dr); }
protected override void AfterUpdate(DataRow dr) { CLAS.CostRow r = (CLAS.CostRow)dr; System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); xd.InnerXml = myA.FM.CurrentFile.FileStructXml; MyXml(r, xd); myA.FM.CurrentFile.FileStructXml = xd.InnerXml; //myA.EFile.Update(); }
public void ApplyCostSecurity(DataRow dr) { if (dr != null) { CLAS.CostRow jr = (CLAS.CostRow)dr; UIHelper.EnableControls(atriumDB_CostDataTableBindingSource, FM.GetCLASMng().GetCost().CanEdit(jr)); bool canDelete = FM.GetCLASMng().GetCost().CanDelete(jr); costGridEX.RootTable.Columns["colDelete"].Visible = canDelete; } }
protected override void AfterAdd(DataRow row) { CLAS.CostRow dr = (CLAS.CostRow)row; string ObjectName = this.myCostDT.TableName; dr.CostID = this.myA.AtMng.PKIDGet(ObjectName, 1); dr.FileID = dr.JudgmentRow.FileID;// this.myA.FM.CurrentFile.FileId; dr.CostDate = DateTime.Today; dr.Recoverable = true; dr.CostType = "1"; }
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); } }
public override bool CanDelete(DataRow dr) { bool ok = false; CLAS.CostRow fo = (CLAS.CostRow)dr; atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanDelete(myA.FM.CurrentFileId, atSecurity.SecurityManager.Features.Cost); if (perm != atSecurity.SecurityManager.LevelPermissions.No) { ok = true; } return(ok); }
private void costBindingSource_CurrentChanged(object sender, EventArgs e) { try { //call applycost security and provide current row CLAS.CostRow dr = CurrentRowCost(); ApplyCostSecurity(dr); } catch (Exception x) { UIHelper.HandleUIException(x); } }
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; } }