Esempio n. 1
0
        /// <summary>
        /// Method executes during page load
        /// </summary>
        public void MachineExecute()
        {
            //used to set wizard header
            Machine["ListSection"]    = LookupUtil.GetValues(LookupTable.WizEmployerRegistration, null, "{DisplaySortOrder}", null);
            Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.WizEmployerRegistration, LookupTable_WizEmployerRegistration.EnterLiabilityInformation);
            Machine["ShowHeader"]     = false;

            //initialize EmployerRegistration object and required address objects
            Machine["EmployerRegistration"] = new EmployerRegistrationViewModel();
            Machine["EntityAddress"]        = new AddressLinkDto()
            {
                Address = new AddressDto()
                {
                    StateCode = LookupTable_StatePrvnc.Washington, CountryCode = LookupTable_Country.UnitedStates
                }, AddressTypeCode = LookupTable_AddressType.Mailing
            };
            Machine["PhysicalAddress"] = new AddressLinkDto()
            {
                Address = new AddressDto()
                {
                    StateCode = LookupTable_StatePrvnc.Washington, CountryCode = LookupTable_Country.UnitedStates
                }, AddressTypeCode = LookupTable_AddressType.Physical
            };
            Machine["BusinessAddress"] = new AddressLinkDto()
            {
                Address = new AddressDto()
                {
                    StateCode = LookupTable_StatePrvnc.Washington, CountryCode = LookupTable_Country.UnitedStates
                }, AddressTypeCode = LookupTable_AddressType.Business
            };
            Machine["YearList"] = DateUtil.PopulateYears(Convert.ToInt16(LookupTable_WageDetailUnitYears.YearsForWageFiling), 0, false);
        }
Esempio n. 2
0
        /// <summary>
        /// Validates 'Employer Identification' wizard step
        /// </summary>
        public void EmpIdentificationNext()
        {
            var employerRegistration = (EmployerRegistrationViewModel)Machine["EmployerRegistration"];

            if (employerRegistration.EmployerDto.EmployerLiability.HasPaid450RegularWages == true || employerRegistration.EmployerDto.EmployerLiability.HasEmployed1In20Weeks == true)
            {
                employerRegistration.EmployerDto.BusinessTypeCode = LookupTable_BusinessType.NonAgriculturalRegularEmployment;
            }
            if (employerRegistration.EmployerDto.EmployerLiability.HasPaid20KAgriculturalLaborWages == true || employerRegistration.EmployerDto.EmployerLiability.HasEmployed10In20Weeks == true)
            {
                employerRegistration.EmployerDto.BusinessTypeCode = LookupTable_BusinessType.Agricultural;
            }
            if (employerRegistration.EmployerDto.EmployerLiability.HasPaid1KDomesticWages == true)
            {
                employerRegistration.EmployerDto.BusinessTypeCode = LookupTable_BusinessType.Domestic;
            }
            string entityTypeCode = employerRegistration.EmployerDto.EntityTypeCode;

            Machine["IsPublicEntity"] = entityTypeCode.Equals(LookupTable_LegalEntity.City) || entityTypeCode.Equals(LookupTable_LegalEntity.GovernmentStateAgency) || entityTypeCode.Equals(LookupTable_LegalEntity.LocalPublicBody) || entityTypeCode.Equals(LookupTable_LegalEntity.USMilitary) || entityTypeCode.Equals(LookupTable_LegalEntity.County) ? true : false;
            ValidateAddress((AddressDto)Machine["EntityAddress.Address"], Machine["LegalAddrReEmail"]?.ToString());

            if (Context.ValidationMessages.Count(ValidationMessageSeverity.Error) == 0)
            {
                Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.WizEmployerRegistration, LookupTable_WizEmployerRegistration.EnterBusinessInformation);
            }
        }
Esempio n. 3
0
        // So, the behaviour we want is this:
        // 1. Hide all existing *ng-* attributes from the default list
        // 2. Get prefix
        // 3. For single completion:
        //    If no prefix, just display abbreviations
        //    else if prefix is one of the abbreviations (exact match), add all items for that abbreviation
        //      (e.g. "ng-" should show all "ng-*" items)
        //    else if prefix pattern matches an abbreviation (inc. last char), add all items for that abbreviation
        //      (e.g. "dng-" should show all "data-ng-*" items)
        //    else if prefix pattern matches an abrreviation, add those abbreviations
        //      (e.g. "dng" should match "data-ng-" abbreviation. "ng" should match "data-ng-", "ng-" and "x-ng-")
        //    else if prefix pattern matches an item minus abbreviation, add those items for all abbreviations
        //      (e.g. "controller" should match "data-ng-controller", "ng-controller", "x-ng-controller")
        //    else if prefix pattern matches item with abrbeviation, add just those items
        //      (e.g. "ngc" matches "ng-controller" but not "data-ng-controller". "dnc" matches "data-ng-controller")
        // 4. Double completion...
        protected override bool AddLookupItems(HtmlCodeCompletionContext context,
                                               GroupedItemsCollector collector)
        {
            var completionPrefix = GetCompletionPrefix(context);

            var matcher = string.IsNullOrEmpty(completionPrefix) ? null : LookupUtil.CreateMatcher(completionPrefix, context.BasicContext.IdentifierMatchingStyle);

            if (IsSingleCompletion(context))
            {
                // Return value is ignored. Just a cute way of calling each of these in turn
                // without loads of if statements
                var ignored = TryAddAllAbbreviations(completionPrefix, context, collector) ||
                              TryAddAllItemsForExactAbbreviation(completionPrefix, context, collector) ||
                              TryAddAllItemsForMatchedAbbreviation(matcher, context, collector) ||
                              TryAddMatchingAbbreviations(matcher, context, collector) ||
                              TryAddMatchingUnprefixedItems(completionPrefix, context, collector) ||
                              TryAddMatchingItemsForMatchedAbbreviation(completionPrefix, context, collector);
            }
            else if (IsDoubleCompletion(context))
            {
                foreach (var abbreviation in Abbreviations)
                {
                    AddAllItemsForSpecificAbbreviation(abbreviation, context, collector);
                }
            }

            // Return true so ReSharper knows we're dynamic
            return(true);
        }
        protected override RichText GetDisplayName()
        {
            var richText = base.GetDisplayName();

            LookupUtil.AddEmphasize(richText, new TextRange(0, richText.Length));
            return(richText);
        }
        public void MenuDataTableExecute()
        {
            Random random = new Random();

            int valueIndex = 0;
            List <HtmlValueText> values = LookupUtil.GetValues(LookupTable.State, null, null, null);

            List <DataTableSimpleRecord> dataTableSimpleRecords = new List <DataTableSimpleRecord>();

            for (int i = 0; i < 500; i++)
            {
                if (valueIndex >= values.Count)
                {
                    valueIndex = 0;
                }
                DataTableSimpleRecord record = new DataTableSimpleRecord {
                    Field1 = DateTimeUtil.Now.AddDays(random.Next(-1000, 1000)), Field2 = i + 1, Field3 = $"Row {i + 1}\n-\nCol 311", State = values[valueIndex++].Value.ToString()
                };

                record.Child        = new DataTableSimpleRecord();
                record.Child.Field1 = DateTimeUtil.Now;
                record.Child.Field2 = i + 1;
                record.Child.Field3 = $"Child {i + 1} - Col 3";
                record.Child.State  = record.State;

                dataTableSimpleRecords.Add(record);
            }
            Machine["DataTableRecords"] = dataTableSimpleRecords;
            Machine["DataTableSource"]  = dataTableSimpleRecords;
            MenuTransferExecute();
        }
Esempio n. 6
0
            protected override void AfterComplete(ITextControl textControl, IThrowStatement statement)
            {
                if (statement.Semicolon != null)
                {
                    FormatStatementOnSemicolon(statement);
                }

                var settingsStore = statement.GetSettingsStore();
                var expression    = (IObjectCreationExpression)statement.Exception;

                var parenthesesType = settingsStore.GetValue(CodeCompletionSettingsAccessor.ParenthesesInsertType);

                if (parenthesesType == ParenthesesInsertType.None)
                {
                    var endOffset = expression.GetDocumentRange().TextRange.EndOffset;
                    textControl.Caret.MoveTo(endOffset, CaretVisualPlacement.DontScrollIfVisible);
                }
                else
                {
                    var canInstantiate       = TypeUtils.CanInstantiateType(statement.Exception.Type(), statement);
                    var hasRequiredArguments = (canInstantiate & CanInstantiate.ConstructorWithParameters) != 0;

                    var caretNode = hasRequiredArguments ? expression.LPar : (statement.Semicolon ?? (ITreeNode)expression);
                    var endOffset = caretNode.GetDocumentRange().TextRange.EndOffset;

                    textControl.Caret.MoveTo(endOffset, CaretVisualPlacement.DontScrollIfVisible);

                    if (hasRequiredArguments && settingsStore.GetValue(PostfixTemplatesSettingsAccessor.InvokeParameterInfo))
                    {
                        var lookupItemsOwner = Info.ExecutionContext.LookupItemsOwner;
                        LookupUtil.ShowParameterInfo(statement.GetSolution(), textControl, lookupItemsOwner);
                    }
                }
            }
        public void MachineExecute()
        {
            //used to set wizard header
            Machine["ListSection"]    = LookupUtil.GetValues(LookupTable.WizEmployerRegistration, null, "{DisplaySortOrder}", null);
            Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.WizEmployerRegistration, LookupTable_WizEmployerRegistration.EnterLiabilityInformation);
            Machine["ShowHeader"]     = false;

            //initialize EmployerRegistration object and required address objects
            Machine["EmployerRegistration"] = new EmployerRegistrationViewModel();
            Machine["EntityAddress"]        = new AddressLinkDto()
            {
                Address = new AddressDto()
            };
            Machine["PhysicalAddress"] = new AddressLinkDto()
            {
                Address = new AddressDto()
                {
                    StateCode = LookupTable_State.Washington, CountryCode = LookupTable_Country.UnitedStates
                }
            };
            Machine["BusinessAddress"] = new AddressLinkDto()
            {
                Address = new AddressDto()
            };
            Machine["YearList"] = PopulateYears(4, 0, true);
        }
Esempio n. 8
0
        public static WageSubmissionViewModel ValidateSelectionMethod(WageSubmissionViewModel wageDetail)
        {
            FACTS.Framework.Lookup.LookupValue item = LookupUtil.GetLookupValue(LookupTable.WageDetailAdjReasonCode, LookupTable_WageDetailAdjReasonCode.Original, "Display");
            wageDetail.AdjReasonDisplay = item.Value;
            wageDetail.AdjReasonCode    = LookupTable_WageDetailAdjReasonCode.Original;

            return(wageDetail);
        }
Esempio n. 9
0
        public void PaymentConfirmationExecute()
        {
            Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.MakePaymentWizardFlow, LookupTable_MakePaymentWizardFlow.Complete);
            decimal pmtAmount      = Convert.ToDecimal(Machine["PmtAmount"]);
            decimal totalAmountDue = Convert.ToDecimal(Machine["TotalAmount"]);

            Machine["BalanceAmount"] = (totalAmountDue - pmtAmount);
        }
Esempio n. 10
0
        protected override RichText GetDisplayName()
        {
            var displayName = LookupUtil.FormatLookupString($"{_keyValueSetting.Key} = ");

            LookupUtil.AddInformationText(displayName, _keyValueSetting.Value);

            return(displayName);
        }
        private IdentifierMatcher GetIdentifierMatcher(CodeCompletionContext context, TextLookupRanges ranges)
        {
            var text = context.Document.GetText(ranges.InsertRange.TextRange);

            if (string.IsNullOrEmpty(text))
            {
                return(null);
            }
            return(LookupUtil.CreateMatcher(text, context.IdentifierMatchingStyle));
        }
Esempio n. 12
0
        public void SelectPaymentMethodNext()
        {
            decimal pmtAmount          = Convert.ToDecimal(Machine["PmtAmount"]);
            decimal totalAmountDue     = Convert.ToDecimal(Machine["TotalAmount"]);
            string  pmtMethod          = Machine["CheckPaymentMethodType"].ToString();
            string  OnlinePaymentMthod = LookupUtil.GetLookupCode(LookupTable.PaymentMethodType, LookupTable_PaymentMethodType.ACHDebit).Code;

            Machine["CheckPayment"]           = ((totalAmountDue - pmtAmount) > 0) ? "Partial" : "Full";
            Machine["CheckPaymentMethodType"] = (pmtMethod.Equals(OnlinePaymentMthod, StringComparison.InvariantCultureIgnoreCase)) ? "Online" : "Paper";
        }
Esempio n. 13
0
        public void SubmitRegistrationNext()
        {
            Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.WizEmployerRegistration, LookupTable_WizEmployerRegistration.Complete);

            var      employerRegistration = (EmployerRegistrationViewModel)Machine["EmployerRegistration"];
            DateTime liabilityDate        = Convert.ToDateTime(employerRegistration.EmployerDto.LiabilityDate);
            int      currentQuarter       = (liabilityDate.Month - 1) / 3 + 1;

            Machine["LastDayCurrentQuarter"] = new DateTime(liabilityDate.Year, 3 * currentQuarter + 1, 1).AddDays(-1);
        }
Esempio n. 14
0
        /// <summary>
        /// Method executes during page load
        /// </summary>
        public void MachineExecute()
        {
            Machine["ListSection"]    = LookupUtil.GetValues(LookupTable.WizEmployerWageFiling, null, "{DisplaySortOrder}", null);
            Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.WizEmployerWageFiling, LookupTable_WizEmployerWageFiling.SelectFilingMethod);

            Machine["ShowHeader"]        = true;
            Machine["ReportingYearList"] = DateUtil.PopulateYears(Convert.ToInt16(LookupTable_WageDetailUnitYears.YearsForWageFiling), 0, false);

            //Set Default Values for Year and Quarter
            SetReportingYearAndQuarterDefaultValues();
        }
        public void MenuBasicExecute()
        {
            Machine["BasicCheckBoxBool"]        = false;
            Machine["BasicCheckBoxString"]      = "No";
            Machine["BasicCheckBoxStringMulti"] = "";
            Machine["BasicCheckBoxArray"]       = new string[0];
            Machine["BasicCheckBoxList"]        = new List <string>();

            Machine["BasicRadioButtonBool"]   = false;
            Machine["BasicRadioButtonString"] = "No";
            Machine["BasicRadioButtonMulti"]  = "One";

            Machine["BasicBulletedListData"] = new string[] { "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" };

            Machine["BasicDropDownList3"] = null;
            Machine["BasicDropDownList4"] = null;



            Random random = new Random();

            int valueIndex = 0;
            List <HtmlValueText> values = LookupUtil.GetValues(LookupTable.State, null, null, null);

            List <DataTableSimpleRecord> dataTableSimpleRecords = new List <DataTableSimpleRecord>();

            for (int i = 0; i < 10; i++)
            {
                if (valueIndex >= values.Count)
                {
                    valueIndex = 0;
                }
                DataTableSimpleRecord record = new DataTableSimpleRecord {
                    Field1 = DateTimeUtil.Now.AddDays(random.Next(-100, 100)), Field2 = i + 1, Field3 = $"Row {i + 1} - Col 3", State = values[valueIndex++].Value.ToString()
                };

                record.Child        = new DataTableSimpleRecord();
                record.Child.Field1 = DateTimeUtil.Now;
                record.Child.Field2 = i + 1;
                record.Child.Field3 = $"Child {i + 1} - Col 3";
                record.Child.State  = record.State;

                record.Children = new List <DataTableSimpleRecord>();
                for (int j = 0; j < 3; j++)
                {
                    record.Children.Add(new DataTableSimpleRecord {
                        Field1 = DateTimeUtil.Now.AddDays(random.Next(-100, 100)), Field2 = -(j + 1), Field3 = $"Row {-(j + 1)} - Col 3", State = values[valueIndex++].Value.ToString()
                    });
                }

                dataTableSimpleRecords.Add(record);
            }
            Machine["BasicRepeaterRecords"] = dataTableSimpleRecords;
        }
