Esempio n. 1
0
        private void CreateAC(int fileId, int acseriesId, DateTime acDate, string ctxTable, int ctxId)
        {
            ActivityConfig.ACSeriesRow acsr = myA.acMng.DB.ACSeries.FindByACSeriesId(acseriesId);
            FileManager fm = myA.GetFile(fileId);

            ActivityBP abp = fm.InitActivityProcess();

            abp.CreateAC(acseriesId, acDate, ctxTable, ctxId, 0, ACEngine.RevType.Nothing);
        }
Esempio n. 2
0
        private void uiButton1_Click(object sender, EventArgs e)
        {
            try
            {
                //launch Wizard passing ACSeries, ABP?
                NextStep ns = null;
                if (ebStepCode.Tag != null)
                {
                    ns = (NextStep)ebStepCode.Tag;
                }
                if (ns != null)
                {
                    ACEngine test = new ACEngine(fm);
                    test.TestForSteps(ns.acs.ACSeriesId);
                    if (!test.HasAnyRel & (!test.HasDoc | uiCheckBox1.Checked))
                    {
                        atriumBE.ActivityBP abp = fm.InitActivityProcess();
                        if (test.HasDoc)
                        {
                            abp.SkipDoc = uiCheckBox1.Checked;
                        }
                        abp.CreateAC(ns.acs.ACSeriesId, calActivityDate.Value, null, 0, 0, ACEngine.RevType.Nothing);
                        abp.SkipDoc           = false;
                        calActivityDate.Value = DateTime.Today;
                        ebStepCode.Text       = "";
                        ebNSType.Text         = "";
                        Init(fm, ffns);
                        ffns.MoreInfo("activity", abp.LastActivityId.Value);
                        ffns.fileToc.LoadTOC();
                    }
                    else
                    {
                        bool docIsSkipped = false;
                        if (uiCheckBox1.Checked)
                        {
                            docIsSkipped = true;
                        }

                        ebStepCode.Text = "";
                        ebNSType.Text   = "";

                        ffns.ReadOnly = true;
                        if (ns.prevAc != null)
                        {
                            facwr = new fACWizard(fm, (ACEngine.Step)ns.acs.InitialStep, ns.acs.ACSeriesId, ns.prevAc.ActivityId, docIsSkipped);
                        }
                        else
                        {
                            facwr = new fACWizard(fm, (ACEngine.Step)ns.acs.InitialStep, ns.acs.ACSeriesId, docIsSkipped);
                        }
                        facwr.setAcDate(calActivityDate.Value, ns);
                        facwr.Show();
                        calActivityDate.Value = DateTime.Today;
                        DoSkipCheck(null);
                        ffns.HookupWizClose(facwr);
                        ffns.fileToc.LoadTOC();
                    }
                }
                else
                {
                    MessageBox.Show(Properties.Resources.QuickACSelectAValidCode);
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }