Exemple #1
0
        public override void MoreInfo(string linkTable, int linkId)
        {
            if (linkTable.ToUpper() == "SRPDETAIL")
            {
                srpId = linkId;
                if (!loadedSRPs.Contains(linkId))
                {
                    iRPBindingSource.SuspendBinding();
                    toggleLoad(true);
                    iRPGridEX.DataSource = null;
                    iRPGridEX.Refetch();
                    Application.DoEvents();
                    FM.GetIRP().LoadBySRPId(linkId);
                    //    FM.GetCLASMng().GetTaxing().LoadBySRPID(linkId);
                    loadedSRPs.Add(linkId);
                    FM.GetSRP().Load(linkId);
                    toggleLoad(false);
                    iRPBindingSource.ResumeBinding();
                    iRPGridEX.DataSource = iRPBindingSource;
                }

                srpRow = ((atriumDB.SRPRow[])FM.DB.SRP.Select("SRPID=" + linkId))[0];
                iRPBindingSource.Filter = "SRPID=" + linkId;

                if (iRPBindingSource.Count == 0 && FM.GetIRP().CanAdd(srpRow, FM.CurrentFile.FileId))
                {
                    NewIRP();
                }
            }
            else if (linkTable.ToUpper() == "SRPDETAILIRP")
            {
                iRPBindingSource.Position = iRPBindingSource.Find("IRPID", linkId);
            }
        }
Exemple #2
0
        public void BindIRPData(atriumDB.IRPDataTable a)
        {
            ucContactSelectBox1.FM   = FM;
            ucOfficeSelectBox1.AtMng = FM.AtMng;
            UIHelper.ComboBoxInit("vofficerlist", iRPGridEX.DropDowns["ddOfficer"], FM);
            setBindingSources();

            a.ColumnChanged += new DataColumnChangeEventHandler(a_ColumnChanged);
            FM.GetIRP().OnUpdate += new atLogic.UpdateEventHandler(ucTaxation_OnUpdate);
        }
Exemple #3
0
 private void NewIRP()
 {
     //pass srp as parent row?!
     atriumDB.IRPRow irpr = (atriumDB.IRPRow)FM.GetIRP().Add(srpRow);
     iRPBindingSource.Position = iRPBindingSource.Find("IRPId", irpr.IRPId);
     btnValidateSIN.Visible    = true;
     btnValidateSIN.Enabled    = true;
     ApplySecurityIRP(irpr);
     sINMaskedEditBox.Focus();
 }
Exemple #4
0
        public override void ReloadUserControlData()
        {
            loadedSRPs.Clear();
            FM.GetSRP().LoadByFileId(FM.CurrentFileId);


            FM.GetIRP().LoadBySRPId(srpId);
            //    FM.GetCLASMng().GetTaxing().LoadBySRPID(srpId);
            loadedSRPs.Add(srpId);
            iRPGridEX.MoveFirst();
        }
Exemple #5
0
        public void bindIRPData(atriumDB.IRPDataTable a)
        {
            myOfficeMan = FM.AtMng.GetOffice(FM.CurrentFile.LeadOfficeId);
            officeIDucOfficeSelectBox.AtMng = FM.AtMng;
            fileIDucFileSelectBox.AtMng     = FM.AtMng;

            UIHelper.ComboBoxInit("vCLASList", mccTaxingOfficer, FM);

            iRPBindingSource.DataSource = a.DataSet;
            iRPBindingSource.DataMember = a.TableName;

            a.ColumnChanged += new DataColumnChangeEventHandler(a_ColumnChanged);
            FM.GetIRP().OnUpdate += new atLogic.UpdateEventHandler(ucIRP_OnUpdate);

            btnValidateSIN.Visible = false; // we can show it on Add()

            if (a.Count == 0)
            {
                NoData();
            }
        }
Exemple #6
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);
         }
     }
 }
Exemple #7
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;
            }
        }
Exemple #8
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;
            }
        }
Exemple #9
0
        private void ApplySecurityIRP(DataRow irpRow) //IRP
        {
            atriumDB.IRPRow irpr = (atriumDB.IRPRow)irpRow;

            if (irpr == null)
            {
                return;
            }

            uiTab1.Enabled = true;
            uiTab2.Enabled = true;
            uiTab3.Enabled = true;

            bool OnlineIRP = myOfficeMan.CurrentOffice.UsesBilling;

            UIHelper.EnableCommandBarCommand(tsDeleteIRP, FM.GetIRP().CanDelete(irpr, FM.CurrentFile.FileId));
            UIHelper.EnableCommandBarCommand(tsNewIRP, !OnlineIRP);

            if (myOfficeMan.CurrentOffice.UsesBilling) //SRP detail all readonly; nothing can be done on this page; use billing review
            {
                dateTaxedCalendarCombo.ReadOnly  = true;
                dateTaxedCalendarCombo.BackColor = SystemColors.Control;
                mccTaxingOfficer.ReadOnly        = true;
                tsSaveIRP.Enabled = Janus.Windows.UI.InheritableBoolean.False;
            }
            else //foreign IRP || Non Online IRP
            {
                if (irpRow.RowState == DataRowState.Added)
                {
                    if (irpRow.IsNull("FileId"))
                    {
                        btnValidateSIN.Visible = true;
                    }
                    sINMaskedEditBox.ReadOnly  = false;
                    sINMaskedEditBox.BackColor = SystemColors.Window;
                }
                else
                {
                    btnValidateSIN.Visible     = false;
                    sINMaskedEditBox.ReadOnly  = true;
                    sINMaskedEditBox.BackColor = SystemColors.Control;
                }

                if (!irpr.SRPRow.IsTaxationCompletedNull())
                {
                    tsNewIRP.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                    dateTaxedCalendarCombo.ReadOnly  = true;
                    dateTaxedCalendarCombo.BackColor = SystemColors.Control;
                    mccTaxingOfficer.ReadOnly        = true;
                    tsSaveIRP.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                    feesClaimedNumericEditBox.ReadOnly                   = true;
                    feesClaimedNumericEditBox.BackColor                  = SystemColors.Control;
                    disbursementClaimedNumericEditBox.ReadOnly           = true;
                    disbursementClaimedNumericEditBox.BackColor          = SystemColors.Control;
                    disbursementTaxExemptClaimedNumericEditBox.ReadOnly  = true;
                    disbursementTaxExemptClaimedNumericEditBox.BackColor = SystemColors.Control;
                    iRPGridEX.Height  = 220;
                    gbMessage.Visible = false;
                }
                else
                {
                    iRPGridEX.Height  = 220;
                    gbMessage.Visible = false;

                    if (!irpr.SRPRow.IsTaxationBeganNull())
                    {
                        if (irpr.IsDateTaxedNull() && irpr.IsOfficerIDNull())
                        {
                            iRPGridEX.Height  = 167;
                            label10.Text      = Properties.Resources.UITaxationMode;
                            gbMessage.Visible = true;

                            //taxation mode
                            //let's default some values

                            if (!irpr.IsFeesClaimedNull())
                            {
                                irpr.FeesTaxed = irpr.FeesClaimed;
                            }

                            if (!irpr.IsFeesClaimedTaxNull())
                            {
                                irpr.FeesTaxedTax = irpr.FeesClaimedTax;
                            }

                            if (!irpr.IsDisbursementClaimedNull())
                            {
                                irpr.DisbursementTaxed = irpr.DisbursementClaimed;
                            }

                            if (!irpr.IsDisbursementClaimedTaxNull())
                            {
                                irpr.DisbursementTaxedTax = irpr.DisbursementClaimedTax;
                            }

                            if (!irpr.IsDisbursementTaxExemptClaimedNull())
                            {
                                irpr.DisbursementTaxExemptTaxed = irpr.DisbursementTaxExemptClaimed;
                            }

                            irpr.OfficerID = FM.AtMng.WorkingAsOfficer.OfficerId;
                            irpr.DateTaxed = DateTime.Today;
                        }
                    }

                    tsNewIRP.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                    dateTaxedCalendarCombo.ReadOnly  = false;
                    dateTaxedCalendarCombo.BackColor = SystemColors.Window;
                    mccTaxingOfficer.ReadOnly        = false;
                    tsSaveIRP.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                    feesClaimedNumericEditBox.ReadOnly                   = false;
                    feesClaimedNumericEditBox.BackColor                  = SystemColors.Window;
                    disbursementClaimedNumericEditBox.ReadOnly           = false;
                    disbursementClaimedNumericEditBox.BackColor          = SystemColors.Window;
                    disbursementTaxExemptClaimedNumericEditBox.ReadOnly  = false;
                    disbursementTaxExemptClaimedNumericEditBox.BackColor = SystemColors.Window;

                    feesTaxedNumericEditBox.ReadOnly                   = false;
                    feesTaxedNumericEditBox.BackColor                  = SystemColors.Window;
                    disbursementTaxedNumericEditBox.ReadOnly           = false;
                    disbursementTaxedNumericEditBox.BackColor          = SystemColors.Window;
                    disbursementTaxedTaxNumericEditBox.ReadOnly        = false;
                    disbursementTaxedTaxNumericEditBox.BackColor       = SystemColors.Window;
                    disbursementTaxExemptTaxedNumericEditBox.ReadOnly  = false;
                    disbursementTaxExemptTaxedNumericEditBox.BackColor = SystemColors.Window;
                }
            }
        }