示例#1
0
        private dynamic AGICheck(JTL.Tax1040.BusinessObject.Tax1040 taxObject, dynamic input)
        {
            // 16Jul2014 Sathish commented the above code and checked EIC eligibility using work flow
            //21Aug2014 - Ashok Kumar added EIC eligibility check workflow instead of without validation worklfow
            var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new F1040EZEICEligibilityRuleCheck(), input));

            Utilities.EICEligibilityCheck(taxObject);
            return(output);
        }
示例#2
0
        //Saravanan N - 7th April, 2014 - GetForm1099GList for UnemploymentSummary page.
        //Saravanan N - 6th May, 2014 - Method moved from UnemploymentController class.
        public Tuple <Form1099G, string, string, FilingStatus, IEnumerable <ErrorMessage> > GetUnemploymentById(UserDTO userDTO)
        {
            Form1099G    form1099G    = null;
            FilingStatus filingStatus = FilingStatus.None;
            IEnumerable <ErrorMessage> unemployementErrorList = null;

            try
            {
                taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId, userDTO.UserDataId);

                taxPayerAndSpouseNames = Utilities.GetTaxPayerAndSpouseName(taxObject);

                if (taxObject != null)
                {
                    //Get FilingStatus.
                    if (taxObject.PersonalDetails != null && taxObject.PersonalDetails.PrimaryTaxPayer != null)
                    {
                        filingStatus = taxObject.PersonalDetails.PrimaryTaxPayer.FilingStatus;
                    }

                    if (taxObject.Income != null && taxObject.Income.Form1099G != null)
                    {
                        form1099G = taxObject.Income.Form1099G.Find(frm => frm.Form1099GId == userDTO.FormId);
                    }
                    //vivek - 6-Aug-14 -Added the error message list for the error message focus
                    if (taxObject.ErrorMessages != null)
                    {
                        unemployementErrorList = taxObject.ErrorMessages.Where(err => err.Topic == Constants.TOPIC_UNEMPLOYMENT_COMPENSATION &&
                                                                               (err.MessageType == Constants.MESSAGE_TYPE_RF || err.MessageType == Constants.MESSAGE_TYPE_V)).ToList();
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionHandling.LogException(userDTO.UserId, "Class:UnemploymentRepository,Method Name:GetUnemploymentById", ex);
            }

            //02-Sep-2014 Bhavani Audit functionality implementation
            var description = "Get Unemployment By Id: " + userDTO.FormId + ", ClassName: {0}, Method Name: {1}";

            Utilities.PersistAuditInfo(userDTO.UserId, userDTO.UserDataId, description, this.GetType().Name, Constants.Tab_INCOME, Constants.TOPIC_UNEMPLOYMENT_COMPENSATION);

            return(new Tuple <Form1099G, string, string, FilingStatus, IEnumerable <ErrorMessage> >(form1099G, taxPayerAndSpouseNames.Item1, taxPayerAndSpouseNames.Item3, filingStatus, unemployementErrorList));
        }
示例#3
0
        /// <summary>
        /// Delete and then Persist Form1099G.
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="userDataId"></param>
        /// <param name="form1099GId"></param>
        /// <param name="errorMessageList"></param>
        public void DeleteAndPersistUnemployment(UserDTO userDTO, Tax1040.BusinessObject.Tax1040 refTaxObject = null) // 05Jun2014 Sathish added optional parameter taxobject used in delete spouse info while changing filling status MFJ to single
        {
            try
            {
                // 05Jun2014 Sathish check optional parameter which is used in deleting spouse info
                if (refTaxObject == null)
                {
                    //Retrieving TaxObject from database
                    taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId, userDTO.UserDataId);
                }
                else
                {
                    taxObject = refTaxObject;
                }

                //Converting Json to Form1099G by DeSerializing
                if (taxObject != null && taxObject.Income != null && taxObject.Income.Form1099G != null)
                {
                    int index = taxObject.Income.Form1099G.FindIndex(form => form.Form1099GId == userDTO.FormId);

                    if (index >= 0)
                    {
                        //Delete the current Form1099G object.
                        taxObject.Income.Form1099G.RemoveAt(index);

                        // Clear the Error messages
                        messageRepository.ClearErrorMessages(taxObject.ErrorMessages, Constants.TOPIC_UNEMPLOYMENT_COMPENSATION, userDTO.FormId);
                    }


                    //10Jul2014 Sathish added coded to check Taxable Income Eligibility
                    dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments();
                    input.Tax1040Object = taxObject;

                    //Obtain the List of Error Messages from DB.
                    //var errorMessagesFromDB = messageRepository.GetErrorMessages();
                    var errorMessagesFromDB = HttpRuntime.Cache["ErrorMessageCollection"] as Dictionary <string, ErrorMessage>;
                    var errorMessagesAll    = new ErrorMessages(errorMessagesFromDB);
                    //Assisn error message list into workflow input param.
                    input.ErrorMessages = errorMessagesAll;

                    //10Jul2014 Sathish added coded to check Taxable Income Eligibility
                    taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_TAXABLE_INCOME);

                    taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_REQUIRED_REFUND_DETAIL);
                    taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_MISSING_INCOME);
                    taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.OTHERINCOME_TAXABLE_SOCIAL_SECURITY_AND_RAILROAD_BENEFITS);

                    // var taxableIncome = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new F1040EZTaxableIncomeEligibilityCheck(), input));
                    dynamic federalSummaryInput = new Microsoft.Activities.Extensions.WorkflowArguments();
                    federalSummaryInput.Tax1040Object = taxObject;
                    federalSummaryInput.IsTaxableIncomeExceedCheck = true;
                    federalSummaryInput.IsRefundAvailableCheck     = true;
                    federalSummaryInput.IsIncomeAndRefundAllZeros  = true;
                    //25 Aug 2014-Vincent- Added the SSB and RRB check in FederalSummaryWithNoValidation
                    federalSummaryInput.IsSSBAndRRBCheck = true;
                    federalSummaryInput.ErrorMessages    = errorMessagesAll;
                    var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(
                        WorkflowInvoker.Invoke(new FederalSummaryWithNoValidation(), federalSummaryInput));

                    //Added by Ashok for EIC Eligibility Check
                    // Clear the Error messages
                    //messageRepository.ClearErrorMessages(taxObject.ErrorMessages, Constants.TOPIC_EARNED_INCOME_CREDIT);

                    //03Sep2014-Thileep Changed code to Remove EIC errormessages which has Message Type EI only
                    taxObject.ErrorMessages.RemoveAll(err => err.Topic == Constants.TOPIC_EARNED_INCOME_CREDIT && (err.MessageType == Constants.MESSAGE_TYPE_EI));

                    dynamic eicEligbilityInput = new Microsoft.Activities.Extensions.WorkflowArguments();
                    eicEligbilityInput.Tax1040Object = taxObject;
                    eicEligbilityInput.ErrorMessages = errorMessagesAll;
                    //Check if EIC with espect to AGI
                    output = AGICheck(taxObject, input);
                    //02Sep2014-  Thileep added  to Remove EIC Error messages when EIC Eligibility fails
                    if (!output.HasEarnedIncomeCredit)
                    {
                        taxObject.ErrorMessages.RemoveAll(err => err.Topic == Constants.TOPIC_EARNED_INCOME_CREDIT &&
                                                          (err.MessageType == Constants.MESSAGE_TYPE_RF || err.MessageType == Constants.MESSAGE_TYPE_V || err.MessageType == Constants.MESSAGE_TYPE_BR));
                    }
                }

                //Persist latest TaxObject.
                Utilities.PersistTaxObject(userDTO.UserId, userDTO.UserDataId, taxObject);

                //02-Sep-2014 Bhavani Audit functionality implementation
                var description = "Delete Unemployment: " + userDTO.FormId + ", ClassName: {0}, Method Name: {1}";
                Utilities.PersistAuditInfo(userDTO.UserId, userDTO.UserDataId, description, GetType().Name, Constants.Tab_INCOME, Constants.TOPIC_UNEMPLOYMENT_COMPENSATION);
            }
            catch (Exception ex)
            {
                ExceptionHandling.LogException(userDTO.UserId, "Class:UnemploymentRepository,Method Name:DeleteAndPersistUnemployment", ex);
            }
        }
示例#4
0
        //Saravanan N - 7th April, 2014 - GetForm1099GList for UnemploymentSummary page.
        //Saravanan N - 5th May, 2014 - This method moved from F1099GController class and Refacotred.
        public Tuple <List <Form1099G>, IEnumerable <ErrorMessage>, double?> GetAllUnemployment(UserDTO userDTO)
        {
            List <Form1099G>           lstForm1099G     = null;
            IEnumerable <ErrorMessage> lstErrorMessages = null;
            double?totalUnemploymentReceived            = null;
            double?totalUnemploymentRepaid = null;

            try
            {
                //Get TaxObject from DB.
                taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId, userDTO.UserDataId);

                //Get Form1099G and its Error Messages.
                if (taxObject != null)
                {
                    if (taxObject.Income != null && taxObject.Income.Form1099G != null)
                    {
                        lstForm1099G = taxObject.Income.Form1099G;
                        //Added By Yogalakshmi on 20th May 2014 to bind the latest First Name and Last Name in unemploymentSummary Page
                        foreach (var taxPayerName in lstForm1099G)
                        {
                            if (taxPayerName.OwnerType == OwnerType.Spouse)
                            {
                                //Yogalakshmi - 22nd May 2014 - Checked for null
                                if (taxObject.PersonalDetails != null && taxObject.PersonalDetails.Spouse != null &&
                                    taxObject.PersonalDetails.Spouse.Person != null)
                                {
                                    taxPayerName.TaxPayerName = taxObject.PersonalDetails.Spouse.Person.FirstName + " " + taxObject.PersonalDetails.Spouse.Person.LastName;
                                }
                            }
                            else
                            {
                                if (taxObject.PersonalDetails != null && taxObject.PersonalDetails.PrimaryTaxPayer != null &&
                                    taxObject.PersonalDetails.PrimaryTaxPayer.Person != null)
                                {
                                    taxPayerName.TaxPayerName = taxObject.PersonalDetails.PrimaryTaxPayer.Person.FirstName + " " + taxObject.PersonalDetails.PrimaryTaxPayer.Person.LastName;
                                }
                            }
                        }
                    }
                    else
                    {
                        lstForm1099G = new List <Form1099G>();
                    }

                    //Yogalakshmi - 20th May 2014
                    //Get Summary Page total unemployment compensation summary amount.
                    totalUnemploymentRepaid   = lstForm1099G.Select(m => m.CurrentYearUnemploymentRepaid).Sum();
                    totalUnemploymentReceived = lstForm1099G.Select(m => m.UnEmploymentCompensation).Sum();

                    //Get ErrorMessage if exists.
                    if (taxObject.ErrorMessages != null)
                    {
                        //If ErrorMessages doesn't have any object it returns count as 1 for NULL object. So removing this NULL object from the list.
                        taxObject.ErrorMessages.RemoveAll(err => err == null);

                        if (taxObject.ErrorMessages.Count > 0)
                        {
                            //Get Unemployment Compensation related error messages.
                            //Praveen 17 July 2014 Error Message displayed based on Error Type(Properly Shuffled)
                            lstErrorMessages = taxObject.ErrorMessages.Where(err => err.Topic == Constants.TOPIC_UNEMPLOYMENT_COMPENSATION).OrderBy(x => x.ErrorType);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionHandling.LogException(userDTO.UserId, "Class:UnemploymentRepository,Method Name:GetAllUnemployment", ex);
            }

            //02-Sep-2014 Bhavani Audit functionality implementation
            var description = "Get All Unemployment: " + userDTO.FormId + ", ClassName: {0}, Method Name: {1}";

            Utilities.PersistAuditInfo(userDTO.UserId, userDTO.UserDataId, description, this.GetType().Name, Constants.Tab_INCOME, Constants.TOPIC_UNEMPLOYMENT_COMPENSATION);

            return(new Tuple <List <Form1099G>, IEnumerable <ErrorMessage>, double?>(lstForm1099G, lstErrorMessages,
                                                                                     totalUnemploymentReceived - totalUnemploymentRepaid));
        }
示例#5
0
        /// <summary>
        /// Create and Persist Unemployment
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="taxReturnData"></param>
        /// <returns></returns>
        public dynamic CreateAndPersistUnemployment(long userId, TaxReturnData taxReturnData)
        {
            dynamic userDataIDand1099GId = new ExpandoObject();
            long    form1099GId          = 0;

            try
            {
                //Retrieving TaxObject from database
                taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userId, taxReturnData.UserDataId);

                //Converting Json to Form1099G by DeSerializing
                Form1099G form1099g = JsonConvert.DeserializeObject <Form1099G>(taxReturnData.TaxData);
                if (taxObject != null)
                {
                    //Get TaxPayer and Spouse Names.
                    taxPayerAndSpouseNames = Utilities.GetTaxPayerAndSpouseName(taxObject);

                    if (taxObject.Income == null)
                    {
                        taxObject.Income = new Income();
                    }
                }

                if (taxObject.Income.Form1099G != null && taxObject.Income.Form1099G.Any())
                {
                    int index = taxObject.Income.Form1099G.FindIndex(form => form.Form1099GId == form1099g.Form1099GId);

                    if (index < 0)
                    {
                        //Saravanan N - 3rd April, 2014 - Current Form1099G is new one. So created ID for this.
                        form1099g.Form1099GId = taxObject.Income.Form1099G.Max(frm => frm.Form1099GId) + 1;

                        //Adding new Form1099G to the TaxObject Form1099GList
                        taxObject.Income.Form1099G.Add(form1099g);
                        form1099GId = 0;
                    }
                    else
                    {
                        taxObject.Income.Form1099G[index] = form1099g;
                        form1099GId = form1099g.Form1099GId;
                    }
                }
                else
                {
                    //Saravanan N - 3rd April, 2014 - Form1099G doesn't exists for this user. Hence, assign 1 as its ID.
                    form1099g.Form1099GId = 1;

                    //Creating Instance if Form1099GList section is Null
                    taxObject.Income.Form1099G = new List <Form1099G> {
                        form1099g
                    };
                    form1099GId = 0;
                    //Adding new Form1099G to the TaxObject W2List
                }

                if (taxObject.ErrorMessages == null)
                {
                    taxObject.ErrorMessages = new List <ErrorMessage>();
                }

                //Retrieving Error Message list from Database
                messageRepository = new MessagesRepository();
                //var errorMessage = messageRepository.GetErrorMessages();

                var errorMessage  = HttpRuntime.Cache["ErrorMessageCollection"] as Dictionary <string, ErrorMessage>;
                var errorMessages = new ErrorMessages(errorMessage);

                // Clear the Error messages
                messageRepository.ClearErrorMessages(taxObject.ErrorMessages, Constants.TOPIC_UNEMPLOYMENT_COMPENSATION);

                //Required and Validation check for current Form1099G.
                FilingStatus filingStatus = FilingStatus.None;
                if (taxObject.PersonalDetails != null && taxObject.PersonalDetails.PrimaryTaxPayer != null)
                {
                    filingStatus = taxObject.PersonalDetails.PrimaryTaxPayer.FilingStatus;
                }
                if (taxObject.Income.Form1099G != null && taxObject.Income.Form1099G.Any())
                {
                    BusinessFieldValidations(taxObject.Income.Form1099G, filingStatus, taxObject.ErrorMessages, errorMessages);
                }

                // Clear the Error messages
                //messageRepository.ClearErrorMessages(taxObject.ErrorMessages, Constants.TOPIC_EARNED_INCOME_CREDIT);
                //02Sep2014-Thileep Changed code to Remove EIC errormessages which has Message Type EI only
                taxObject.ErrorMessages.RemoveAll(err => err.Topic == Constants.TOPIC_EARNED_INCOME_CREDIT && (err.MessageType == Constants.MESSAGE_TYPE_EI));


                //14thJuly2014 Ashok - Added logic for Clearing EIC Worksheet, Form 8862 and EIC classes when failing EIC eligibility
                dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments();
                input.Tax1040Object = taxObject;
                input.ErrorMessages = errorMessages;

                //Check if EIC with espect to AGI
                var output = AGICheck(taxObject, input);

                //Invoking Business Rules Validation Workflow
                //dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments();
                //input.Tax1040Object = taxObject;
                input.ErrorMessages = errorMessages;
                output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new
                                                                                                                 F1099GBusinessValidationRule(), input));


                //10Jul2014 Sathish added coded to check Taxable Income Eligibility
                taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_TAXABLE_INCOME);

                taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_REQUIRED_REFUND_DETAIL);
                taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_MISSING_INCOME);
                taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.OTHERINCOME_TAXABLE_SOCIAL_SECURITY_AND_RAILROAD_BENEFITS);

                // var taxableIncome = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new F1040EZTaxableIncomeEligibilityCheck(), input));
                dynamic federalSummaryInput = new Microsoft.Activities.Extensions.WorkflowArguments();
                federalSummaryInput.Tax1040Object = taxObject;
                federalSummaryInput.IsTaxableIncomeExceedCheck = true;
                federalSummaryInput.IsRefundAvailableCheck     = true;
                federalSummaryInput.IsIncomeAndRefundAllZeros  = true;
                //25 Aug 2014-Vincent- Added the SSB and RRB check in FederalSummaryWithNoValidation
                federalSummaryInput.IsSSBAndRRBCheck = true;
                federalSummaryInput.ErrorMessages    = errorMessages;
                output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(
                    WorkflowInvoker.Invoke(new FederalSummaryWithNoValidation(), federalSummaryInput));


                //Saravanan N - 7th May, 2014 - Check if any hard stop (Eligibility Check found) in workflow for Unemployment.
                var isEligibilityCheckFailed = taxObject.ErrorMessages.Any(errMsg => errMsg.Topic ==
                                                                           Constants.TOPIC_UNEMPLOYMENT_COMPENSATION && errMsg.ErrorCode.Equals(Constants.F1099G__REPAID_AMOUNT_FOR_EARLIER_YEAR));

                //Added by Ashok for EIC Eligibility Check
                // Clear the Error messages
                //messageRepository.ClearErrorMessages(taxObject.ErrorMessages, Constants.TOPIC_EARNED_INCOME_CREDIT);

                //03Sep2014-Thileep Changed code to Remove EIC errormessages which has Message Type EI only
                taxObject.ErrorMessages.RemoveAll(err => err.Topic == Constants.TOPIC_EARNED_INCOME_CREDIT && (err.MessageType == Constants.MESSAGE_TYPE_EI));

                dynamic eicEligbilityInput = new Microsoft.Activities.Extensions.WorkflowArguments();
                eicEligbilityInput.Tax1040Object = taxObject;
                eicEligbilityInput.ErrorMessages = errorMessages;
                //Check if EIC with espect to AGI
                output = AGICheck(taxObject, input);

                //02Sep2014-  Thileep added  to Remove EIC Error messages when EIC Eligibility fails
                if (!output.HasEarnedIncomeCredit)
                {
                    taxObject.ErrorMessages.RemoveAll(err => err.Topic == Constants.TOPIC_EARNED_INCOME_CREDIT &&
                                                      (err.MessageType == Constants.MESSAGE_TYPE_RF || err.MessageType == Constants.MESSAGE_TYPE_V || err.MessageType == Constants.MESSAGE_TYPE_BR));
                }

                taxReturnData.UserDataId = Utilities.PersistTaxObject(userId, taxReturnData.UserDataId, taxObject);

                userDataIDand1099GId.UserDataId  = taxReturnData.UserDataId;
                userDataIDand1099GId.Form1099GId = form1099g.Form1099GId;
                userDataIDand1099GId.isEligibilityCheckFailed = isEligibilityCheckFailed;

                //02-Sep-2014 Bhavani Audit functionality implementation
                var description = form1099GId <= 0 ? "Persist Unemployment: " + form1099GId + ", ClassName: {0}, Method Name: {1}"
                                                   : "Update Unemployment: " + form1099GId + ", ClassName: {0}, Method Name: {1}";
                Utilities.PersistAuditInfo(userId, taxReturnData.UserDataId, description, GetType().Name, Constants.Tab_INCOME, Constants.TOPIC_UNEMPLOYMENT_COMPENSATION);
            }
            catch (Exception ex)
            {
                ExceptionHandling.LogException(userId, "Class:UnemploymentRepository,Method Name:CreateAndPersistUnemployment", ex);
            }

            return(userDataIDand1099GId);
        }
        //Saravanan N - 20th May, 2014 - Return type altered as long.
        /// <summary>
        /// Persist Other Income.
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="sessionData"></param>
        /// <param name="otherIncomeData"></param>
        /// <param name="historyData"></param>
        /// <param name="userDataId"></param>
        /// <param name="errorMessageList"></param>
        /// <returns></returns>
        public Tuple <long, bool> PersistOtherIncome(dynamic taxReturn)
        {
            long          userId        = 0;
            TaxReturnData taxReturnData = null;

            JTL.Tax1040.BusinessObject.Tax1040 taxObject = null;
            bool hasEligibilityDiagnostics = false;
            //Commented to diaplay Error Message for defect 14176
            //bool fromIncomeGateway = false;
            OtherIncome otherIncome = null;
            bool        isNew       = false;

            try
            {
                if (taxReturn != null)
                {
                    taxReturnData = JsonConvert.DeserializeObject <TaxReturnData>(taxReturn.TaxReturnData.ToString());
                    userId        = Utilities.ConvertToLong(taxReturn.userId);

                    //Retrieving TaxObject from database
                    taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userId, taxReturnData.UserDataId);

                    //Converting Json to OtherIncome by DeSerializing
                    otherIncome = JsonConvert.DeserializeObject <OtherIncome>(taxReturnData.TaxData);

                    //Check whether this Persist call coming from OtherIncomeGateway page.
                    //fromIncomeGateway = taxReturn.fromIncomeGateway;
                }

                if (taxObject != null && otherIncome != null)
                {
                    if (taxObject.Income == null)
                    {
                        taxObject.Income = new Income();
                        isNew            = true;
                    }
                    else
                    {
                        isNew = false;
                    }
                    taxObject.Income.OtherIncome = otherIncome;
                }

                //Commented to diaplay Error Message for defect 14176
                //if (!fromIncomeGateway)
                //{
                if (taxObject.ErrorMessages == null)
                {
                    taxObject.ErrorMessages = new List <ErrorMessage>();
                }

                // Clear the Error messages
                //SSB & RRB
                messageRepository.ClearErrorMessages(taxObject.ErrorMessages, Constants.TOPIC_OTHER_INCOME_SSB_RRB);
                //Alaska
                messageRepository.ClearErrorMessages(taxObject.ErrorMessages, Constants.TOPIC_OTHER_INCOME_Alaska);
                //State & Local
                messageRepository.ClearErrorMessages(taxObject.ErrorMessages, Constants.TOPIC_OTHER_INCOME_State_And_Local);
                //Other Income for Eligibility Section
                messageRepository.ClearErrorMessages(taxObject.ErrorMessages, Constants.TOPIC_OTHER_INCOME);
                //Workflow Validation Section
                dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments();
                input.Tax1040Object = taxObject;

                //var errorMessage = messageRepository.GetErrorMessages();
                var errorMessage  = HttpRuntime.Cache["ErrorMessageCollection"] as Dictionary <string, ErrorMessage>;
                var errorMessages = new ErrorMessages(errorMessage);
                input.ErrorMessages = errorMessages;

                // TODO 4-June-14 vivek Added eligibility work flow

                if (taxObject != null && taxObject.Income != null && taxObject.Income.OtherIncome != null && taxObject.Income.OtherIncome.SSB != null && taxObject.Income.OtherIncome.RRB != null)
                {
                    //Saravanan N - 1st Aug, 2014 - While user removing Box 5 (SSB & RRB) for Spouse then also this workflow has to be called. Otherwise the modification in Spouse which will be reflected in workflow only while TaxPayer Net Benefits (SSB & RRB) value exists.
                    //Vincent-16July2014-Check the SSB & RRB TaxpayerNet Benefits as NULL
                    //Checking if the SSB & RRB as value and not equal to Zero.
                    //if ((taxObject.Income.OtherIncome.SSB.TaxpayerNetBenefits != null || taxObject.Income.OtherIncome.RRB.TaxpayerNetBenefits != null))
                    //{
                    var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new
                                                                                                                         Form1040EZSSBEligibilityWithNoValidation(), input));
                    //}


                    //Saravanan N - 1st Aug, 2014 - If ER2 already exists, now the user changed Box 5 value as 0 or empty then the IsLine2SSBTaxable property in SSBWorksheet will be set False. Based on this bool variable the error message will be removed from Taxobject.
                    if (taxObject.F1040EZ != null && taxObject.F1040EZ.F1040EZWorkSheets != null && taxObject.F1040EZ.F1040EZWorkSheets.SSBWorkSheet != null && taxObject.F1040EZ.F1040EZWorkSheets.SSBWorkSheet.IsLine2SSBTaxable == false)
                    {
                        //Remoe already existing eligibility error in tax object.
                        taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.OTHERINCOME_TAXABLE_SOCIAL_SECURITY_AND_RAILROAD_BENEFITS);
                    }
                }

                BusinessFieldValidations(otherIncome, taxObject.ErrorMessages, errorMessages);



                //TODO vivek - 7-4-14 need to be change the work flow.
                var output1 = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke
                                                                                                   (new OtherIncomeBusinessRuleValidation(), input));

                //10Jul2014 Sathish added coded to check Taxable Income Eligibility
                taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_TAXABLE_INCOME);
                var taxableIncome = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke
                                                                                                         (new F1040EZTaxableIncomeEligibilityCheck(), input));


                //Hard Stopper Check
                hasEligibilityDiagnostics = taxObject.ErrorMessages.Any(em => em.Topic ==
                                                                        Constants.TOPIC_OTHER_INCOME && em.ErrorCode.StartsWith("OtherIncome_ER"));
                //}

                if (taxObject != null)
                {
                    taxReturnData.UserDataId = Utilities.PersistTaxObject(userId, taxReturnData.UserDataId, taxObject);
                }

                //02-Sep-2014 Bhavani Audit functionality implementation
                var description = isNew ? "Persist OtherIncome, ClassName: {0}, Method Name: {1}"
                                        : "Update OtherIncome:, ClassName: {0}, Method Name: {1}";
                Utilities.PersistAuditInfo(userId, taxReturnData.UserDataId, description, GetType().Name, Constants.Tab_INCOME, Constants.TOPIC_OTHER_INCOME);


                return(new Tuple <long, bool>(taxReturnData.UserDataId, hasEligibilityDiagnostics));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }