示例#1
0
        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;
            }
        }
示例#2
0
        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;
                }
            }
        }