예제 #1
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;
                }
            }
        }
예제 #2
0
        public override void Save()
        {
            if (sstMngr.DB.FileParty.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(sstMngr.DB);
            }
            else
            {
                try
                {
                    filePartyBindingSource.EndEdit();
                    partyBindingSource.EndEdit();
                    addressBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();

                    bp.AddForUpdate(FM.GetFileContact());
                    bp.AddForUpdate(FM.GetPerson());
                    bp.AddForUpdate(FM.GetAddress());
                    bp.AddForUpdate(FM.EFile);
                    bp.Update();



                    ApplyBR(true);
                }
                catch (Exception x)
                {
                    throw x;
                }
            }
        }
예제 #3
0
        public override void Save()
        {
            if (FM.GetCLASMng().DB.CompOffer.HasErrors || FM.GetCLASMng().DB.CompOfferDetail.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(FM.GetCLASMng().DB);
            }
            else
            {
                try
                {
                    atriumDB_CompOfferDataTableBindingSource.EndEdit();
                    atriumDB_CompOfferDetailDataTableBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();

                    bp.AddForUpdate(FM.GetCLASMng().GetCompOffer());
                    bp.AddForUpdate(FM.GetCLASMng().GetCompOfferDetail());
                    bp.AddForUpdate(FM.EFile);

                    bp.Update();

                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
                catch (Exception x)
                {
                    throw x;
                }
            }
        }
예제 #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;
            }
        }
예제 #5
0
        public override void Save()
        {
            if (FM.LeadOfficeMng.DB.Office.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(FM.DB);
            }
            else
            {
                try
                {
                    this.officeBindingSource.EndEdit();
                    this.addressBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.LeadOfficeMng.GetOffice());
                    bp.AddForUpdate(FM.GetAddress());
                    bp.Update();



                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
                catch (Exception x)
                {
                    throw x;
                }
            }
        }
예제 #6
0
        public override void Save()
        {
            if (FM.GetCLASMng().DB.Insolvency.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(FM.GetCLASMng().DB);
            }
            else
            {
                try
                {
                    this.insolvencyBindingSource.EndEdit();
                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetCLASMng().GetInsolvency());
                    bp.AddForUpdate(FM.EFile);
                    bp.Update();
                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
                catch (Exception x)
                {
                    throw x;
                }
            }
        }
예제 #7
0
        public override void Save()
        {
            if (FM.DB.RiskAssessment.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(FM.DB);
            }
            else
            {
                try
                {
                    this.riskAssessmentBindingSource.EndEdit();
                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetRiskAssessment());
                    bp.AddForUpdate(FM.EFile);
                    bp.Update();


                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
                catch (Exception x)
                {
                    UIHelper.HandleUIException(x);
                }
            }
        }
