コード例 #1
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());
        }
コード例 #2
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            try
            {
                List <DataRow> toAction = UIHelper.GridGetSelectedData(gridFileList);
                toAction.RemoveAll(RemoveSuccess);

                if (toAction.Count > 0 && MessageBox.Show("Are you sure you want to proceed?  You have selected " + toAction.Count.ToString() + " files.", "Mass Activity", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                {
                    string massMailingPath = null;

                    ActivityConfig.ACSeriesRow acsr = SelectedACSeries();
                    ACEngine ace = new ACEngine(fmCurrent);
                    ace.TestForSteps(acsr.ACSeriesId);
                    if (ace.HasDoc && chkConcatenate.Checked)
                    {
                        SaveFileDialog saveFileDialog1 = new SaveFileDialog();
                        saveFileDialog1.Filter   = "rtf files (*.rtf)|*.rtf|All files (*.*)|*.*";
                        saveFileDialog1.FileName = "Merge_" + acsr.StepCode.Replace(".", "") + "_" + DateTime.Today.ToString("yyyyMMdd") + ".rtf";
                        if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                        {
                            massMailingPath = saveFileDialog1.FileName;
                        }
                    }

                    docDB.DocumentRow doc2Copy = null;
                    if (acsr.ACSeriesId == AtMng.GetSetting(AppIntSetting.DocumentCopyAcId))
                    {
                        fBrowseDocs fdoc = ((fMain)Application.OpenForms["fMain"]).OpenDocDialog;
                        massMailingPath = null;
                        if (fdoc.ShowDialog(this) == DialogResult.OK && fdoc.SelectedDocuments() != null)
                        {
                            doc2Copy = fdoc.SelectedDocument;
                        }
                        else
                        {
                            MessageBox.Show("You can't proceed without selecting a document.", "Mass Activity", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                            return;
                        }
                    }

                    //if (ctx != null && ctx.Count > 0)
                    //{
                    //we need to prompt for input
                    //launch wiz for first file to capture user input
                    lmDatasets.appDB.EFileSearchRow efsr = (lmDatasets.appDB.EFileSearchRow)toAction[0];

                    FileManager fmFirst = AtMng.GetFile(efsr.FileId);
                    fACWizard   facw;
                    lmDatasets.atriumDB.ActivityRow newAC = null;
                    if (doc2Copy != null)
                    {
                        docDB.DocumentRow docCopy = fmFirst.GetDocMng().GetDocument().MakeCopy(doc2Copy, fmFirst.CurrentFile, doc2Copy.IsDraft);
                        facw = new fACWizard(fmFirst, ACEngine.Step.Document, acsr.ACSeriesId, docCopy.DocId, "REVISE");
                    }
                    else
                    {
                        facw = new fACWizard(fmFirst, ACEngine.Step.ACInfo, acsr.ACSeriesId);
                    }
                    facw.ctx = ctx;
                    if (facw.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                    {
                        //get newly added activity
                        newAC        = fmFirst.DB.Activity[fmFirst.DB.Activity.Count - 1];
                        efsr.Result  = "Success";
                        efsr.Message = "Prototype activity";
                        efsr.EndEdit();
                        toAction.Remove(efsr);
                    }
                    else
                    {
                        MessageBox.Show("You can't proceed without completing the prototype activity.", "Mass Activity", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        return;
                    }

                    //}

                    using (fWait fProgress = new fWait("Generating activities, please wait"))
                    {
                        AtMng.MassActivity(toAction, acsr, (string)uiTemplate.SelectedValue, massMailingPath, 0, ACEngine.RevType.Document, ctx, doc2Copy, newAC);
                    }
                }
                else if (toAction.Count == 0)
                {
                    MessageBox.Show("No files selected", "Mass Activity", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }