public static Form1099G GetForm1099G(dynamic userInputData)
        {
            Form1099G form1099G = null;

            BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userInputData.userId,
                                                                                           userInputData.userDataId);

            if (taxObject != null)
            {
                if (taxObject.Income != null && taxObject.Income.Form1099G != null)
                {
                    form1099G = taxObject.Income.Form1099G.Find(frm => frm.Form1099GId == userInputData.currentForm1099GId);
                }
            }
            return(form1099G);
        }
        public void PersistForm1099GWitoutStateInformation()
        {
            //Prepare Form 1099G
            var expectedForm1099G = CreateForm1099G();

            expectedForm1099G.Form1099StateInfo = null;
            mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedForm1099G);

            //Persist Form 1099G
            var actualForm1099GData = mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData);

            //Get Form 1099G
            mUserInputData.userDataId         = actualForm1099GData.UserDataId;
            mUserInputData.currentForm1099GId = actualForm1099GData.Form1099GId;
            Form1099G actualForm1099G = GetForm1099G(mUserInputData);

            Assert.AreEqual(expectedForm1099G.Form1099StateInfo, actualForm1099G.Form1099StateInfo);
        }
Exemple #3
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));
        }
        public static Form1099G CreateForm1099GForRFValidations()
        {
            var form1099G = new Form1099G
            {
                Payer = new Payer()
                {
                    PayerName = "",
                    PayerIdentificationNumber = "",
                    Address = new Address()
                    {
                        AddressType  = AddressType.TaxPayerAddress,
                        PayerAddress = new PayerAddress()
                        {
                            City          = "",
                            StreetAddress = "",
                            ZipCode       = "",
                            State         = new State()
                            {
                                StateId = 0
                            }
                        }
                    }
                },
                UnEmploymentCompensation        = null,
                FederalTaxWithHoldingAmount     = null,
                IsCurrentYearUnemploymentRepaid = true,
                CurrentYearUnemploymentRepaid   = null,
                IsPriorYearUnEmploymentRepaid   = true,
                PriorYearUnEmploymentRepaid     = null,
                OwnerType         = 0,
                Form1099StateInfo =
                    new List <Form1099StateInformation>
                {
                    CreateStatInformation1(),
                    CreateStatInformation1(),
                    CreateStatInformation1()
                }
            };

            return(form1099G);
        }
        public static Form1099G CreateForm1099GForValidations()
        {
            var form1099G = new Form1099G
            {
                Payer = new Payer()
                {
                    PayerName = "prasana@123",
                    PayerIdentificationNumber = "1234@123",
                    Address = new Address()
                    {
                        AddressType  = AddressType.TaxPayerAddress,
                        PayerAddress = new PayerAddress()
                        {
                            City          = "Washington@123",
                            StreetAddress = "21/G, Gee Road",
                            ZipCode       = "1234123",
                            State         = new State()
                            {
                                StateId = Utilities.CreateRandomNumber(0, 20)
                            }
                        }
                    }
                },
                UnEmploymentCompensation        = Utilities.CreateRandomNumber(0, 20),
                FederalTaxWithHoldingAmount     = Utilities.CreateRandomNumber(0, 20),
                IsCurrentYearUnemploymentRepaid = Utilities.CreateRandomNumber(0, 1).ConvertToBoolean(),
                CurrentYearUnemploymentRepaid   = Utilities.CreateRandomNumber(0, 20),
                IsPriorYearUnEmploymentRepaid   = Utilities.CreateRandomNumber(0, 1).ConvertToBoolean(),
                PriorYearUnEmploymentRepaid     = Utilities.CreateRandomNumber(0, 20),
                OwnerType         = (OwnerType)Utilities.CreateRandomNumber(0, 1),
                Form1099StateInfo =
                    new List <Form1099StateInformation>
                {
                    CreateStatInformation(),
                    CreateStatInformation(),
                    CreateStatInformation()
                }
            };

            return(form1099G);
        }
        public static Form1099G CreateForm1099G()
        {
            var form1099G = new Form1099G
            {
                Payer = new Payer()
                {
                    PayerName = "Un employment Payer Name" + Utilities.CreateRandomNumber(0, 5),
                    PayerIdentificationNumber = Convert.ToString(Utilities.CreateRandomNumber(0, 5)),
                    Address = new Address()
                    {
                        AddressType  = AddressType.TaxPayerAddress,
                        PayerAddress = new PayerAddress()
                        {
                            City          = "California",
                            StreetAddress = "Payer Street Address",
                            ZipCode       = "90060",
                            State         = new State()
                            {
                                StateId = Utilities.CreateRandomNumber(0, 20)
                            }
                        }
                    }
                },
                UnEmploymentCompensation        = Utilities.CreateRandomNumber(0, 20),
                FederalTaxWithHoldingAmount     = Utilities.CreateRandomNumber(0, 20),
                IsCurrentYearUnemploymentRepaid = Utilities.CreateRandomNumber(0, 1).ConvertToBoolean(),
                CurrentYearUnemploymentRepaid   = Utilities.CreateRandomNumber(0, 20),
                IsPriorYearUnEmploymentRepaid   = Utilities.CreateRandomNumber(0, 1).ConvertToBoolean(),
                PriorYearUnEmploymentRepaid     = Utilities.CreateRandomNumber(0, 20),
                OwnerType         = (OwnerType)Utilities.CreateRandomNumber(0, 1),
                Form1099StateInfo =
                    new List <Form1099StateInformation>
                {
                    CreateStatInformation(),
                    CreateStatInformation(),
                    CreateStatInformation()
                }
            };

            return(form1099G);
        }
        public void PersistForm1099G()
        {
            //Prepare Form 1099G
            var expectedForm1099G = CreateForm1099G();

            mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedForm1099G);

            //Persist Form 1099G
            var actualForm1099GData = mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData);


            //Get Form 1099G
            mUserInputData.currentForm1099GId = actualForm1099GData.Form1099GId;
            mUserInputData.userDataId         = actualForm1099GData.UserDataId;
            Form1099G actualForm1099G = GetForm1099G(mUserInputData);

            Assert.AreNotEqual(actualForm1099G, null);
            Assert.AreEqual(actualForm1099G.Form1099GId, actualForm1099GData.Form1099GId);
            Assert.AreEqual(expectedForm1099G.Payer.Address.AddressId, actualForm1099G.Payer.Address.AddressId);
            Assert.AreEqual(expectedForm1099G.IsCurrentYearUnemploymentRepaid, actualForm1099G.IsCurrentYearUnemploymentRepaid);
            Assert.AreEqual(expectedForm1099G.OwnerType, actualForm1099G.OwnerType);
        }
        public void UpdateNewStateInfo()
        {
            //Prepare Form 1099G
            var givenForm1099G = CreateForm1099G();

            mTaxReturnData.TaxData = JsonConvert.SerializeObject(givenForm1099G);

            //Persist Form 1099G
            var expectedForm1099GData = mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData);

            //Get Form 1099G
            mUserInputData.userDataId         = expectedForm1099GData.UserDataId;
            mUserInputData.currentForm1099GId = expectedForm1099GData.Form1099GId;
            Form1099G expectedForm1099G = GetForm1099G(mUserInputData);

            //Add new state information
            expectedForm1099G.Form1099StateInfo.Add(CreateStatInformation());
            mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedForm1099G);
            mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData);
            var actualForm1099G = (Form1099G)GetForm1099G(mUserInputData);

            Assert.AreEqual(expectedForm1099G.Form1099StateInfo.Count, actualForm1099G.Form1099StateInfo.Count);
        }
Exemple #9
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);
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var tax1040 = new Tax1040();

            tax1040.Income             = new Income();
            tax1040.Income.W2Wages     = new List <W2>();
            tax1040.Income.Form1099INT = new List <Form1099INT>();
            tax1040.Income.Form1099OID = new List <Form1099OID>();
            tax1040.Income.Form1099G   = new List <Form1099G>();
            //tax1040.Income.OtherIncome.SocialSecurityBenefits = new List<SocialSecurityBenefits>();
            //tax1040.Income.OtherIncome.RailroadRetirementBenefits = new List<RailroadRetirementIncome>();

            var w21 = new W2();
            var w22 = new W2();
            var w23 = new W2();


            var form1099Int1 = new Form1099INT();
            var form1099Int2 = new Form1099INT();

            var form1099OID1 = new Form1099OID();
            var form1099OID2 = new Form1099OID();
            var form1099OID3 = new Form1099OID();

            var form1099G1 = new Form1099G();
            var form1099G2 = new Form1099G();
            var form1099G3 = new Form1099G();


            var socialSecurityBenefit = new SocialSecurityBenefits();
            var railRoadRetirement    = new RailroadRetirementIncome(); //added a New Instance

            //W2
            if (!string.IsNullOrEmpty(txtW21.Text))
            {
                w21.WagesAmount = Convert.ToDouble(txtW21.Text);
            }
            if (!string.IsNullOrEmpty(txtFTW21.Text))
            {
                w21.FederalTaxWithholdingAmount = Convert.ToDouble(txtFTW21.Text);
            }

            tax1040.Income.W2Wages.Add(w21);

            if (!string.IsNullOrEmpty(txtW22.Text))
            {
                w22.WagesAmount = Convert.ToDouble(txtW22.Text);
            }
            if (!string.IsNullOrEmpty(txtFTW2.Text))
            {
                w22.FederalTaxWithholdingAmount = Convert.ToDouble(txtFTW2.Text);
            }

            tax1040.Income.W2Wages.Add(w22);

            if (!string.IsNullOrEmpty(txtW23.Text))
            {
                w23.WagesAmount = Convert.ToDouble(txtW23.Text);
            }
            if (!string.IsNullOrEmpty(txtFTW3.Text))
            {
                w23.FederalTaxWithholdingAmount = Convert.ToDouble(txtFTW3.Text);
            }

            tax1040.Income.W2Wages.Add(w23);

            if (!string.IsNullOrEmpty((txtw2Line11Amount.Text)))
            {
                w21.NonQualifiedPlansAmount = Convert.ToDouble(txtw2Line11Amount.Text);
            }

            //W2 Line 8B

            tax1040.Income.W2Wages[0].W2EmployerCodes = new List <W2EmployerCode>();
            var W2Emp1 = new W2EmployerCode();

            W2Emp1.EmployerCode = (EmployerCode)ddlw212a.SelectedIndex;

            if (!string.IsNullOrEmpty(txtW212aAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW212aAmount.Text);
            }
            tax1040.Income.W2Wages[0].W2EmployerCodes.Add(W2Emp1);

            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlW212b.SelectedIndex;
            if (!string.IsNullOrEmpty(txtW212bAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW212bAmount.Text);
            }
            tax1040.Income.W2Wages[0].W2EmployerCodes.Add(W2Emp1);


            tax1040.Income.W2Wages[1].W2EmployerCodes = new List <W2EmployerCode>();

            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlw2212a.SelectedIndex;

            if (!string.IsNullOrEmpty(txtW2212aAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW2212aAmount.Text);
            }

            tax1040.Income.W2Wages[1].W2EmployerCodes.Add(W2Emp1);

            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlW2212b.SelectedIndex;

            if (!string.IsNullOrEmpty(txtW2212bAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW2212bAmount.Text);
            }
            tax1040.Income.W2Wages[1].W2EmployerCodes.Add(W2Emp1);



            tax1040.Income.W2Wages[2].W2EmployerCodes = new List <W2EmployerCode>();
            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlw2312a.SelectedIndex;

            if (!string.IsNullOrEmpty(txtW2312aAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW2312aAmount.Text);
            }

            tax1040.Income.W2Wages[2].W2EmployerCodes.Add(W2Emp1);

            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlW2312b.SelectedIndex;
            if (!string.IsNullOrEmpty(txtW2312bAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW2312bAmount.Text);
            }
            tax1040.Income.W2Wages[2].W2EmployerCodes.Add(W2Emp1);


            //1099 INT
            if (!string.IsNullOrEmpty(txtIntrestIncome1.Text))
            {
                form1099Int1.InterestIncome = Convert.ToDouble(txtIntrestIncome1.Text);
            }
            if (!string.IsNullOrEmpty(txtFTWIntInc1.Text))
            {
                form1099Int1.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFTWIntInc1.Text);
            }
            tax1040.Income.Form1099INT.Add(form1099Int1);
            if (!string.IsNullOrEmpty(txtIntrestIncome2.Text))
            {
                form1099Int2.InterestIncome = Convert.ToDouble(txtIntrestIncome2.Text);
            }
            if (!string.IsNullOrEmpty(txtFTWIntInc2.Text))
            {
                form1099Int2.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFTWIntInc2.Text);
            }
            tax1040.Income.Form1099INT.Add(form1099Int2);

            //OID
            if (!string.IsNullOrEmpty(txtOID1.Text))
            {
                form1099OID1.OriginalIssueDiscount = Convert.ToDouble(txtOID1.Text);
            }
            if (!string.IsNullOrEmpty(txtFDOID1.Text))
            {
                form1099OID1.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDOID1.Text);
            }
            if (!string.IsNullOrEmpty(txtOPIOID1.Text))
            {
                form1099OID1.OtherPeriodicInterest = Convert.ToDouble(txtOPIOID1.Text);
            }
            tax1040.Income.Form1099OID.Add(form1099OID1);

            if (!string.IsNullOrEmpty(txtOID2.Text))
            {
                form1099OID2.OriginalIssueDiscount = Convert.ToDouble(txtOID2.Text);
            }
            if (!string.IsNullOrEmpty(txtFDOID2.Text))
            {
                form1099OID2.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDOID2.Text);
            }
            if (!string.IsNullOrEmpty(txtOPIOID2.Text))
            {
                form1099OID2.OtherPeriodicInterest = Convert.ToDouble(txtOPIOID2.Text);
            }
            tax1040.Income.Form1099OID.Add(form1099OID2);

            if (!string.IsNullOrEmpty(txtOID3.Text))
            {
                form1099OID3.OriginalIssueDiscount = Convert.ToDouble(txtOID3.Text);
            }
            if (!string.IsNullOrEmpty(txtFDOID3.Text))
            {
                form1099OID3.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDOID3.Text);
            }
            if (!string.IsNullOrEmpty(txtOPIOID3.Text))
            {
                form1099OID3.OtherPeriodicInterest = Convert.ToDouble(txtOPIOID3.Text);
            }
            tax1040.Income.Form1099OID.Add(form1099OID3);

            //..UnEmployment
            if (!string.IsNullOrEmpty(txtg1.Text))
            {
                form1099G1.UnEmploymentCompensation = Convert.ToDouble(txtg1.Text);
            }
            if (!string.IsNullOrEmpty(txtFDG1.Text))
            {
                form1099G1.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDG1.Text);
            }
            //if (!string.IsNullOrEmpty(txtAlaska1.Text))
            //{
            //    form1099G1.AlaskaPermanentFundDividend = Convert.ToDouble(txtAlaska1.Text);
            //}
            tax1040.Income.Form1099G.Add(form1099G1);

            if (!string.IsNullOrEmpty(txtg2.Text))
            {
                form1099G2.UnEmploymentCompensation = Convert.ToDouble(txtg2.Text);
            }
            if (!string.IsNullOrEmpty(txtFDG2.Text))
            {
                form1099G2.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDG2.Text);
            }
            //if (!string.IsNullOrEmpty(txtAlaska2.Text))
            //{
            //    form1099G2.AlaskaPermanentFundDividend = Convert.ToDouble(txtAlaska2.Text);
            //}
            tax1040.Income.Form1099G.Add(form1099G2);

            if (!string.IsNullOrEmpty(txtg3.Text))
            {
                form1099G3.UnEmploymentCompensation = Convert.ToDouble(txtg3.Text);
            }
            if (!string.IsNullOrEmpty(txtFDG3.Text))
            {
                form1099G3.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDG3.Text);
            }
            //if (!string.IsNullOrEmpty(txtAlaska3.Text))
            //{
            //    form1099G3.AlaskaPermanentFundDividend = Convert.ToDouble(txtAlaska3.Text);
            //}
            tax1040.Income.Form1099G.Add(form1099G3);


            //SSB

            if (!string.IsNullOrEmpty(txtNetBenefitSSB.Text))
            {
                socialSecurityBenefit.TaxpayerNetBenefits = Convert.ToDouble(txtNetBenefitSSB.Text);
            }
            if (!string.IsNullOrEmpty(txtFederalWithSSB.Text))
            {
                socialSecurityBenefit.TaxPayerFederalTaxWithheld = Convert.ToDouble(txtFederalWithSSB.Text);
            }
            //tax1040.Income.OtherIncome.SocialSecurityBenefits.Add(socialSecurityBenefit);


            //RRB
            // Modified By:Vincent Modified date:17/2/14
            //Comment: Made the changes in the instance and the Text box field.

            if (!string.IsNullOrEmpty(txtNetBenefitRRB.Text))
            {
                railRoadRetirement.TaxpayerNetBenefits = Convert.ToDouble(txtNetBenefitRRB.Text);
            }
            if (!string.IsNullOrEmpty(txtFederalWithRRB.Text))
            {
                railRoadRetirement.TaxPayerFederalTaxWithheld = Convert.ToDouble(txtFederalWithRRB.Text);
            }
            //tax1040.Income.OtherIncome.RailroadRetirementBenefits.Add(railRoadRetirement);


            tax1040.PersonalDetails = new PersonalDetails();
            tax1040.PersonalDetails.PrimaryTaxPayer        = new PrimaryTaxPayer();
            tax1040.PersonalDetails.PrimaryTaxPayer.Person = new Person();
            tax1040.PersonalDetails.PrimaryTaxPayer.Person.HasClaimedAsDependent = chkHasClaimedAsDependentTP.Checked;
            //Primary Tax Payer DOB
            if (!string.IsNullOrEmpty(txtPrimaryTaxPayerDOB.Text))
            {
                tax1040.PersonalDetails.PrimaryTaxPayer.Person.DateOfBirth =
                    Convert.ToDateTime(txtPrimaryTaxPayerDOB.Text);
            }


            tax1040.PersonalDetails.PrimaryTaxPayer.FilingStatus = (FilingStatus)ddlFilingStatus.SelectedIndex;
            tax1040.PersonalDetails.Spouse        = new Spouse();
            tax1040.PersonalDetails.Spouse.Person = new Person();

            //Spouse Tax Payer DOB
            if (!string.IsNullOrEmpty(txtSpouseDOB.Text))
            {
                tax1040.PersonalDetails.Spouse.Person.DateOfBirth = Convert.ToDateTime(txtSpouseDOB.Text);
            }

            tax1040.PersonalDetails.Spouse.Person.HasClaimedAsDependent = chkHasClaimedAsDependentS.Checked;

            //EIC
            tax1040.Credits     = new Credits();
            tax1040.Credits.EIC = new EIC();
            tax1040.Credits.EIC.IsInUSMorethanHalfYear               = chkLivedInUSStatus.Checked;
            tax1040.Credits.EIC.HasValidSSN                          = chkVaildSSN.Checked;
            tax1040.Credits.EIC.HasClaimedAsQualifyingChild          = chkQualifyingChild.Checked;
            tax1040.Credits.EIC.HasReceivedIRSNoticeOnEICNotEligible = chkIRSNotice.Checked;
            tax1040.Credits.EIC.HasReceivedIRSNoticeOnFiling8862     = chkIRSFiling8862.Checked;
            if (!string.IsNullOrEmpty(txtTaxableScholarshipAmount.Text))
            {
                tax1040.Credits.EIC.TaxableScholarshipCredit = Convert.ToDouble(txtTaxableScholarshipAmount.Text);
            }

            if (!string.IsNullOrEmpty(txtPensionPlansAmount.Text))
            {
                tax1040.Credits.EIC.PensionAnnuity = Convert.ToDouble(txtPensionPlansAmount.Text);
            }

            if (!string.IsNullOrEmpty(txtPenalInstitutionAmount.Text))
            {
                tax1040.Credits.EIC.PenalInstitutionInmateWages = Convert.ToDouble(txtPenalInstitutionAmount.Text);
            }


            //Account
            //25Jul2014 Sathish as discussed moved IRS to federal filing
            tax1040.Filing = new Filing();
            tax1040.Filing.FederalFiling                 = new FederalFiling();
            tax1040.Filing.FederalFiling.IRS             = new IRS();
            tax1040.Filing.FederalFiling.IRS.BankDetails = new BankDetails();
            tax1040.Filing.FederalFiling.IRS.BankDetails.AccountNumber        = "12345678901234567";
            tax1040.Filing.FederalFiling.IRS.BankDetails.RoutingTransitNumber = "123456789";

            tax1040.ThirdPartyDesignee                  = new ThirdPartyDesignee();
            tax1040.PaidTaxReturnPreparers              = new PaidTaxReturnPreparers();
            tax1040.PaidTaxReturnPreparers.Firm         = new Organization();
            tax1040.PaidTaxReturnPreparers.Firm.Address = new Address();
            tax1040.PaidTaxReturnPreparers.Firm.Address.CompanyAddress = new CompanyAddress();
            tax1040.ThirdPartyDesignee.PIN          = "12345";
            tax1040.ThirdPartyDesignee.DesigneeName = "CHARLES";
            tax1040.ThirdPartyDesignee.PhoneNumber  = "1234556767";

            //spouse
            tax1040.PersonalDetails.Spouse.Person.SSN = "123456";
            tax1040.PaidTaxReturnPreparers.PTIN       = "PIN";
            tax1040.PaidTaxReturnPreparers.Date       = DateTime.Now;
            tax1040.PaidTaxReturnPreparers.Firm.Name  = "JEEVAN";
            tax1040.PaidTaxReturnPreparers.Firm.Address.CompanyAddress.District = "NEY JERSY";
            tax1040.PaidTaxReturnPreparers.Firm.EIN = "EIN";
            //tax1040.PaidTaxReturnPreparers.Firm.ControlNumber = 1234567;

            tax1040.ThirdPartyDesignee.PhoneNumber = "123456789";

            var errorMessage = messagesRepository.GetErrorMessages();

            //Converting dictionary
            var errorMessages = new ErrorMessages(errorMessage);

            dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments();

            input.Tax1040Object = tax1040;
            input.ErrorMessages = errorMessages;
            //pass it to the activity no need to cast it
            var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new F1040EZLineByLineCalculation(), input));

            if (tax1040.ErrorMessages.Any())
            {
                foreach (var message in tax1040.ErrorMessages)
                {
                    ValidationError.Display(message.ErrorType + " : " + message.ErrorText);
                }
                lblError.Visible = true;
            }
            else
            {
                Tax1040 tax1040Object = output["Tax1040Object"];
                var     bind          = new F1040EZPDFBinding();
                byte[]  pdfData       = bind.OutPutForm(tax1040Object, Constants.FORM1040EZ_BINDING);

                Response.Clear();
                Response.AddHeader("Accept-Header", pdfData.Length.ToString());
                Response.ContentType = "application/pdf";

                Response.AddHeader("Content-Disposition", "attachment; filename=  FinalBinding" + ".pdf");

                Response.AddHeader("content-length", pdfData.Length.ToString());
                Response.BinaryWrite(pdfData);
                Response.End();
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            var tax1040 = new Tax1040();

            tax1040.Income             = new Income();
            tax1040.Income.W2Wages     = new List <W2>();
            tax1040.Income.Form1099INT = new List <Form1099INT>();
            tax1040.Income.Form1099OID = new List <Form1099OID>();
            tax1040.Income.Form1099G   = new List <Form1099G>();
            //Added

            var w21 = new W2();
            var w22 = new W2();
            var w23 = new W2();


            var form1099Int1 = new Form1099INT();
            var form1099Int2 = new Form1099INT();

            var form1099OID1 = new Form1099OID();
            var form1099OID2 = new Form1099OID();
            var form1099OID3 = new Form1099OID();


            var form1099G1 = new Form1099G();
            var form1099G2 = new Form1099G();
            var form1099G3 = new Form1099G();

            form1099G1.Form1099StateInfo = new List <Form1099StateInformation>();
            form1099G2.Form1099StateInfo = new List <Form1099StateInformation>();
            form1099G3.Form1099StateInfo = new List <Form1099StateInformation>();

            var form1099G1StateInfo1 = new Form1099StateInformation();
            var form1099G2StateInfo2 = new Form1099StateInformation();
            var form1099G3StateInfo3 = new Form1099StateInformation();

            form1099OID1.Form1099StateInfo = new List <Form1099StateInformation>();
            form1099OID2.Form1099StateInfo = new List <Form1099StateInformation>();
            form1099OID3.Form1099StateInfo = new List <Form1099StateInformation>();

            var form1099OIDStateInfo1 = new Form1099StateInformation();
            var form1099OIDStateInfo2 = new Form1099StateInformation();
            var form1099OIDStateInfo3 = new Form1099StateInformation();

            form1099Int1.Form1099StateInfo = new List <Form1099StateInformation>();
            form1099Int2.Form1099StateInfo = new List <Form1099StateInformation>();

            var form1099IntStateInfo1 = new Form1099StateInformation();
            var form1099IntStateInfo2 = new Form1099StateInformation();

            w21.W2StateLocalTaxInfo = new List <W2StateLocalTaxInfo>();
            w22.W2StateLocalTaxInfo = new List <W2StateLocalTaxInfo>();
            w23.W2StateLocalTaxInfo = new List <W2StateLocalTaxInfo>();

            var w2StateLocalTaxInfo1 = new W2StateLocalTaxInfo();
            var w2StateLocalTaxInfo2 = new W2StateLocalTaxInfo();
            var w2StateLocalTaxInfo3 = new W2StateLocalTaxInfo();


            var socialSecurityBenefit1 = new SocialSecurityBenefits();
            var socialSecurityBenefit2 = new SocialSecurityBenefits();

            var railRoadRetirement1 = new RailroadRetirementIncome();
            var railRoadRetirement2 = new RailroadRetirementIncome(); //added a New Instance

            //tax1040.Income.OtherIncome=new OtherIncome
            //    {
            //        SocialSecurityBenefits = new List<SocialSecurityBenefits>(),
            //        RailroadRetirementBenefits = new List<RailroadRetirementIncome>()
            //    };
            tax1040.Income.OtherIncome     = new OtherIncome();
            tax1040.Income.OtherIncome.RRB = new RailroadRetirementIncome();
            tax1040.Income.OtherIncome.SSB = new SocialSecurityBenefits();

            //form8862
            var form8862 = new Form8862();
            //
            var form8862Page1 = new Tax8862Page1();

            //W2
            if (!string.IsNullOrEmpty(txtW21.Text))
            {
                w21.WagesAmount = Convert.ToDouble(txtW21.Text);
            }
            if (!string.IsNullOrEmpty(txtFTW21.Text))
            {
                w21.FederalTaxWithholdingAmount = Convert.ToDouble(txtFTW21.Text);
            }
            if (!string.IsNullOrEmpty(txtSocialSecurityWages1.Text))
            {
                w21.SocialSecurityWagesAmount = Convert.ToDouble(txtSocialSecurityWages1.Text);
            }

            if (!string.IsNullOrEmpty(txtSocialSecurityWithholding1.Text))
            {
                w21.SocialSecurityTaxWithholdingAmount = Convert.ToDouble(txtSocialSecurityWithholding1.Text);
            }
            ////newly added by vincent for UI Input
            if (!string.IsNullOrEmpty(txtMedicareWithheld1.Text))
            {
                w21.MedicareTaxWithholdingAmount = Convert.ToDouble(txtMedicareWithheld1.Text);
            }

            if (!string.IsNullOrEmpty(txtAllocatedTips1.Text))
            {
                w21.AllocatedTipsAmount = Convert.ToDouble(txtAllocatedTips1.Text);
            }

            if (!string.IsNullOrEmpty(txtDependentCareBenefits1.Text))
            {
                w21.DependentCareBenefitsAmount = Convert.ToDouble(txtDependentCareBenefits1.Text);
            }

            if (!string.IsNullOrEmpty(txtMedicareWages1.Text))
            {
                w21.MedicareWagesAmount = Convert.ToDouble(txtMedicareWages1.Text);
            }

            tax1040.Income.W2Wages.Add(w21);


            //added
            if (!string.IsNullOrEmpty(txtStateWagesWTH1.Text))
            {
                w2StateLocalTaxInfo1.StateTaxWithholdingAmount = Convert.ToDouble(txtStateWagesWTH1.Text);
            }
            if (!string.IsNullOrEmpty(txtStateWages1.Text))
            {
                w2StateLocalTaxInfo1.StateWagesAmount = Convert.ToDouble(txtStateWages1.Text);
            }

            w21.W2StateLocalTaxInfo.Add(w2StateLocalTaxInfo1);

            //w22
            if (!string.IsNullOrEmpty(txtW22.Text))
            {
                w22.WagesAmount = Convert.ToDouble(txtW22.Text);
            }
            if (!string.IsNullOrEmpty(txtFTW2.Text))
            {
                w22.FederalTaxWithholdingAmount = Convert.ToDouble(txtFTW2.Text);
            }

            if (!string.IsNullOrEmpty(txtSocialSecurityWages2.Text))
            {
                w22.SocialSecurityWagesAmount = Convert.ToDouble(txtSocialSecurityWages2.Text);
            }

            if (!string.IsNullOrEmpty(txtSocialSecurityWithholding2.Text))
            {
                w22.SocialSecurityTaxWithholdingAmount = Convert.ToDouble(txtSocialSecurityWithholding2.Text);
            }
            ////newly added by vincent for UI Input
            if (!string.IsNullOrEmpty(txtMedicareWithheld2.Text))
            {
                w22.MedicareTaxWithholdingAmount = Convert.ToDouble(txtMedicareWithheld2.Text);
            }

            if (!string.IsNullOrEmpty(txtAllocatedTips2.Text))
            {
                w22.AllocatedTipsAmount = Convert.ToDouble(txtAllocatedTips2.Text);
            }

            if (!string.IsNullOrEmpty(txtDependentCareBenefits2.Text))
            {
                w22.DependentCareBenefitsAmount = Convert.ToDouble(txtDependentCareBenefits2.Text);
            }

            if (!string.IsNullOrEmpty(txtMedicareWages2.Text))
            {
                w22.MedicareWagesAmount = Convert.ToDouble(txtMedicareWages2.Text);
            }

            tax1040.Income.W2Wages.Add(w22);
            //added
            if (!string.IsNullOrEmpty(txtStateWagesWTH2.Text))
            {
                w2StateLocalTaxInfo2.StateTaxWithholdingAmount = Convert.ToDouble(txtStateWagesWTH2.Text);
            }
            if (!string.IsNullOrEmpty(txtStateWages2.Text))
            {
                w2StateLocalTaxInfo2.StateWagesAmount = Convert.ToDouble(txtStateWages2.Text);
            }
            w22.W2StateLocalTaxInfo.Add(w2StateLocalTaxInfo2);

            //w23
            if (!string.IsNullOrEmpty(txtW23.Text))
            {
                w23.WagesAmount = Convert.ToDouble(txtW23.Text);
            }
            if (!string.IsNullOrEmpty(txtFTW3.Text))
            {
                w23.FederalTaxWithholdingAmount = Convert.ToDouble(txtFTW3.Text);
            }


            if (!string.IsNullOrEmpty(txtSocialSecurityWages3.Text))
            {
                w23.SocialSecurityWagesAmount = Convert.ToDouble(txtSocialSecurityWages3.Text);
            }

            if (!string.IsNullOrEmpty(txtSocialSecurityWithholding3.Text))
            {
                w23.SocialSecurityTaxWithholdingAmount = Convert.ToDouble(txtSocialSecurityWithholding3.Text);
            }
            ////newly added by vincent for UI Input
            if (!string.IsNullOrEmpty(txtMedicareWithheld3.Text))
            {
                w23.MedicareTaxWithholdingAmount = Convert.ToDouble(txtMedicareWithheld3.Text);
            }

            if (!string.IsNullOrEmpty(txtAllocatedTips3.Text))
            {
                w23.AllocatedTipsAmount = Convert.ToDouble(txtAllocatedTips3.Text);
            }
            if (!string.IsNullOrEmpty(txtDependentCareBenefits3.Text))
            {
                w23.DependentCareBenefitsAmount = Convert.ToDouble(txtDependentCareBenefits3.Text);
            }

            if (!string.IsNullOrEmpty(txtMedicareWages3.Text))
            {
                w23.MedicareWagesAmount = Convert.ToDouble(txtMedicareWages3.Text);
            }


            tax1040.Income.W2Wages.Add(w23);
            //added
            if (!string.IsNullOrEmpty(txtStateWagesWTH3.Text))
            {
                w2StateLocalTaxInfo3.StateTaxWithholdingAmount = Convert.ToDouble(txtStateWagesWTH3.Text);
            }
            if (!string.IsNullOrEmpty(txtStateWages3.Text))
            {
                w2StateLocalTaxInfo3.StateWagesAmount = Convert.ToDouble(txtStateWages3.Text);
            }

            w23.W2StateLocalTaxInfo.Add(w2StateLocalTaxInfo3);

            if (!string.IsNullOrEmpty((txtw2Line11Amount.Text)))
            {
                w21.NonQualifiedPlansAmount = Convert.ToDouble(txtw2Line11Amount.Text);
            }

            //W2 Line 8B

            tax1040.Income.W2Wages[0].W2EmployerCodes = new List <W2EmployerCode>();
            var W2Emp1 = new W2EmployerCode();

            W2Emp1.EmployerCode = (EmployerCode)ddlw212a.SelectedIndex;

            if (!string.IsNullOrEmpty(txtW212aAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW212aAmount.Text);
            }
            tax1040.Income.W2Wages[0].W2EmployerCodes.Add(W2Emp1);

            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlW212b.SelectedIndex;
            if (!string.IsNullOrEmpty(txtW212bAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW212bAmount.Text);
            }
            tax1040.Income.W2Wages[0].W2EmployerCodes.Add(W2Emp1);


            tax1040.Income.W2Wages[1].W2EmployerCodes = new List <W2EmployerCode>();

            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlw2212a.SelectedIndex;

            if (!string.IsNullOrEmpty(txtW2212aAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW2212aAmount.Text);
            }

            tax1040.Income.W2Wages[1].W2EmployerCodes.Add(W2Emp1);

            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlW2212b.SelectedIndex;

            if (!string.IsNullOrEmpty(txtW2212bAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW2212bAmount.Text);
            }
            tax1040.Income.W2Wages[1].W2EmployerCodes.Add(W2Emp1);



            tax1040.Income.W2Wages[2].W2EmployerCodes = new List <W2EmployerCode>();
            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlw2312a.SelectedIndex;

            if (!string.IsNullOrEmpty(txtW2312aAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW2312aAmount.Text);
            }

            tax1040.Income.W2Wages[2].W2EmployerCodes.Add(W2Emp1);

            W2Emp1 = new W2EmployerCode();
            W2Emp1.EmployerCode = (EmployerCode)ddlW2312b.SelectedIndex;
            if (!string.IsNullOrEmpty(txtW2312bAmount.Text))
            {
                W2Emp1.Amount = Convert.ToDouble(txtW2312bAmount.Text);
            }
            tax1040.Income.W2Wages[2].W2EmployerCodes.Add(W2Emp1);


            //1099 INT
            if (!string.IsNullOrEmpty(txtIntrestIncome1.Text))
            {
                form1099Int1.InterestIncome = Convert.ToDouble(txtIntrestIncome1.Text);
            }
            if (!string.IsNullOrEmpty(txtFTWIntInc1.Text))
            {
                form1099Int1.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFTWIntInc1.Text);
            }
            //newly added by vivek from UI
            if (!string.IsNullOrEmpty(txtEarlyWithdrawalPenalty1.Text))
            {
                form1099Int1.EarlyWithdrawalPenalty = Convert.ToDouble(txtEarlyWithdrawalPenalty1.Text);
            }

            if (!string.IsNullOrEmpty(txtInvestment1.Text))
            {
                form1099Int1.InvestmentExpenses = Convert.ToDouble(txtInvestment1.Text);
            }
            if (!string.IsNullOrEmpty(txtForeignTaxPaid1.Text))
            {
                form1099Int1.ForeignTaxPaid = Convert.ToDouble(txtForeignTaxPaid1.Text);
            }
            tax1040.Income.Form1099INT.Add(form1099Int1);
            //added
            if (!string.IsNullOrEmpty(txtStateTaxWithHoldInt1.Text))
            {
                form1099IntStateInfo1.StateTaxWithholdingAmount = Convert.ToDouble(txtStateTaxWithHoldInt1.Text);

                form1099OID1.Form1099StateInfo.Add(form1099IntStateInfo1);
            }

            if (!string.IsNullOrEmpty(txtIntrestIncome2.Text))
            {
                form1099Int2.InterestIncome = Convert.ToDouble(txtIntrestIncome2.Text);
            }
            if (!string.IsNullOrEmpty(txtFTWIntInc2.Text))
            {
                form1099Int2.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFTWIntInc2.Text);
            }
            //newly added by vivek from UI
            if (!string.IsNullOrEmpty(txtEarlyWithdrawalPenalty2.Text))
            {
                form1099Int2.EarlyWithdrawalPenalty = Convert.ToDouble(txtEarlyWithdrawalPenalty2.Text);
            }

            if (!string.IsNullOrEmpty(txtInvestment2.Text))
            {
                form1099Int2.InvestmentExpenses = Convert.ToDouble(txtInvestment2.Text);
            }
            if (!string.IsNullOrEmpty(txtForeignTaxPaid2.Text))
            {
                form1099Int2.ForeignTaxPaid = Convert.ToDouble(txtForeignTaxPaid2.Text);
            }
            tax1040.Income.Form1099INT.Add(form1099Int2);

            //added

            if (!string.IsNullOrEmpty(txtStateTaxWithHoldInt2.Text))
            {
                form1099IntStateInfo2.StateTaxWithholdingAmount = Convert.ToDouble(txtStateTaxWithHoldInt2.Text);

                form1099OID1.Form1099StateInfo.Add(form1099IntStateInfo2);
            }

            //OID
            if (!string.IsNullOrEmpty(txtOID1.Text))
            {
                form1099OID1.OriginalIssueDiscount = Convert.ToDouble(txtOID1.Text);
            }
            if (!string.IsNullOrEmpty(txtFDOID1.Text))
            {
                form1099OID1.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDOID1.Text);
            }
            if (!string.IsNullOrEmpty(txtOPIOID1.Text))
            {
                form1099OID1.OtherPeriodicInterest = Convert.ToDouble(txtOPIOID1.Text);
            }
            //newly added by vivek from UI
            if (!string.IsNullOrEmpty(txtWithdrawalPenalty1.Text))
            {
                form1099OID1.EarlyWithdrawalPenalty = Convert.ToDouble(txtWithdrawalPenalty1.Text);
            }

            //10/3/14 Vincent made the changes in input text box ID
            if (!string.IsNullOrEmpty(txtMarketDiscount1.Text))
            {
                form1099OID1.IncomeMarketDiscount = Convert.ToDouble(txtMarketDiscount1.Text);
            }
            if (!string.IsNullOrEmpty(txtUSTreasury1.Text))
            {
                form1099OID1.USTreasuryObligations = Convert.ToDouble(txtUSTreasury1.Text);
            }
            if (!string.IsNullOrEmpty(txtInvestmentExpenses1.Text))
            {
                form1099OID1.InvestmentExpenses = Convert.ToDouble(txtInvestmentExpenses1.Text);
            }
            tax1040.Income.Form1099OID.Add(form1099OID1);
            //add
            if (!string.IsNullOrEmpty(txtAcquisition1.Text))
            {
                form1099OID1.AcquisitionPremium = Convert.ToDouble(txtAcquisition1.Text);
            }

            if (!string.IsNullOrEmpty(txtStateTaxWithHoldOID1.Text))
            {
                form1099OIDStateInfo1.StateTaxWithholdingAmount = Convert.ToDouble(txtStateTaxWithHoldOID1.Text);

                form1099OID1.Form1099StateInfo.Add(form1099OIDStateInfo1);
            }


            if (!string.IsNullOrEmpty(txtOID2.Text))
            {
                form1099OID2.OriginalIssueDiscount = Convert.ToDouble(txtOID2.Text);
            }
            if (!string.IsNullOrEmpty(txtFDOID2.Text))
            {
                form1099OID2.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDOID2.Text);
            }
            if (!string.IsNullOrEmpty(txtOPIOID2.Text))
            {
                form1099OID2.OtherPeriodicInterest = Convert.ToDouble(txtOPIOID2.Text);
            }

            //newly added by vivek from UI
            if (!string.IsNullOrEmpty(txtWithdrawalPenalty2.Text))
            {
                form1099OID2.EarlyWithdrawalPenalty = Convert.ToDouble(txtWithdrawalPenalty2.Text);
            }

            if (!string.IsNullOrEmpty(txtMarketDiscount2.Text))
            {
                form1099OID2.IncomeMarketDiscount = Convert.ToDouble(txtMarketDiscount2.Text);
            }
            if (!string.IsNullOrEmpty(txtUSTreasury2.Text))
            {
                form1099OID2.USTreasuryObligations = Convert.ToDouble(txtUSTreasury2.Text);
            }
            if (!string.IsNullOrEmpty(txtInvestmentExpenses2.Text))
            {
                form1099OID2.InvestmentExpenses = Convert.ToDouble(txtInvestmentExpenses2.Text);
            }
            tax1040.Income.Form1099OID.Add(form1099OID2);
            //added
            if (!string.IsNullOrEmpty(txtAcquisition2.Text))
            {
                form1099OID2.AcquisitionPremium = Convert.ToDouble(txtAcquisition2.Text);
            }

            if (!string.IsNullOrEmpty(txtStateTaxWithHoldOID2.Text))
            {
                form1099OIDStateInfo2.StateTaxWithholdingAmount = Convert.ToDouble(txtStateTaxWithHoldOID2.Text);

                form1099OID2.Form1099StateInfo.Add(form1099OIDStateInfo2);
            }

            if (!string.IsNullOrEmpty(txtOID3.Text))
            {
                form1099OID3.OriginalIssueDiscount = Convert.ToDouble(txtOID3.Text);
            }
            if (!string.IsNullOrEmpty(txtFDOID3.Text))
            {
                form1099OID3.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDOID3.Text);
            }
            if (!string.IsNullOrEmpty(txtOPIOID3.Text))
            {
                form1099OID3.OtherPeriodicInterest = Convert.ToDouble(txtOPIOID3.Text);
            }
            //newly added by vivek from UI
            if (!string.IsNullOrEmpty(txtWithdrawalPenalty3.Text))
            {
                form1099OID3.EarlyWithdrawalPenalty = Convert.ToDouble(txtWithdrawalPenalty3.Text);
            }

            if (!string.IsNullOrEmpty(txtMarketDiscount3.Text))
            {
                form1099OID3.IncomeMarketDiscount = Convert.ToDouble(txtMarketDiscount3.Text);
            }
            if (!string.IsNullOrEmpty(txtUSTreasury3.Text))
            {
                form1099OID3.USTreasuryObligations = Convert.ToDouble(txtUSTreasury3.Text);
            }
            if (!string.IsNullOrEmpty(txtInvestmentExpenses3.Text))
            {
                form1099OID3.InvestmentExpenses = Convert.ToDouble(txtInvestmentExpenses3.Text);
            }
            tax1040.Income.Form1099OID.Add(form1099OID3);
            //added
            if (!string.IsNullOrEmpty(txtAcquisition3.Text))
            {
                form1099OID3.AcquisitionPremium = Convert.ToDouble(txtAcquisition3.Text);
            }

            if (!string.IsNullOrEmpty(txtStateTaxWithHoldOID3.Text))
            {
                form1099OIDStateInfo3.StateTaxWithholdingAmount = Convert.ToDouble(txtStateTaxWithHoldOID3.Text);

                form1099OID3.Form1099StateInfo.Add(form1099OIDStateInfo3);
            }

            //..UnEmployment
            if (!string.IsNullOrEmpty(txtg1.Text))
            {
                form1099G1.UnEmploymentCompensation = Convert.ToDouble(txtg1.Text);
            }
            if (!string.IsNullOrEmpty(txtFDG1.Text))
            {
                form1099G1.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDG1.Text);
            }
            //if (!string.IsNullOrEmpty(txtAlaska1.Text))
            //{

            //    form1099G1.AlaskaPermanentFundDividend = Convert.ToDouble(txtAlaska1.Text);
            //}
            //added
            //if (!string.IsNullOrEmpty(txtStateLocalTax1.Text))
            //{

            //    form1099G1.StateOrLocalIncomeTaxRefunds = Convert.ToDouble(txtStateLocalTax1.Text);
            //}

            if (!string.IsNullOrEmpty(txtStateTaxWithHold1.Text))
            {
                form1099G1StateInfo1.StateTaxWithholdingAmount = Convert.ToDouble(txtStateTaxWithHold1.Text);
                form1099G1.Form1099StateInfo.Add(form1099G1StateInfo1);
            }


            tax1040.Income.Form1099G.Add(form1099G1);

            if (!string.IsNullOrEmpty(txtg2.Text))
            {
                form1099G2.UnEmploymentCompensation = Convert.ToDouble(txtg2.Text);
            }
            if (!string.IsNullOrEmpty(txtFDG2.Text))
            {
                form1099G2.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDG2.Text);
            }
            //if (!string.IsNullOrEmpty(txtAlaska2.Text))
            //{
            //    form1099G2.AlaskaPermanentFundDividend = Convert.ToDouble(txtAlaska2.Text);
            //}
            //added
            //if (!string.IsNullOrEmpty(txtStateLocalTax2.Text))
            //{
            //    form1099G2.StateOrLocalIncomeTaxRefunds = Convert.ToDouble(txtStateLocalTax2.Text);
            //}
            if (!string.IsNullOrEmpty(txtStateTaxWithHold2.Text))
            {
                form1099G2StateInfo2.StateTaxWithholdingAmount = Convert.ToDouble(txtStateTaxWithHold2.Text);
                form1099G2.Form1099StateInfo.Add(form1099G2StateInfo2);
            }

            tax1040.Income.Form1099G.Add(form1099G2);

            if (!string.IsNullOrEmpty(txtg3.Text))
            {
                form1099G3.UnEmploymentCompensation = Convert.ToDouble(txtg3.Text);
            }
            if (!string.IsNullOrEmpty(txtFDG3.Text))
            {
                form1099G3.FederalTaxWithHoldingAmount = Convert.ToDouble(txtFDG3.Text);
            }
            //if (!string.IsNullOrEmpty(txtAlaska3.Text))
            //{
            //    form1099G3.AlaskaPermanentFundDividend = Convert.ToDouble(txtAlaska3.Text);
            //}

            //added
            //if (!string.IsNullOrEmpty(txtStateLocalTax3.Text))
            //{
            //    form1099G3.StateOrLocalIncomeTaxRefunds = Convert.ToDouble(txtStateLocalTax3.Text);
            //}

            if (!string.IsNullOrEmpty(txtStateTaxWithHold3.Text))
            {
                form1099G3StateInfo3.StateTaxWithholdingAmount = Convert.ToDouble(txtStateTaxWithHold3.Text);
                form1099G3.Form1099StateInfo.Add(form1099G3StateInfo3);
            }

            tax1040.Income.Form1099G.Add(form1099G3);

            ////SSB

            if (!string.IsNullOrEmpty(txtNetBenefitSSB1.Text))
            {
                socialSecurityBenefit1.TaxpayerNetBenefits = Convert.ToDouble(txtNetBenefitSSB1.Text);
            }
            if (!string.IsNullOrEmpty(txtFederalWithSSB1.Text))
            {
                socialSecurityBenefit1.TaxPayerFederalTaxWithheld = Convert.ToDouble(txtFederalWithSSB1.Text);
            }

            if (!string.IsNullOrEmpty(txtNetBenefitSSB2.Text))
            {
                socialSecurityBenefit1.SpouseNetBenefits = Convert.ToDouble(txtNetBenefitSSB2.Text);
            }
            if (!string.IsNullOrEmpty(txtFederalWithSSB2.Text))
            {
                socialSecurityBenefit1.SpouseFederalTaxWithheld = Convert.ToDouble(txtFederalWithSSB2.Text);
            }
            tax1040.Income.OtherIncome.SSB = socialSecurityBenefit1;

            ////added

            //if (!string.IsNullOrEmpty(txtNetBenefitSSB2.Text))
            //{
            //    socialSecurityBenefit2.NetBenefits = Convert.ToDouble(txtNetBenefitSSB2.Text);
            //}
            //if (!string.IsNullOrEmpty(txtFederalWithSSB2.Text))
            //{
            //    socialSecurityBenefit2.FederalTaxWithholdingAmount = Convert.ToDouble(txtFederalWithSSB2.Text);
            //}
            //tax1040.Income.OtherIncome.SocialSecurityBenefits.Add(socialSecurityBenefit2);

            //if (!string.IsNullOrEmpty(txtIntrestIncome2.Text))
            //{
            //    form1099Int2.InterestIncome = Convert.ToDouble(txtIntrestIncome2.Text);
            //}

            //RRB
            // Modified By:Vincent Modified date:17/2/14
            //Comment: Made the changes in the instance and the Text box field.
            if (!string.IsNullOrEmpty(txtNetBenefitRRB1.Text))
            {
                railRoadRetirement1.TaxpayerNetBenefits = Convert.ToDouble(txtNetBenefitRRB1.Text);
            }
            if (!string.IsNullOrEmpty(txtFederalWithRRB1.Text))
            {
                railRoadRetirement1.TaxPayerFederalTaxWithheld = Convert.ToDouble(txtFederalWithRRB1.Text);
            }

            if (!string.IsNullOrEmpty(txtNetBenefitRRB2.Text))
            {
                railRoadRetirement1.SpouseNetBenefits = Convert.ToDouble(txtNetBenefitRRB2.Text);
            }
            if (!string.IsNullOrEmpty(txtFederalWithRRB2.Text))
            {
                railRoadRetirement1.SpouseFederalTaxWithheld = Convert.ToDouble(txtFederalWithRRB2.Text);
            }

            tax1040.Income.OtherIncome.RRB = railRoadRetirement1;

            //if (!string.IsNullOrEmpty(txtNetBenefitRRB2.Text))
            //{
            //    railRoadRetirement2.NetBenefits = Convert.ToDouble(txtNetBenefitRRB2.Text);
            //}
            //if (!string.IsNullOrEmpty(txtFederalWithRRB2.Text))
            //{
            //    railRoadRetirement2.FederalTaxWithholdingAmount = Convert.ToDouble(txtFederalWithRRB2.Text);
            //}
            //tax1040.Income.OtherIncome.RailroadRetirementBenefits.Add(railRoadRetirement2);

            // //form8862
            form8862.HasEICdisallowed = chkEICdisallowed.Checked;

            form8862.HasReportedIncorrectIncome = chkReportedIncorrectIncome.Checked;

            form8862.HasDaysLivedInUS = chkDaysLivedInUS.Checked;

            //Bala, 26-Jun-14, added for Testing purpose
            form8862Page1.HasReportedIncorrectIncome  = chkReportedIncorrectIncome.Checked;
            form8862Page1.HasClaimedAsQualifyingChild = chkQualifyingChild.Checked;
            form8862Page1.YearOfFiling = 2015;

            if (!string.IsNullOrEmpty(txtTaxpayer8862.Text))
            {
                form8862.DaysLivedInUS = Convert.ToInt32(txtTaxpayer8862.Text);
                form8862Page1.DaysTaxPayerLivedInUS = Convert.ToInt32(txtTaxpayer8862.Text);
            }

            if (!string.IsNullOrEmpty(txtspouse8862.Text))
            {
                form8862.DaysSpouseLivedInUS      = Convert.ToInt32(txtspouse8862.Text);
                form8862Page1.DaysSpouseLivedInUS = Convert.ToInt32(txtspouse8862.Text);
            }
            tax1040.Income.Form8862 = form8862;

            tax1040.PersonalDetails = new PersonalDetails();
            tax1040.PersonalDetails.PrimaryTaxPayer        = new PrimaryTaxPayer();
            tax1040.PersonalDetails.PrimaryTaxPayer.Person = new Person();
            tax1040.PersonalDetails.PrimaryTaxPayer.Person.HasClaimedAsDependent = chkHasClaimedAsDependentTP.Checked;

            tax1040.PersonalDetails.PrimaryTaxPayer.Person.FirstName = "Primary Tax Payer.";
            tax1040.PersonalDetails.PrimaryTaxPayer.Person.SSN       = "22-344-1234";

            //Primary Tax Payer DOB
            if (!string.IsNullOrEmpty(txtPrimaryTaxPayerDOB.Text))
            {
                tax1040.PersonalDetails.PrimaryTaxPayer.Person.DateOfBirth =
                    Convert.ToDateTime(txtPrimaryTaxPayerDOB.Text);
            }
            //Date of death
            if (!string.IsNullOrEmpty(txtTpDateOfDeath.Text))
            {
                tax1040.PersonalDetails.PrimaryTaxPayer.Person.DateOfDeath =
                    Convert.ToDateTime(txtTpDateOfDeath.Text);
            }

            tax1040.PersonalDetails.PrimaryTaxPayer.FilingStatus = (FilingStatus)ddlFilingStatus.SelectedIndex;
            tax1040.PersonalDetails.Spouse        = new Spouse();
            tax1040.PersonalDetails.Spouse.Person = new Person();

            //Spouse Tax Payer DOB
            if (!string.IsNullOrEmpty(txtSpouseDOB.Text))
            {
                tax1040.PersonalDetails.Spouse.Person.DateOfBirth = Convert.ToDateTime(txtSpouseDOB.Text);
            }

            //Spouse Date of death
            if (!string.IsNullOrEmpty(txtSpouseDateOfDeath.Text))
            {
                tax1040.PersonalDetails.Spouse.Person.DateOfDeath = Convert.ToDateTime(txtSpouseDateOfDeath.Text);
            }
            tax1040.PersonalDetails.Spouse.Person.HasClaimedAsDependent = chkHasClaimedAsDependentS.Checked;

            //EIC
            tax1040.Credits     = new Credits();
            tax1040.Credits.EIC = new EIC();
            tax1040.Credits.EIC.IsInUSMorethanHalfYear               = chkLivedInUSStatus.Checked;
            tax1040.Credits.EIC.HasValidSSN                          = chkVaildSSN.Checked;
            tax1040.Credits.EIC.HasClaimedAsQualifyingChild          = chkQualifyingChild.Checked;
            tax1040.Credits.EIC.HasReceivedIRSNoticeOnEICNotEligible = chkIRSNotice.Checked;
            tax1040.Credits.EIC.HasReceivedIRSNoticeOnFiling8862     = chkIRSFiling8862.Checked;
            if (!string.IsNullOrEmpty(txtTaxableScholarshipAmount.Text))
            {
                tax1040.Credits.EIC.TaxableScholarshipCredit = Convert.ToDouble(txtTaxableScholarshipAmount.Text);
            }

            if (!string.IsNullOrEmpty(txtPensionPlansAmount.Text))
            {
                tax1040.Credits.EIC.PensionAnnuity = Convert.ToDouble(txtPensionPlansAmount.Text);
            }

            if (!string.IsNullOrEmpty(txtPenalInstitutionAmount.Text))
            {
                tax1040.Credits.EIC.PenalInstitutionInmateWages = Convert.ToDouble(txtPenalInstitutionAmount.Text);
            }
            //Account
            //25Jul2014 Sathish as discussed moved IRS to federal filing
            tax1040.Filing = new Filing();
            tax1040.Filing.FederalFiling                 = new FederalFiling();
            tax1040.Filing.FederalFiling.IRS             = new IRS();
            tax1040.Filing.FederalFiling.IRS.BankDetails = new BankDetails();
            tax1040.Filing.FederalFiling.IRS.BankDetails.AccountNumber        = "12345678901234567";
            tax1040.Filing.FederalFiling.IRS.BankDetails.RoutingTransitNumber = "123456789";

            tax1040.ThirdPartyDesignee                  = new ThirdPartyDesignee();
            tax1040.PaidTaxReturnPreparers              = new PaidTaxReturnPreparers();
            tax1040.PaidTaxReturnPreparers.Firm         = new Organization();
            tax1040.PaidTaxReturnPreparers.Firm.Address = new Address();
            tax1040.PaidTaxReturnPreparers.Firm.Address.CompanyAddress = new CompanyAddress();
            tax1040.ThirdPartyDesignee.PIN          = "12345";
            tax1040.ThirdPartyDesignee.DesigneeName = "CHARLES";
            tax1040.ThirdPartyDesignee.PhoneNumber  = "1234556767";

            //spouse
            tax1040.PersonalDetails.Spouse.Person.SSN = "123456";
            tax1040.PaidTaxReturnPreparers.PTIN       = "PIN";
            tax1040.PaidTaxReturnPreparers.Date       = DateTime.Now;
            tax1040.PaidTaxReturnPreparers.Firm.Name  = "JEEVAN";
            tax1040.PaidTaxReturnPreparers.Firm.Address.CompanyAddress.District = "NEY JERSY";
            tax1040.PaidTaxReturnPreparers.Firm.EIN = "EIN";
            //tax1040.PaidTaxReturnPreparers.Firm.ControlNumber = 1234567;

            tax1040.ThirdPartyDesignee.PhoneNumber = "123456789";

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

            tax1040.ErrorMessages = new List <ErrorMessage>();
            dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments();

            // Added to check the Worksheet Bindings
            tax1040.OutputForms = new OutputForms();
            //tax1040.OutputForms.Tax1040EZPage1 = new Tax1040EZPage1();
            //var tax1040EZPage1 = new Tax1040EZPage1();
            //tax1040EZPage1.TotalWages = 10000;
            //tax1040EZPage1.AdjustedGrossIncome = 15500;
            //tax1040EZPage1.TaxableInterest = 1000;
            //tax1040EZPage1.TEI = 200;
            //tax1040EZPage1.UnemploymentCompensation = 400;
            //tax1040.OutputForms.Tax1040EZPage1 = tax1040EZPage1;
            tax1040.OutputForms.Tax8862Page1 = form8862Page1;

            input.Tax1040Object = tax1040;

            input.ErrorMessages = errorMessages;
            // pass it to the activity no need to cast it
            //var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new Tax1040WorkFlow.WorkFlow.Activities.F1040EZLineByLineCalculation(), input));
            //As

            var output = input;


            // Added to check the Worksheet Bindings
            //var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new Tax1040WorkFlow.WorkFlow.F1040EZStandardDeduction(), input));
            //var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new Tax1040WorkFlow.WorkFlow.Activities.Form1040EZSSBEligiblity(), input));
            //var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary(WorkflowInvoker.Invoke(new Tax1040WorkFlow.WorkFlow.Activities.F1040EZEarnedIncomeCreditCalculation(), input));
            if (tax1040.ErrorMessages != null && tax1040.ErrorMessages.Any())
            {
                foreach (var message in tax1040.ErrorMessages)
                {
                    ValidationError.Display(message.ErrorType + " : " + message.ErrorText);
                }

                lblError.Visible = true;

                //TODO:Have to Handle in later.

                //if (!tax1040.ErrorMessages.Any(er => er.ErrorType == Constants.ErrorTypes.ERROR))
                //{
                //    Generate1040EZForm(output);
                //}
            }
            else
            {
                Generate1040EZForm(output);
            }

            Generate1040EZForm(output);
        }