//TFS #59851 JLL: 2013-11-29. For sstcasematter control public override bool CanDelete(DataRow dr) { SST.SSTCaseMatterRow sstcmr = (SST.SSTCaseMatterRow)dr; bool canDelete = myA.AtMng.SecurityManager.CanDelete(sstcmr.FileId, atSecurity.SecurityManager.Features.SSTCaseMAtter) > atSecurity.SecurityManager.LevelPermissions.No; return(canDelete); }
protected override void BeforeChange(DataColumn dc, DataRow row) { SST.SSTCaseMatterRow dr = (SST.SSTCaseMatterRow)row; switch (dc.ColumnName) { case "IssueId": if (dr.IsNull(dc)) { throw new RequiredException(dc.ColumnName); } break; //TFS#56157 BY 2013-9-20 case "OutcomeId": SST.SSTCaseRow cr = dr.SSTCaseRow; if (!cr.IsDecisionDateNull() && (dr.IsNull(dc))) { throw new RequiredException(dc.ColumnName); } break; case "AcceptIssue": if (dr.IsAcceptIssueNull()) { dr.AcceptIssue = false; } break; } }
private bool CheckRowAttached(SST.SSTCaseMatterRow row) { if (row.RowState != DataRowState.Deleted && row.RowState != DataRowState.Detached) { return(true); } return(false); }
protected override void AfterAdd(DataRow row) { SST.SSTCaseMatterRow dr = (SST.SSTCaseMatterRow)row; string ObjectName = this.mySSTCaseMatterDT.TableName; dr.SSTCaseMatterId = myA.AtMng.PKIDGet(ObjectName, 10); dr.FileId = myA.FM.CurrentFileId; dr.SSTCaseId = myA.DB.SSTCase[0].SSTCaseId; //WI 92073 - ensures SSTCaseId is set if (dr.SSTCaseRow != null && !dr.SSTCaseRow.IsProgramIdNull()) { dr.ProgramId = dr.SSTCaseRow.ProgramId; } // dr.ConfirmedByMemberId = 0; dr.AcceptIssue = false; }
protected override void AfterChange(DataColumn dc, DataRow row) { SST.SSTCaseMatterRow dr = (SST.SSTCaseMatterRow)row; switch (dc.ColumnName) { case "IssueId": //set legislation if (!dr.IsIssueIdNull()) { appDB.IssueRow ir = myA.AtMng.DB.Issue.FindByIssueId(dr.IssueId); if (!ir.IsLegProvisionIdNull()) { dr.LegislationId = ir.LegProvisionId; dr.EndEdit(); } } break; } }
private void CreateAppeal(int fileAppealedId) { FileManager fmOrig = myA.AtMng.GetFile(fileAppealedId); SSTManager sstOrig = fmOrig.GetSSTMng(); SST.SSTCaseRow scr = mySSTCaseDT[0]; //copy sstcasematter if (!sstOrig.DB.SSTCase[0].IsDecisionSentDateNull()) { scr.OrigDecisionDate = sstOrig.DB.SSTCase[0].DecisionSentDate; } //is leave to app0eal required!! if (sstOrig.DB.SSTCase[0].OutcomeId == 5 || sstOrig.DB.SSTCase[0].OutcomeId == 18) { scr.LeaveToAppealNotRequired = true; } else { scr.LeaveToAppealNotRequired = false; } scr.ProgramId = sstOrig.DB.SSTCase[0].ProgramId; if (!sstOrig.DB.SSTCase[0].IsAccountIdNull()) { scr.AccountId = sstOrig.DB.SSTCase[0].AccountId; } foreach (SST.SSTCaseMatterRow scmr in sstOrig.DB.SSTCaseMatter) { SST.SSTCaseMatterRow newScmr = (SST.SSTCaseMatterRow)myA.GetSSTCaseMatter().Add(scr); if (!scmr.IsIssueIdNull()) { newScmr.IssueId = scmr.IssueId; } if (!scmr.IsAccountIdNull()) { newScmr.AccountId = scmr.AccountId; } newScmr.ProgramId = scmr.ProgramId; } //copy contacts/parties foreach (atriumDB.FileContactRow fcr in fmOrig.DB.FileContact) { if (fcr.ContactClass == "P") { atriumDB.FileContactRow newFcr = (atriumDB.FileContactRow)myA.FM.GetFileContact().Add(myA.FM.CurrentFile); newFcr.ContactId = fcr.ContactId; newFcr.ContactType = fcr.ContactType; SST.FilePartyRow fpr = (SST.FilePartyRow)sstOrig.DB.FileParty.Select("Filecontactid=" + fcr.FileContactid.ToString())[0]; SST.FilePartyRow newFpr = (SST.FilePartyRow)myA.GetFileParty().Add(scr); newFpr.IsAppellant = fpr.IsAppellant; newFpr.IsRespondent = fpr.IsRespondent; newFpr.IsPending = true; newFpr.FileContactId = newFcr.FileContactid; } } }
protected override void BeforeUpdate(DataRow row) { SST.SSTCaseMatterRow dr = (SST.SSTCaseMatterRow)row; BeforeChange(mySSTCaseMatterDT.IssueIdColumn, dr); //TFS#56157 BY 2013-9-20 BeforeChange(mySSTCaseMatterDT.OutcomeIdColumn, dr); BeforeChange(mySSTCaseMatterDT.AcceptIssueColumn, dr); //add or update filexref for issue if (!dr.IsIssueIdNull()) { appDB.IssueRow ir = myA.AtMng.DB.Issue.FindByIssueId(dr.IssueId); if (dr.RowState == DataRowState.Added && !ir.IsFileIdNull()) { if (!XrefExists(ir.FileId)) { atriumDB.FileXRefRow fxr = (atriumDB.FileXRefRow)myA.FM.GetFileXRef().Add(myA.FM.CurrentFile); fxr.LinkType = 1; fxr.OtherFileId = ir.FileId; fxr.Rollup = false; fxr.FullFileNumber = myA.FM.EFile.Load(ir.FileId, false).FullFileNumber; } } else if (myA.IsFieldChanged(mySSTCaseMatterDT.IssueIdColumn, dr)) { int origIssueId = (int)dr[mySSTCaseMatterDT.IssueIdColumn, DataRowVersion.Original]; appDB.IssueRow origIr = myA.AtMng.DB.Issue.FindByIssueId(origIssueId); var fxrq = from f in myA.FM.DB.FileXRef where f.OtherFileId == origIr.FileId & f.LinkType == 1 select f; if (fxrq.Count() > 0) // if false, no issue found. { atriumDB.FileXRefRow fxr = fxrq.Single(); if (ir.IsFileIdNull()) { fxr.Delete(); } else { if (XrefExists(ir.FileId)) { fxr.Delete(); } else { //check List <int> files = new List <int>(); foreach (SST.SSTCaseMatterRow scmr in mySSTCaseMatterDT) { if (!scmr.IsIssueIdNull() && scmr.SSTCaseMatterId != dr.SSTCaseMatterId) { appDB.IssueRow ir1 = myA.AtMng.DB.Issue.FindByIssueId(scmr.IssueId); if (!ir1.IsFileIdNull()) { files.Add(ir1.FileId); } } } if (files.Contains(fxr.OtherFileId)) { //another issue uses that xref so add a new xref and don't change the current one atriumDB.FileXRefRow fxr1 = (atriumDB.FileXRefRow)myA.FM.GetFileXRef().Add(myA.FM.CurrentFile); fxr1.LinkType = 1; fxr1.OtherFileId = ir.FileId; fxr1.Rollup = false; fxr1.FullFileNumber = myA.FM.EFile.Load(ir.FileId, false).FullFileNumber; } else { fxr.OtherFileId = ir.FileId; } } } } else // no issue found, so no xref to update; add a new xref. { atriumDB.FileXRefRow fxr1 = (atriumDB.FileXRefRow)myA.FM.GetFileXRef().Add(myA.FM.CurrentFile); fxr1.LinkType = 1; fxr1.OtherFileId = ir.FileId; fxr1.Rollup = false; fxr1.FullFileNumber = myA.FM.EFile.Load(ir.FileId, false).FullFileNumber; } } } }