public void bindOpinionData(lmDatasets.Advisory.OpinionDataTable a) { ucMultiDropDown1.SetDataBinding(FM.Codes("LawyerList"), ""); UIHelper.ComboBoxInit("OpinionType", mccOpinionType, FM); ucContactSelectBox1.FM = FM; ucOfficeSelectBox1.AtMng = FM.AtMng; this.opinionBindingSource.DataSource = a.DataSet; this.opinionBindingSource.DataMember = a.TableName; atriumBE.DocManager dm = FM.GetDocMng(); OpenDocDialog = ((fMain)Application.OpenForms["fMain"]).OpenDocDialog; //ucDoc1.OpenDocDialog = ((fMain)Application.OpenForms["fMain"]).OpenDocDialog; //ucDoc1.Init(dm); ucDocView1.OpenDocDialog = ((fMain)Application.OpenForms["fMain"]).OpenDocDialog; ucDocView1.Init(dm); Advisory.OpinionRow or = CurrentRow(); LoadDocs(or); a.ColumnChanged += new DataColumnChangeEventHandler(a_ColumnChanged); FM.GetAdvisoryMng().GetOpinion().OnUpdate += new atLogic.UpdateEventHandler(ucOpinion_OnUpdate); ApplySecurity(CurrentRow()); }
protected override void BeforeUpdate(DataRow dr) { this.BeforeChange(dr.Table.Columns["Subject"], dr); this.BeforeChange(dr.Table.Columns["RequestDate"], dr); this.BeforeChange(dr.Table.Columns["Number"], dr); Advisory.OpinionRow or = (Advisory.OpinionRow)dr; if (!or.IsCompletedDateNull() && !or.IsDocIdNull()) { //mark opinion read-only docDB.DocumentRow odoc = myA.FM.GetDocMng().DB.Document.FindByDocId(or.DocId); if (odoc == null) { odoc = myA.FM.GetDocMng().GetDocument().Load(or.DocId); } // 2013-06-12 JLL: update to use isDraft only odoc.IsDraft = false; //docDB.DocContentRow odcc = myA.FM.GetDocMng().DB.DocContent.FindByDocId(or.DocId); //if (odcc == null) // odcc = myA.FM.GetDocMng().GetDocContent().Load(or.DocId); //if (!odcc.ReadOnly) // odcc.ReadOnly = true; } }
//public override DataRow[] GetParentRow() //{ // return new DataRow[]{this.myA.FM.CurrentFile}; //} protected override void AfterUpdate(DataRow dr) { Advisory.OpinionRow fcr = (Advisory.OpinionRow)dr; System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); xd.InnerXml = myA.FM.CurrentFile.FileStructXml; MyXml(fcr, xd); myA.FM.CurrentFile.FileStructXml = xd.InnerXml; }
public override void ApplySecurity(DataRow dr) { if (FileForm() != null && FileForm().ReadOnly) { return; } Advisory.OpinionRow cbr = (Advisory.OpinionRow)dr; UIHelper.EnableControls(opinionBindingSource, FM.GetAdvisoryMng().GetOpinion().CanEdit(cbr)); UIHelper.EnableCommandBarCommand(tsDelete, FM.GetAdvisoryMng().GetOpinion().CanDelete(cbr)); }
private void opinionBindingSource_CurrentChanged(object sender, EventArgs e) { try { Advisory.OpinionRow dr = CurrentRow(); if (dr == null) { return; } ApplySecurity(dr); } catch (Exception x) { UIHelper.HandleUIException(x); } }
protected override void AfterAdd(DataRow row) { Advisory.OpinionRow dr = (Advisory.OpinionRow)row; string ObjectName = this.myOpinionDT.TableName; dr.OpinionId = myA.AtMng.PKIDGet(ObjectName, 10); dr.FileId = myA.FM.CurrentFileId; dr.OpinionTypeId = 1; //assume opnion is being create from an email ? //through the relbp add method //atriumDB.ActivityRow prevac= myA.InitActivityProcess(true).CurrentACE.prevAcRow; //if(prevac!=null && !prevac.IsDocIdNull()) //{ // dr.RequestDocId = prevac.DocId; //} }
private void LoadDocs(Advisory.OpinionRow opnrow) { if (!opnrow.IsDocIdNull()) { dvOpinion = LoadDoc(opnrow.DocId, true); } if (!opnrow.IsRequestDocIdNull()) { dvRequest = LoadDoc(opnrow.RequestDocId, false); } if (HasOpinionDoc) { DisplayDoc(dvOpinion); tsShowOpinion.Enabled = Janus.Windows.UI.InheritableBoolean.True; tsShowOpinion.IsChecked = true; tsShowRequest.IsChecked = false; if (!HasRequestDoc) { tsShowRequest.Enabled = Janus.Windows.UI.InheritableBoolean.False; } } else { tsShowOpinion.Enabled = Janus.Windows.UI.InheritableBoolean.False; if (!HasRequestDoc) { tsShowRequest.Enabled = Janus.Windows.UI.InheritableBoolean.False; pnlDoc.Closed = true; } else { DisplayDoc(dvRequest); tsShowRequest.IsChecked = true; } } }
protected override void AfterChange(DataColumn dc, DataRow dr) { Advisory.OpinionRow or = (Advisory.OpinionRow)dr; switch (dc.ColumnName) { case "DueDate": //maintain bfdate myA.FM.GetActivityBF().MaintainBFDate(or.OpinionId, "Opinion", "OPINIONDUEDATE", or.DueDate); break; case "ReceivedDate": if (or.IsDueDateNull()) { or.DueDate = or.ReceivedDate.AddDays(35); myA.FM.GetActivityBF().MaintainBFDate(or.OpinionId, "Opinion", "OPINIONDUEDATE", or.DueDate); } break; //case "CompletedDate": // if (!or.IsCompletedDateNull() && !or.IsDocIdNull()) // { // //mark opinion read-only // docDB.DocumentRow odoc = myA.FM.GetDocMng().DB.Document.FindByDocId(or.DocId); // if (odoc == null) // odoc=myA.FM.GetDocMng().GetDocument().Load(or.DocId); // docDB.DocContentRow odcc = myA.FM.GetDocMng().DB.DocContent.FindByDocId(or.DocId); // if (odcc == null) // odcc = myA.FM.GetDocMng().GetDocContent().Load(or.DocId); // if(!odcc.ReadOnly) // odcc.ReadOnly = true; // } // break; default: break; } }
private void MyXml(Advisory.OpinionRow r, System.Xml.XmlDocument xd) { System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='opinion' and @id=" + r.OpinionId.ToString() + "]"); if (xe == null) { xe = xd.CreateElement("toc"); xe.SetAttribute("type", "opinion"); } xe.SetAttribute("id", r.OpinionId.ToString()); //if(! r.IsOfficerCodeNull()) // xe.SetAttribute("assignedtocode",r.OfficerCode.ToString()); string title = ""; if (!r.IsNumberNull()) { title = r.Number.ToString(); } if (!r.IsCompletedDateNull()) { title += "(" + atriumRes.OpinionCompletedDate + ": " + r.CompletedDate.ToString("yyyy/MM/dd") + ")"; } else if (!r.IsRequestDateNull()) { title += atriumRes.OpinionRequestDate + ": " + r.RequestDate.ToString("yyyy/MM/dd"); } xe.SetAttribute("titlee", title); xe.SetAttribute("titlef", title); if (xe.ParentNode == null) { System.Xml.XmlElement xes = EFileBE.XmlAddFld(xd, "opinions", "Opinions", "Opinions", 150); xes.AppendChild(xe); } }
protected override void BeforeChange(DataColumn dc, DataRow ddr) { Advisory.OpinionRow dr = (Advisory.OpinionRow)ddr; string ObjectName = this.myOpinionDT.TableName; switch (dc.ColumnName) { case "AssignedToId": //JLL 2018-04-23 //commented out lawyer list rule for demo //if (!myA.CheckDomain(dr.AssignedToId,myA.FM.Codes("LawyerList"))) // throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, "Assigned To",dr.Table.TableName,"Lawyer List"); break; case "RequestDocId": if (dr.IsRequestContactIdNull()) { //myA.FM.GetDocMng().GetRecipient().LoadByDocId(dr.RequestDocId); docDB.RecipientRow[] rs = (docDB.RecipientRow[])myA.FM.GetDocMng().DB.Recipient.Select("Type='0' and DocId=" + dr.RequestDocId.ToString()); if (rs.Length == 1 && rs[0].Address != rs[0].Name) { atriumDB.FileContactRow fcr = myA.FM.GetDocMng().GetRecipient().AddRecipToFile(rs[0], false, "FCC"); if (!fcr.IsOfficeIdNull()) { dr.RequestOfficeId = fcr.OfficeId; } dr.RequestContactId = fcr.ContactId; } } break; case "ReceivedDate": if (dr.IsReceivedDateNull()) { throw new RequiredException(Resources.OpinionReceivedDate); } //if(dr.EFileRow.IsOpenedDateNull()) // this.myA.RaiseError(AtriumEnum.AppErrorCodes.RelatedDateRequired, myA.GetLabelLeft(ObjectName, dc.ColumnName), myA.GetLabelLeft("Efile", "ReceivedByJusticeDate")); myA.IsValidDate(Resources.OpinionReceivedDate, dr.ReceivedDate, false, DateTime.MinValue, DateTime.Today, Resources.ValidationTheBeginning, Resources.ValidationToday); break; case "RequestDate": if (dr.IsRequestDateNull()) { throw new RequiredException(Resources.OpinionRequestDate); } myA.IsValidDate(Resources.OpinionRequestDate, dr.RequestDate, false, DateTime.MinValue, DateTime.Today, Resources.ValidationTheBeginning, Resources.ValidationToday); break; case "AssignedDate": if (!dr.IsAssignedDateNull()) { if (dr.IsRequestDateNull()) { throw new RelatedException(Resources.OpinionAssignedDate, Resources.OpinionRequestDate); } myA.IsValidDate(Resources.OpinionAssignedDate, dr.AssignedDate, true, dr.RequestDate, DateTime.Today, Resources.OpinionRequestDate, Resources.ValidationToday); } break; case "DueDate": if (!dr.IsDueDateNull()) { if (dr.IsAssignedDateNull()) { throw new RelatedException(Resources.OpinionDueDate, Resources.OpinionAssignedDate); } myA.IsValidDate(Resources.OpinionDueDate, dr.DueDate, true, dr.AssignedDate, DateTime.Today.AddMonths(6), Resources.OpinionAssignedDate, Resources.ValidationSixMonthsFromNow); } break; case "CompletedDate": if (!dr.IsCompletedDateNull()) { if (dr.IsAssignedDateNull()) { throw new RelatedException(Resources.OpinionCompletedDate, Resources.OpinionAssignedDate); } myA.IsValidDate(Resources.OpinionCompletedDate, dr.CompletedDate, true, dr.AssignedDate, DateTime.Today, Resources.OpinionAssignedDate, Resources.ValidationToday); } break; case "Subject": //case "Number": if (dr.IsNull(dc)) { throw new RequiredException(Resources.ResourceManager.GetString(ObjectName + dc.ColumnName)); } break; case "OpinionTypeId": if (!myA.CheckDomain(dr.OpinionTypeId, myA.FM.Codes("OpinionType"))) { throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Opinion Type"); } break; default: break; } }