예제 #8
0
        public override void Delete()
        {
            try
            {
                if (UIHelper.ConfirmDelete())
                {
                    CurrentRow().Delete();
                    riskAssessmentBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetRiskAssessment());
                    bp.AddForUpdate(FM.EFile);
                    bp.Update();



                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
예제 #9
0
        public override void Delete()
        {
            try
            {
                if (UIHelper.ConfirmDelete())
                {
                    CurrentRow().Delete();
                    this.opinionBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetAdvisoryMng().GetOpinion());
                    bp.AddForUpdate(FM.EFile);
                    bp.Update();


                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
예제 #10
0
        public override void Save()
        {
            if (FM.GetCLASMng().DB.CBDetail.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(FM.GetCLASMng().DB);
            }
            else
            {
                try
                {
                    cBDetailBindingSource.EndEdit();
                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetCLASMng().GetCBDetail());
                    //    bp.AddForUpdate(FM.EFile);
                    bp.Update();

                    ApplyBR(true);
                    ApplyRowBR();
                }
                catch (Exception x)
                {
                    throw x;
                }
            }
        }
예제 #11
0
        public override void Save()
        {
            if (FM.LeadOfficeMng.DB.Officer.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(FM.LeadOfficeMng.DB);
            }
            else
            {
                try
                {
                    int linkId = CurrentRow().OfficerId;

                    officerDelegateGridEX.UpdateData();
                    officerRoleGridEX.UpdateData();
                    contactEmailGridEX.UpdateData();

                    this.officerBindingSource.EndEdit();
                    this.officerDelegateBindingSource.EndEdit();
                    this.officerRoleBindingSource.EndEdit();
                    this.contactEmailBindingSource.EndEdit();
                    this.memberProfileBindingSource.EndEdit();
                    addressBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();

                    bp.AddForUpdate(FM.LeadOfficeMng.GetOfficer());
                    bp.AddForUpdate(FM.GetAddress());
                    bp.AddForUpdate(FM.LeadOfficeMng.GetOfficerRole());
                    bp.AddForUpdate(FM.LeadOfficeMng.GetOfficerDelegate());
                    bp.AddForUpdate(FM.LeadOfficeMng.GetContactEmail());
                    bp.AddForUpdate(FM.LeadOfficeMng.GetMemberProfile());
                    bp.Update();



                    ApplyBR(true);

                    officerBindingSource.Position = officerBindingSource.Find("OfficerId", linkId);
                }
                catch (Exception x)
                {
                    throw x;
                }
            }
        }
예제 #12
0
        private void timeSlipGridEX_CellUpdated(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e)
        {
            try
            {
                int fileid = CurrentRowACTimeSlip().FileId;
                if (e.Column.Key == "Hours" || e.Column.Key == "Comment")
                {
                    timeSlipGridEX.UpdateData();
                    Application.UseWaitCursor = true;
                    //get FM, load activitytime record and update hours/comment
                    atriumBE.FileManager FMActivityTime = FM.AtMng.GetFile(fileid);
                    FMActivityTime.GetActivity().Load(CurrentRowACTimeSlip().ActivityId);
                    atriumDB.ActivityTimeRow atr = FMActivityTime.GetActivityTime().Load(CurrentRowACTimeSlip().ActivityTimeId);
                    if (CurrentRowACTimeSlip().IsHoursNull())
                    {
                        CurrentRowACTimeSlip().Hours = 0;
                    }
                    atr.Hours   = CurrentRowACTimeSlip().Hours;
                    atr.Comment = CurrentRowACTimeSlip().Comment;

                    timeSlipBindingSource.EndEdit();
                    try
                    {
                        atLogic.BusinessProcess bp = FM.GetBP();
                        bp.AddForUpdate(FMActivityTime.GetActivityTime());

                        bp.Update();

                        CalculateOpenPeriodTotals(CurrentRowSRP());
                    }
                    catch (Exception x1)
                    {
                        FMActivityTime.DB.ActivityTime.RejectChanges();
                        throw x1;
                    }
                    Application.UseWaitCursor = false;
                }
            }
            catch (Exception x)
            {
                Application.UseWaitCursor = false;
                UIHelper.HandleUIException(x);
            }
        }
예제 #13
0
        private void DeleteAddress()
        {
            try
            {
                if (UIHelper.ConfirmDelete())
                {
                    CurrentRowAddress().Delete();
                    addressBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetAddress());
                    bp.Update();
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
예제 #14
0
        public override void Delete()
        {
            try
            {
                if (UIHelper.ConfirmDelete())
                {
                    atSecurity.SecurityManager mySM = FM.AtMng.SecurityManager;
                    SecurityDB.secUserRow      sur  = null;

                    if (!CurrentRow().IsUserNameNull())
                    {
                        sur = mySM.GetsecUser().Load(CurrentRow().UserName);
                    }

                    CurrentRow().Delete();
                    this.officerBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();

                    bp.AddForUpdate(FM.LeadOfficeMng.GetOfficer());
                    bp.AddForUpdate(FM.EFile);

                    if (sur != null)
                    {
                        sur.Delete();
                        //   bp.AddForUpdate(mySM.GetsecFileRule());
                        bp.AddForUpdate(mySM.GetsecMembership());
                        bp.AddForUpdate(mySM.GetsecUser());
                    }
                    bp.Update();

                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
예제 #15
0
        private void CreateNewTimeSlip(DateTime SRPDate)
        {
            atriumDB.SRPRow newSrp = (atriumDB.SRPRow)FM.GetSRP().Add(FM.CurrentFile);
            newSrp.FileID = FM.CurrentFile.FileId;
            if (SRPDate != null)
            {
                newSrp.SRPDate = SRPDate;
            }
            try
            {
                atLogic.BusinessProcess bp = FM.GetBP();
                bp.AddForUpdate(FM.GetSRP());

                bp.Update();
            }
            catch (Exception x)
            {
                FM.DB.SRP.RejectChanges();
            }
        }
예제 #16
0
 private void SaveIRP()
 {
     if (FM.DB.IRP.HasErrors)
     {
         UIHelper.TableHasErrorsOnSaveMessBox(myOfficeMan.DB);
     }
     else
     {
         try
         {
             this.iRPBindingSource.EndEdit();
             atLogic.BusinessProcess bp = FM.GetBP();
             bp.AddForUpdate(FM.GetSRP());
             bp.AddForUpdate(FM.GetIRP());
             bp.Update();
             FM.GetSRP().LoadByFileId(FM.CurrentFileId);
         }
         catch (Exception x)
         {
             UIHelper.HandleUIException(x);
         }
     }
 }
예제 #17
0
        public override void Save()
        {
            if (FM.GetCLASMng().DB.FileHistory.HasErrors)
            {
                UIHelper.TableHasErrorsOnSaveMessBox(FM.DB);
            }
            else
            {
                try
                {
                    this.fileHistoryBindingSource.EndEdit();

                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetCLASMng().GetFileHistory());
                    bp.Update();
                    ApplyBR(true);
                }
                catch (Exception x)
                {
                    throw x;
                }
            }
        }
예제 #18
0
        private void DeleteIRP()
        {
            try
            {
                if (UIHelper.ConfirmDelete())
                {
                    CurrentRowIRP().Delete();
                    this.iRPBindingSource.EndEdit();
                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetIRP());
                    bp.AddForUpdate(FM.EFile);
                    bp.Update();

                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
예제 #19
0
        private void DeleteCompOfferDetail()
        {
            try
            {
                if (UIHelper.ConfirmDelete())
                {
                    CurrentRowDetail().Delete();
                    atriumDB_CompOfferDetailDataTableBindingSource.EndEdit();
                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetCLASMng().GetCompOfferDetail());

                    bp.Update();

                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
예제 #20
0
        public override void Delete()
        {
            try
            {
                //would like to have most of this moved to BE CanDelete, but the UI interaction with the confirm messages makes it impossible at the moment
                bool okToDelete = false;
                if (CurrentRow().Closed)
                {
                    //since it's closed, candelete will return true if canoverride=true
                    if (FM.GetCLASMng().GetTaxing().CanDelete(CurrentRow()))
                    {
                        //check to see if IRPId is null; if so, who cares about link back to irp, there is none; go ahead and chuck
                        if (CurrentRow().IsIRPIdNull())
                        {
                            okToDelete = true;
                        }
                        else
                        {
                            //check state of srp to see if taxation completed; if so, warn about impact
                            //loading irp and srp data to read it
                            atriumDB.IRPRow irpRow = FM.DB.IRP.FindByIRPId(CurrentRow().IRPId);
                            if (irpRow == null)
                            {
                                //a LoadByIRPID would be nice here ... but whatever, only called when deleting a taxrec by an overrider, very isolated
                                FM.GetIRP().Load();
                                irpRow = FM.DB.IRP.FindByIRPId(CurrentRow().IRPId);
                            }
                            atriumDB.SRPRow srpRow = FM.GetSRP().Load(irpRow.SRPID);

                            if (!srpRow.IsTaxationCompletedNull())
                            {
                                if (MessageBox.Show("This taxing recommendation is closed and linked to an IRP for which taxation has been completed on the SRP.  You cannot modify the IRP values as they are read-only.\n\nAre you sure you want to proceed with deleting this linked and closed taxing recommendation?", "Closed and Linked Taxing Recommendation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                                {
                                    okToDelete = true;
                                }
                            }
                            else // taxation not completed yet
                            {
                                if (MessageBox.Show("This taxing recommendation is closed and linked to an IRP for which taxation is not completed on the SRP.  You may still modify the IRP values to account for the deleting of this taxing recommendation if need be.\n\nAre you sure you want to proceed with deleting this linked and closed taxing recommendation?", "Closed and Linked Taxing Recommendation", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                                {
                                    okToDelete = true;
                                }
                            }

                            //if taxation not completed, explain that taxed amounts can still be manipulated until SRP taxation completed date populated
                        }
                    }
                }
                else
                {//JLL: 2016/09/28, added Else so taxrec gets delete when not closed
                    if (FM.GetCLASMng().GetTaxing().CanDelete(CurrentRow()))
                    {
                        okToDelete = true;
                    }
                }

                if (okToDelete)
                {
                    CurrentRow().Delete();
                    taxingBindingSource.EndEdit();
                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetCLASMng().GetTaxing());
                    bp.AddForUpdate(FM.EFile);
                    bp.Update();

                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
예제 #21
0
        private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
        {
            try
            {
                switch (e.Command.Key)
                {
                case "tsCopyPrefs":

                    fContactSelect fcs = new fContactSelect(FM, null, false);
                    if (fcs.ShowDialog() == DialogResult.OK)
                    {
                        officeDB.OfficerRow fromR = FM.LeadOfficeMng.GetOfficer().FindLoad(fcs.ContactId);
                        if (MessageBox.Show("Are you sure you want to copy all the preferences from " + fromR.DisplayName + " to " + CurrentRow().DisplayName + "?", "Copy Preferences", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                        {
                            int fromOfficer = fcs.ContactId;

                            FM.LeadOfficeMng.GetOfficer().CopyPreferences(fromOfficer, CurrentRow().OfficerId, true);
                            atLogic.BusinessProcess bp1 = FM.GetBP();
                            bp1.AddForUpdate(FM.LeadOfficeMng.DB.OfficerPrefs);
                            bp1.Update();
                        }
                    }
                    break;

                case "cmdAddToAB":
                    atriumBE.FileManager fmAB = FM.AtMng.GetFile(FM.AtMng.WorkingAsOfficer.MyFileId);
                    try
                    {
                        fmAB.GetFileContact().Add(CurrentRow(), "FAB");

                        atLogic.BusinessProcess bp = fmAB.GetBP();
                        bp.AddForUpdate(fmAB.GetFileOffice());
                        bp.AddForUpdate(fmAB.GetPerson());
                        bp.AddForUpdate(fmAB.GetFileContact());
                        bp.AddForUpdate(fmAB.EFile);
                        bp.Update();
                    }
                    catch (Exception x)
                    {
                        fmAB.DB.RejectChanges();
                        throw x;
                    }

                    break;

                case "tsMyFile":
                    if (CurrentRow().IsMyFileIdNull() || (!CurrentRow().IsMyFileIdNull() && MessageBox.Show(LawMate.Properties.Resources.PersonalFileAlreadyExists, LawMate.Properties.Resources.CreatePersonalFile, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes))
                    {
                        fBrowse f = new fBrowse(FM.AtMng, FM.CurrentFile.FileId, true, true, true, true);
                        if (f.ShowDialog() == DialogResult.OK)
                        {
                            FM.LeadOfficeMng.GetOfficer().CreatePersonalFiles(f.SelectedFile.FileId, CurrentRow(), LawMate.Properties.Settings.Default.UseSeparatePersonalFiles);
                            Save();
                        }
                    }
                    break;

                case "tsSave":
                    Save();
                    break;

                case "tsDelete":
                    Delete();
                    break;

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

                case "tsNew":
                    //officerBindingSource.AddNew();
                    officeDB.OfficerRow or = (officeDB.OfficerRow)FM.LeadOfficeMng.GetOfficer().Add(FM.LeadOfficeMng.CurrentOffice);
                    officerBindingSource.Position = officerBindingSource.Find("OfficerId", or.OfficerId);
                    break;

                case "tsOfficeMailView":
                    FileForm().MainForm.OpenBFList(CurrentRow());
                    break;

                case "tsOfficerBFList":
                    FileForm().MainForm.OpenBFList(CurrentRow());

                    break;

                case "tsResetPassword":

                    break;

                case "tsGroupBy":
                    if (e.Command.Checked == Janus.Windows.UI.InheritableBoolean.True)
                    {
                        officerGridEX.GroupByBoxVisible = true;
                    }
                    else
                    {
                        officerGridEX.GroupByBoxVisible = false;
                    }
                    break;

                case "tsFilter":
                    if (e.Command.Checked == Janus.Windows.UI.InheritableBoolean.True)
                    {
                        officerGridEX.FilterMode = Janus.Windows.GridEX.FilterMode.Automatic;
                    }
                    else
                    {
                        officerGridEX.FilterMode = Janus.Windows.GridEX.FilterMode.None;
                    }
                    break;

                case "tsSecurity":
                    Save();
                    fSecurity fs = new fSecurity();
                    fs.Init(FM.AtMng.SecurityManager, CurrentRow());
                    fs.ShowDialog();
                    Save();
                    break;
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }