Esempio n. 1
0
        public void DoAutoAC(NextStep ns, ActivityConfig.ACSeriesRow asr, int revId, ACEngine.RevType revType, DateTime acDate)
        {
            try
            {
                if (ns == null)
                {
                    AutoAC(null, asr, revId, revType, acDate, null, true);
                }
                else
                {
                    AutoAC(ns.prevAc, asr, revId, revType, acDate, ns.FlowQ, true);
                }

                CurrentACE = null;

                FM.GetDocMng().DB.DocContent.AcceptChanges();
            }
            catch (Exception xx)
            {
                if (CurrentACE != null)
                {
                    CurrentACE.Cancel();
                }
                CurrentACE = null;

                throw xx;
            }
        }
Esempio n. 2
0
        public override void Save()
        {
            if (FM.GetAdvisoryMng().DB.Opinion.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(FM.DB);
            }
            else
            {
                try
                {
                    this.opinionBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetAdvisoryMng().GetOpinion());
                    bp.AddForUpdate(FM.GetDocMng().GetDocument());
                    bp.AddForUpdate(FM.GetDocMng().GetDocContent());
                    bp.AddForUpdate(FM.GetActivityBF());
                    bp.AddForUpdate(FM.EFile);
                    bp.Update();



                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
                catch (Exception x)
                {
                    throw x;
                }
            }
        }
Esempio n. 3
0
        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());
        }
Esempio n. 4
0
        private int UploadFile()
        {
            try
            {
                if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    string f = this.openFileDialog1.FileName;

                    docDB.DocumentRow newDoc = (docDB.DocumentRow)FM.GetDocMng().GetDocument().Add(FM.CurrentFile, f);

                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetDocMng().GetDocContent());
                    bp.AddForUpdate(FM.GetDocMng().GetDocument());

                    bp.Update();

                    return(newDoc.DocId);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
Esempio n. 5
0
        public override void Save()
        {
            if (FM.GetDocMng().DB.Document.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(FM.DB);
            }
            else
            {
                try
                {
                    //ucDocPreview1.EndEdit();
                    ucDocView1.EndEdit();

                    this.documentBindingSource.EndEdit();

                    FM.SaveAll();
                    //atLogic.BusinessProcess bp = FM.GetBP();
                    //bp.AddForUpdate(FM.GetDocMng().GetDocContent());
                    //bp.AddForUpdate(FM.GetDocMng().GetDocument());
                    //bp.AddForUpdate(FM.GetDocMng().GetRecipient());
                    //bp.Update();

                    ApplyBR(true);

                    //ReloadUserControlData();
                }
                catch (Exception x)
                {
                    throw x;
                }
            }
        }
Esempio n. 6
0
        public void ApplyDocSecurity(DataRow dr)
        {
            if (FileForm() != null && FileForm().ReadOnly)
            {
                return;
            }

            if (dr != null)
            {
                docDB.DocumentRow cbr = (docDB.DocumentRow)dr;
                UIHelper.EnableControls(documentBindingSource, FM.GetDocMng().GetDocument().CanEdit(cbr));
            }
        }
Esempio n. 7
0
        private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
        {
            try
            {
                switch (e.Command.Key)
                {
                case "tsTestCAL":
                    FileForm().GetUcCtlToc("appointment");
                    break;

                case "tsDump":
                    string file = FM.AtMng.AppMan.LawMatePath + FM.CurrentFile.FileId.ToString();
                    FM.DB.WriteXml(file + "_atriumDB.xml");
                    FM.GetDocMng().DB.WriteXml(file + "_docDB.xml");
                    break;

                case "tsSecurity":
                    FileForm().GetUcCtlToc("security");
                    break;

                case "cmdFileAccess":
                    FileForm().GetUcCtlToc("fileaccess");
                    break;

                case "tsSave":
                    Save();
                    break;

                case "tsDelete":
                    Delete();
                    break;

                case "tsResetFileStruct":
                    //FM.EFile.RebuildFileStruct(FM.CurrentFile);
                    //Save();
                    FileForm().ReloadFileData();
                    fFile pfile = (fFile)this.ParentForm;
                    pfile.fileToc.LoadTOC();
                    break;

                case "tsAudit":
                    fData fAudit = new fData(CurrentRow());
                    fAudit.Show();
                    break;
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
Esempio n. 8
0
        private DataView LoadDoc(int docid, bool isOpnDoc)
        {
            FM.GetDocMng().GetDocument().Load(docid);
            docDB.DocumentRow[] dr = (docDB.DocumentRow[])FM.GetDocMng().DB.Document.Select("DocId=" + docid.ToString());
            DataView            dv = new DataView(dr[0].Table, "DocId=" + dr[0].DocId.ToString(), "", DataViewRowState.CurrentRows);

            if (isOpnDoc)
            {
                HasOpinionDoc = true;
            }
            else
            {
                HasRequestDoc = true;
            }

            return(dv);
        }
Esempio n. 9
0
        private void AutoAC(atriumDB.ActivityRow prevAC, ActivityConfig.ACSeriesRow asr, int revId, ACEngine.RevType revType, DateTime acDate, Stack <ParentChildStep> _flowQ, bool recurse)
        {
            FileManager fmp = FM;

            try
            {
                if (asr.InitialStep == (int)ACEngine.Step.CreateFile)
                {
                    myFM   = FM.AtMng.CreateFile(fmp);
                    prevAC = null;
                    revId  = 0;
                }


                ACEngine             ace;
                atriumDB.ActivityRow newAC;
                DoACAllSteps(prevAC, asr, revId, revType, acDate, out ace, out newAC, _flowQ, null);
                LastActivityId = newAC.ActivityId;
                FM.GetActivity().CalculateBF(newAC, revId != 0, false);
                if (PrototypeAC != null)
                {
                    if (!PrototypeAC.IsActivityCommentNull())
                    {
                        newAC.ActivityComment = PrototypeAC.ActivityComment;
                    }
                    //copy user bfs
                    foreach (atriumDB.ActivityBFRow abfr in PrototypeAC.GetActivityBFRows())
                    {
                        if (abfr.ACBFId == ActivityBFBE.USERBFID)
                        {
                            atriumDB.ActivityBFRow newabfr = (atriumDB.ActivityBFRow)FM.GetActivityBF().Add(newAC);
                            newabfr.BFDate        = abfr.BFDate;
                            newabfr.InitialBFDate = abfr.InitialBFDate;
                            if (!abfr.IsBFCommentNull())
                            {
                                newabfr.BFComment = abfr.BFComment;
                            }
                            newabfr.BFType      = abfr.BFType;
                            newabfr.BFOfficerID = abfr.BFOfficerID;
                        }
                    }
                }
                ace.Save(true, false);

                FM.GetDocMng().GetDocument().Send(newAC);

                //recurse to allow nested files
                if (recurse)
                {
                    AutoNextStep(newAC);
                }
            }
            catch (Exception x)
            {
                myFM = fmp;
                throw x;
            }
            finally
            {
                myFM = fmp;
            }
        }
Esempio n. 10
0
        private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
        {
            try
            {
                Janus.Windows.UI.CommandBars.UICommandBar bar = uiCommandManager1.CommandBars["cbMergeToolbar"];
                if (bar.Commands.Contains(e.Command.Key) && bar.Commands[e.Command.Key].Commands.Count > 0)
                {
                    bar.Commands[e.Command.Key].Expand();
                }


                switch (e.Command.Key)
                {
                case "cmdFieldSelector":
                    ucRecordList1.RecordsGridEx.ShowFieldChooser(this.ParentForm, LawMate.Properties.Resources.FieldSelector);
                    break;

                case "tsFilter":
                    if (e.Command.IsChecked)
                    {
                        ucRecordList1.RecordsGridEx.FilterMode = Janus.Windows.GridEX.FilterMode.Automatic;
                    }
                    else
                    {
                        ucRecordList1.RecordsGridEx.FilterMode = Janus.Windows.GridEX.FilterMode.None;
                    }
                    break;

                case "tsGroupBy":
                    if (e.Command.IsChecked)
                    {
                        ucRecordList1.RecordsGridEx.GroupByBoxVisible = true;
                    }
                    else
                    {
                        ucRecordList1.RecordsGridEx.RootTable.Groups.Clear();
                        ucRecordList1.RecordsGridEx.GroupByBoxVisible = false;
                    }
                    break;

                case "cmdClone":
                    myDM.GetDocument().MakeCopy(CurrentRow(), FM.CurrentFile, true);
                    break;

                case "tsTemplate":
                    FileForm().GetUcCtlToc("template");

                    break;

                case "cmdRevise":
                    lmWinHelper.ReviseDocument(FM, CurrentRow().DocId);
                    break;

                case "tsPrint":
                    //ucDocPreview1.Print();
                    ucDocView1.Print();
                    break;

                case "tsPrintPreview":
                    //ucDocPreview1.PrintPreview();
                    ucDocView1.PrintPreview();
                    break;

                case "tsAdd":
                    //new activity
                    NewDoc(FM.AtMng.GetSetting(AppIntSetting.NewDocAcId));
                    break;

                case "tsAddRec":
                    //new activity
                    NewDoc(FM.AtMng.GetSetting(AppIntSetting.NewRecordAcId));
                    break;

                case "tsSend":
                    docDB.DocumentRow drc = CurrentRow();
                    if (drc.IsDraft)
                    {
                        drc = FM.GetDocMng().GetDocument().MakeCopy(CurrentRow(), FM.CurrentFile, false);
                    }

                    lmWinHelper.NewMail(FM, drc.DocId);
                    break;

                case "tsCopy":
                    StartCopy();

                    break;

                case "tsExport":
                    myDM.AtMng.Export("f.openeddate>'2011-1-1'");
                    break;

                case "tsCheckout":
                    CheckOut();
                    break;

                case "tsCheckin":

                    CheckIn();

                    break;

                case "tsUndoCheckout":
                    docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)documentBindingSource.Current).Row;
                    ucDocView1.Clear();
                    //ucDocPreview1.Clear();
                    myDM.GetDocument().UndoCheckout(dr);
                    CheckoutToggle(dr);
                    ucDocView1.Preview();
                    //ucDocPreview1.Preview();
                    break;

                case "tsPreviewPane":
                    HidePreviewPane(tsPreviewPane.IsChecked);
                    break;

                case "tsSave":
                    Save();
                    break;

                case "tsAudit":
                    fData fAudit = new fData(CurrentRow());
                    fAudit.Show();
                    break;

                case "cmdJumpToActivity":
                    if (e.Command.Tag != null)
                    {
                        FileForm().MoreInfo("activity", (int)e.Command.Tag);
                    }
                    break;
                }

                if (e.Command.Key.StartsWith("cmdActivityMoreInfo"))
                {
                    FileForm().MoreInfo("activity", (int)e.Command.Tag);
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }