protected override void AfterUpdate(DataRow dr) { CLAS.CompOfferRow r = (CLAS.CompOfferRow)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 override bool CanDelete(DataRow dr) { bool ok = false; CLAS.CompOfferRow fo = (CLAS.CompOfferRow)dr; atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanDelete(fo.FileID, atSecurity.SecurityManager.Features.CompOffer); if (perm != atSecurity.SecurityManager.LevelPermissions.No) { ok = true; } return(ok); }
private void MyXml(CLAS.CompOfferRow r, System.Xml.XmlDocument xd) { System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='compoffer' and @id=" + r.CompOfferId.ToString() + "]"); if (xe == null) { xe = xd.CreateElement("toc"); xe.SetAttribute("type", "compoffer"); } xe.SetAttribute("id", r.CompOfferId.ToString()); CLAS.CompOfferDetailRow cor = myA.DB.CompOfferDetail.FindByCompOfferDetailId(r.CurrentOfferId); string title = ""; if (r.Active) { title = cor.CompOfferDate.ToString("yyyy/MM/dd") + ": " + cor.CompOfferAmount.ToString("C"); } else { if (!r.IsTermsDefaultedDateNull()) { title = "Terms Defaulted: " + r.TermsDefaultedDate.ToString("yyyy/MM/dd"); } else if (!r.IsTermsFulfilledDateNull()) { title = "Terms Fulfilled: " + r.TermsFulfilledDate.ToString("yyyy/MM/dd"); } else { title = cor.CompOfferDate.ToString("yyyy/MM/dd") + ": Inactive"; } } xe.SetAttribute("titlee", title); xe.SetAttribute("titlef", title); if (xe.ParentNode == null) { System.Xml.XmlElement xes = EFileBE.XmlAddFld(xd, "compoffer", "Compromise Offers", "Offres de règlement", 229); xes.AppendChild(xe); } }
protected override void AfterAdd(DataRow row) { CLAS.CompOfferRow dr = (CLAS.CompOfferRow)row; dr.CompOfferId = this.myA.AtMng.PKIDGet("CompOffer", 1); dr.FileID = myA.FM.CurrentFileId; dr.OfficeId = myA.FM.CurrentFile.LeadOfficeId; dr.Active = true; //jll: can only be one active CompOffer // This fails to save when creating subsequent compoffer records // as i believe multiple getcurrentrow calls in related fields // code causes the update active flags on comp offer records to get reloaded foreach (CLAS.CompOfferRow cdr in myCompOfferDT) { if (cdr.CompOfferId != dr.CompOfferId) { cdr.Active = false; } } }
protected override void AfterAdd(DataRow row) { CLAS.CompOfferDetailRow dr = (CLAS.CompOfferDetailRow)row; dr.CompOfferDetailId = this.myA.AtMng.PKIDGet("CompOfferDetail", 1); dr.FileId = myA.FM.CurrentFileId; dr.CompOfferAmount = 0; dr.InitiatedByDebtor = false; dr.LumpSum = false; //jll: update current compofferdetail to reflect it is refused/rejected. //jll: updating current offer id on parent compoffer row CLAS.CompOfferRow cor = (CLAS.CompOfferRow)myA.GetCompOffer().GetCurrentRow()[0]; if (myCompOfferDetailDT.Count > 1) { CLAS.CompOfferDetailRow[] codr = (CLAS.CompOfferDetailRow[])myCompOfferDetailDT.Select("CompOfferDetailId=" + cor.CurrentOfferId); if (codr[0] != null) { codr[0].RefusedDate = DateTime.Today; } } cor.CurrentOfferId = dr.CompOfferDetailId; }
public override void ApplySecurity(DataRow dr) { CLAS.CompOfferRow cbr = (CLAS.CompOfferRow)dr; UIHelper.EnableControls(atriumDB_CompOfferDataTableBindingSource, FM.GetCLASMng().GetCompOffer().CanEdit(cbr)); UIHelper.EnableCommandBarCommand(tsDelete, FM.GetCLASMng().GetCompOffer().CanDelete(cbr)); }