Esempio n. 16
0
            protected override void AfterComplete(ITextControl textControl, IInvocationExpression expression)
            {
                var invocationRange = expression.InvokedExpression.GetDocumentRange();
                var languageType    = expression.Language;
                var hotspotInfo     = new HotspotInfo(new TemplateField("Method", 0), invocationRange);

                var argumentRange = expression.Arguments[0].Value.GetDocumentRange();
                var solution      = expression.GetSolution();

                var marker = argumentRange.EndOffsetRange().CreateRangeMarker();
                var length = (marker.Range.EndOffset - invocationRange.TextRange.EndOffset);

                var liveTemplatesManager = Info.ExecutionContext.LiveTemplatesManager;
                var session = liveTemplatesManager.CreateHotspotSessionAtopExistingText(
                    expression.GetSolution(), TextRange.InvalidRange, textControl,
                    LiveTemplatesManager.EscapeAction.RestoreToOriginalText, hotspotInfo);

                var settings            = expression.GetSettingsStore();
                var invokeParameterInfo = settings.GetValue(PostfixTemplatesSettingsAccessor.InvokeParameterInfo);

                textControl.PutData(PostfixArgTemplateExpansion, string.Empty);

                session.Closed.Advise(EternalLifetime.Instance, _ =>
                {
                    textControl.PutData(PostfixArgTemplateExpansion, null);

                    using (ReadLockCookie.Create())
                    {
                        var hotspotRange = session.Hotspots[0].RangeMarker.Range;
                        if (!hotspotRange.IsValid)
                        {
                            return;
                        }

                        solution.GetPsiServices().Files.CommitAllDocuments();

                        if (TryPlaceCaretSmart(solution, textControl, languageType, hotspotRange))
                        {
                            return;
                        }

                        var endOffset = hotspotRange.EndOffset + length;
                        textControl.Caret.MoveTo(endOffset, CaretVisualPlacement.DontScrollIfVisible);

                        if (invokeParameterInfo)
                        {
                            var lookupItemsOwner = Info.ExecutionContext.LookupItemsOwner;
                            LookupUtil.ShowParameterInfo(solution, textControl, lookupItemsOwner);
                        }
                    }
                });

                session.Execute();
            }
Esempio n. 17
0
        public RichTextBlock GetDescription()
        {
            // This would be so much easier if ReSharper better supported IWrappedLookupItem
            var descriptionProvidingLookupItem = Item as IDescriptionProvidingLookupItem;

            if (descriptionProvidingLookupItem != null)
            {
                return(descriptionProvidingLookupItem.GetDescription());
            }

            return(LookupUtil.GetDescriptionForDeclaredElementLookupItem(Item as IDeclaredElementLookupItem));
        }
            protected override void AfterComplete(ITextControl textControl, IInvocationExpression expression)
            {
                var parseReference = (IReferenceExpression)expression.InvokedExpression;
                var typeQualifier  = parseReference.QualifierExpression.NotNull();

                var solution  = expression.GetSolution();
                var psiModule = typeQualifier.GetPsiModule();

                var typesWithParsers   = GetTypesWithParsers(typeQualifier);
                var templateExpression = new TypeTemplateExpression(typesWithParsers, psiModule, CSharpLanguage.Instance);
                var templateField      = new TemplateField("type", templateExpression, 0);

                var hotspotInfo = new HotspotInfo(templateField, typeQualifier.GetDocumentRange());

                var argumentsRange = expression.ArgumentList.GetDocumentRange();

                var endSelectionRange = argumentsRange.EndOffsetRange().TextRange;
                var session           = myTemplatesManager.CreateHotspotSessionAtopExistingText(
                    solution, endSelectionRange, textControl, LiveTemplatesManager.EscapeAction.LeaveTextAndCaret, hotspotInfo);

                var settingsStore       = expression.GetSettingsStore();
                var invokeParameterInfo = settingsStore.GetValue(PostfixSettingsAccessor.InvokeParameterInfo);

                session.Closed.Advise(Lifetime, args =>
                {
                    if (myIsTryParse)
                    {
                        var shellLocks = solution.GetComponent <IShellLocks>();
                        shellLocks.QueueReadLock("Smart completion for .tryparse", () =>
                        {
#if RESHARPER8
                            var intellisenseManager = solution.GetComponent <IntellisenseManager>();
#elif RESHARPER9
                            var intellisenseManager = solution.GetComponent <ICodeCompletionSessionManager>();
#endif
                            intellisenseManager.ExecuteManualCompletion(
                                CodeCompletionType.SmartCompletion, textControl, solution, EmptyAction.Instance,
                                intellisenseManager.GetPrimaryEvaluationMode(CodeCompletionType.SmartCompletion),
                                AutocompletionBehaviour.DoNotAutocomplete);
                        });
                    }

                    if (invokeParameterInfo)
                    {
                        using (ReadLockCookie.Create())
                        {
                            LookupUtil.ShowParameterInfo(solution, textControl, myLookupItemsOwner);
                        }
                    }
                });

                session.Execute();
            }
Esempio n. 19
0
        public void MachineExecute()
        {
            //TO DO
            //Get Values from the DB Context
            Machine["emprAccountID"] = 100101;
            Machine["emprName"]      = "Test Employer";
            Machine["dbaName"]       = "Test DBA";

            Machine["ListSection"]    = LookupUtil.GetValues(LookupTable.MakePaymentWizardFlow, null, "{DisplaySortOrder}", null);
            Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.MakePaymentWizardFlow, LookupTable_MakePaymentWizardFlow.SelectPaymentMethod);
            Machine["ShowHeader"]     = true;
        }
Esempio n. 20
0
        public static WageSubmissionViewModel ValidateSelectionMethod(WageSubmissionViewModel wageDetail)
        {
            using (DbContext context = new DbContext())
            {
                if (context.TaxableAmountSums.Any(x => x.ReportingQuarter == wageDetail.ReportingQuarter && x.ReportingYear == wageDetail.ReportingYear && x.EmployerId == wageDetail.Employer.EmployerId))
                {
                    Context.ValidationMessages.AddError("Original Employment and Wage Detail Report for this year " + wageDetail.ReportingYear + " and quarter " + LookupUtil.GetLookupCode(LookupTable.Quarter, wageDetail.ReportingQuarter).Display + " has already been submitted");
                }
            }

            wageDetail.AdjReasonDisplay = LookupUtil.GetLookupCode(LookupTable.WageDetailAdjReasonCode, LookupTable_WageDetailAdjReasonCode.Original).Display.ToString();
            wageDetail.AdjReasonCode    = LookupTable_WageDetailAdjReasonCode.Original;

            return(wageDetail);
        }
Esempio n. 21
0
        public void SelectPaymentMethodExecute()
        {
            //TO DO
            //Get Values from the DB Context
            decimal amountDue = 987;

            Machine["PaymentDueDates"]    = "<b>Quarter 1 - April 30<br/>Quarter 2 - July 31<br/>Quarter 3 - October 31<br/>Quarter 4 - January 31</b>";
            Machine["PrepaymentDueDates"] = "<b>10 calendar days after the start of the quarter</b>";


            Machine["ActualDueDate"]  = DateTime.Today;
            Machine["AmountDue"]      = amountDue;
            Machine["TotalAmount"]    = amountDue;
            Machine["PmtAmount"]      = amountDue;
            Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.MakePaymentWizardFlow, LookupTable_MakePaymentWizardFlow.SelectPaymentMethod);
            Machine["CheckPayment"]   = Machine["SearchType"];
        }
Esempio n. 22
0
 public void PaymentDetailsNext()
 {
     Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.MakePaymentWizardFlow, LookupTable_MakePaymentWizardFlow.SubmitPaymentDetails);
     if (Machine["SaveBankInformation"] != null && Machine["SaveBankInformation"].ToString().Equals("true", StringComparison.InvariantCultureIgnoreCase))
     {
         Machine["SaveBankInformationText"] = "Yes";
     }
     else
     {
         Machine["SaveBankInformationText"] = "No";
     }
     Machine["PaymentEffectiveDate"] = DateTime.Today;
     Machine["AccountType"]          = Machine["AccountTypeDDL"].ToString().Equals(LookupTable_BankAccountType.Savings, StringComparison.InvariantCultureIgnoreCase) ? "Savings" : "Checking";
     //TO DO
     //Get Values from the DB Context
     Machine["PmtVerificationMsg"] = String.Format("By paying your New Mexico Department of Workforce Solutions bill by way of this online service, you are authorizing NMDWS to charge your {0} account for the amount you submitted.", Machine["AccountType"]);
 }
Esempio n. 23
0
        private bool TryAddMatchingItemsForMatchedAbbreviation(string prefix, HtmlCodeCompletionContext context,
                                                               GroupedItemsCollector collector)
        {
            if (string.IsNullOrEmpty(prefix))
            {
                return(false);
            }

            var matcher = LookupUtil.CreateMatcher(prefix, IdentifierMatchingStyle.BeginingOfIdentifier);

            var added = false;

            foreach (var abbreviation in Abbreviations)
            {
                added |= AddItems(abbreviation, context, collector, matcher.Matches);
            }
            return(added);
        }
Esempio n. 24
0
        public void SelectFilingMethodNext()
        {
            int      currentQtr = Convert.ToInt16(DateUtil.GetQuarterNumber(DateTimeUtil.Now.Month));
            DateTime subjDt     = DateTimeUtil.Now;
            int      selYr      = Convert.ToInt16(Machine["WageUnitDetail.ReportingYear"]);
            int      selQtr     = Convert.ToInt16(Machine["WageUnitDetail.ReportingQuarter"].ToString().Remove(0, 1));

            bool isValidSubjDate = ((selYr > subjDt.Year) || (subjDt.Year == selYr && selQtr <= currentQtr));

            if (subjDt.Year <= selYr)
            {
                if (currentQtr < selQtr)
                {
                    Context.ValidationMessages.AddError("Submission not allowed for future quarter.");
                    return;
                }
            }
            Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.WizEmployerWageFiling, LookupTable_WizEmployerWageFiling.SubmitWageInformation);
        }
        private bool TryAddMatchingUnprefixedItems(string prefix, HtmlCodeCompletionContext context,
                                                   IItemsCollector collector)
        {
            if (string.IsNullOrEmpty(prefix))
            {
                return(false);
            }

            var added = false;

            foreach (var abbreviation in Abbreviations)
            {
                var matcher = LookupUtil.CreateMatcher(abbreviation + prefix,
                                                       context.BasicContext.IdentifierMatchingStyle);

                added |= AddItems(abbreviation, context, collector, matcher.Matches);
            }
            return(added);
        }
Esempio n. 26
0
        protected override bool AddLookupItems(ISpecificCodeCompletionContext context, IItemsCollector collector)
        {
            var languageCaseProvider = LanguageManager.Instance.TryGetService <LanguageCaseProvider>(language);
            var templateNames        = new JetHashSet <string>(languageCaseProvider.IfNotNull(cp => cp.IsCaseSensitive()
                ? StringComparer.Ordinal
                : StringComparer.OrdinalIgnoreCase));
            IEnumerable <TemplateLookupItem> templateItems = TemplateActionsUtil.GetLookupItems(context.BasicContext.TextControl, context.BasicContext.CompletionManager.Solution, false, false);

            var prefix = LiveTemplatesManager.GetPrefix(context.BasicContext.CaretDocumentOffset, JsAllowedPrefixes.Chars);

            if (collector.Ranges == null)
            {
                var caretOffset = context.BasicContext.CaretDocumentOffset;
                var prefixRange = new DocumentRange(caretOffset - prefix.Length, caretOffset);
                collector.AddRanges(new TextLookupRanges(prefixRange, prefixRange));
            }

            if (!string.IsNullOrEmpty(prefix))
            {
                var identifierMatcher = LookupUtil.CreateMatcher(prefix, context.BasicContext.IdentifierMatchingStyle);
                templateItems = templateItems.Where(item => identifierMatcher.Matches(item.Template.Shortcut));
            }

            foreach (var templateItem in templateItems)
            {
                templateNames.Add(templateItem.DisplayName.Text);
            }

            if (templateItems.IsEmpty())
            {
                return(false);
            }

            context.BasicContext.PutData(TemplateNamesKey, templateNames);

            foreach (var templateItem in templateItems)
            {
                collector.Add(templateItem);
            }

            return(true);
        }
Esempio n. 27
0
            protected override void AfterComplete(ITextControl textControl, IObjectCreationExpression expression)
            {
                var referencedType = CSharpTypeFactory.CreateDeclaredType(expression.CreatedTypeUsage);

                var canInstantiate = TypeUtils.CanInstantiateType(referencedType, expression);

                if ((canInstantiate & CanInstantiate.ConstructorWithParameters) != 0)
                {
                    var lparRange = expression.LPar.GetDocumentRange();
                    var rparRange = expression.RPar.GetDocumentRange();

                    var documentRange   = lparRange.SetEndTo(rparRange.TextRange.EndOffset);
                    var argumentsMarker = documentRange.CreateRangeMarker();

                    var settingsStore       = expression.GetSettingsStore();
                    var invokeParameterInfo = settingsStore.GetValue(PostfixTemplatesSettingsAccessor.InvokeParameterInfo);

                    var solution = expression.GetSolution();

                    ExecuteRefactoring(textControl, expression, executeAfter: () =>
                    {
                        var argumentsRange = argumentsMarker.Range;
                        if (!argumentsRange.IsValid)
                        {
                            return;
                        }

                        var offset = argumentsRange.StartOffset + argumentsRange.Length / 2; // EWW
                        textControl.Caret.MoveTo(offset, CaretVisualPlacement.DontScrollIfVisible);

                        if (invokeParameterInfo)
                        {
                            var lookupItemsOwner = Info.ExecutionContext.LookupItemsOwner;
                            LookupUtil.ShowParameterInfo(solution, textControl, lookupItemsOwner);
                        }
                    });
                }
                else
                {
                    ExecuteRefactoring(textControl, expression);
                }
            }
            protected override void AfterComplete(ITextControl textControl, IObjectCreationExpression expression)
            {
                var settingsStore = expression.GetSettingsStore();

                var parenthesesType = settingsStore.GetValue(CodeCompletionSettingsAccessor.ParenthesesInsertType);

                if (parenthesesType == ParenthesesInsertType.None)
                {
                    return;
                }

                var caretNode = myHasRequiredArguments ? expression.LPar : (ITreeNode)expression;
                var endOffset = caretNode.GetDocumentRange().TextRange.EndOffset;

                textControl.Caret.MoveTo(endOffset, CaretVisualPlacement.DontScrollIfVisible);

                if (myHasRequiredArguments && settingsStore.GetValue(PostfixSettingsAccessor.InvokeParameterInfo))
                {
                    var solution = expression.GetSolution();
                    LookupUtil.ShowParameterInfo(solution, textControl, myLookupItemsOwner);
                }
            }
        public void LiabilityWagesNext()
        {
            List <bool> listUserInput = new List <bool> {
                (bool)Machine["EmployerRegistration.EmployerDto.EmployerLiability.HasPaid450RegularWages"], (bool)Machine["EmployerRegistration.EmployerDto.EmployerLiability.HasPaid1KDomesticWages"], (bool)Machine["EmployerRegistration.EmployerDto.EmployerLiability.HasPaid20KAgriculturalLaborWages"]
            };

            if (listUserInput.FindAll(l => l.Equals(true))?.Count >= 2)
            {
                Context.ValidationMessages.AddError("Only one answer can be Yes. Select the question that occurred first as Yes and the other(s) as No.");
                return;
            }
            else if (listUserInput.FindAll(l => l.Equals(true))?.Count >= 1)
            {
                Machine["IsLiableWages"]  = "Yes";
                Machine["CurrentSection"] = LookupUtil.GetLookupCode(LookupTable.WizEmployerRegistration, LookupTable_WizEmployerRegistration.EnterUsers);
            }
            else
            {
                Machine["IsLiableWages"] = "No";
                Machine["EmployerRegistration.EmployerDto.EmployerLiability.LiabilityAmountMetYear"]    = null;
                Machine["EmployerRegistration.EmployerDto.EmployerLiability.LiabilityAmountMetQuarter"] = null;
            }
        }
Esempio n. 30
0
        protected override RichText GetDisplayName()
        {
            var projectDisplayName = GetProjectDisplayName(project);
            var displayName        = LookupUtil.FormatLookupString($"\"{projectDisplayName}\"");

            if (!projectDisplayName.Equals(project.Name, StringComparison.OrdinalIgnoreCase))
            {
                LookupUtil.AddInformationText(displayName, project.Name);
            }

            var publicKeyString = GetPublicKeyString(project as ProjectImpl);

            if (!string.IsNullOrWhiteSpace(publicKeyString))
            {
                var publicKeyDisplay = LookupUtil.FormatLookupString("PublicKey=" + ellipsis);
                publicKeyDisplay.SetStyle(TextStyle.FromForeColor(SystemColors.GrayText));

                // aligns the "PublicKey=..." text to the right, as if it were a type name
                DisplayTypeName = publicKeyDisplay;
            }

            return(displayName);
        }