示例#1
0
 public string this[string columnName]
 {
     get
     {
         if (columnName == "TerminationReason")
         {
             if (string.IsNullOrEmpty(TerminationReason))
             {
                 return("Termination reason is required");
             }
         }
         if (columnName == "TerminationDate")
         {
             if (string.IsNullOrEmpty(TerminationDate.ToString()))
             {
                 return("Termination date is required");
             }
         }
         if (columnName == "EffectiveDate")
         {
             if (string.IsNullOrEmpty(EffectiveDate.ToString()))
             {
                 return("Effective date is required");
             }
         }
         if (columnName == "ActionTakenBy")
         {
             if (string.IsNullOrEmpty(ActionTakenBy))
             {
                 return("Action taken by is required");
             }
         }
         return(string.Empty);
     }
 }
示例#2
0
 public TerminateMunicipality(
     NisCode nisCode,
     TerminationDate date)
 {
     NisCode = nisCode;
     Date    = date;
 }
示例#3
0
 internal void UpdateData(DataRow row)
 {
     row.ItemArray = new object[] {
         (IsNewItem) ? null : (object)Id,
         Code ?? string.Empty,
         Text ?? string.Empty,
         Count,
         FinalCount,
         ReceiveDate.ToString(),
         EstimatedDate.ToString(),
         TerminationDate.ToString(),
         Status
     };
 }
示例#4
0
        internal PayrollRequest TerminateEmployeeRequest(PayrollEncoder encoder, object[] args)
        {
            var requestBody = new JsonDoc()
                              .Set("ClientCode", encoder.Encode(ClientCode))
                              .Set("EmployeeId", EmployeeId)
                              .Set("TerminationDate", TerminationDate?.ToString("MM/dd/yyyy"))
                              .Set("TerminationReasonId", TerminationReasonId)
                              .Set("InactivateDirectDepositAccounts", DeactivateAccounts ? 1 : 0)
                              .ToString();

            return(new PayrollRequest {
                Endpoint = @"/api/pos/employee/TerminateEmployee",
                RequestBody = requestBody
            });
        }
示例#5
0
        public override String EvaluateDataBinding(Structures.DataBinding dataBinding)
        {
            String dataValue = String.Empty;

            String bindingContextPart = dataBinding.BindingContext.Split('.')[0];

            switch (bindingContextPart)
            {
            case "EntityAddressId": dataValue = entityAddressId.ToString(); break;

            case "AddressType": dataValue = ((Int32)AddressType).ToString(); break;

            case "AddressTypeDescription": dataValue = AddressTypeDescription; break;

            case "EffectiveDate": dataValue = EffectiveDate.ToString("MM/dd/yyyy"); break;

            case "TerminationDate": dataValue = TerminationDate.ToString("MM/dd/yyyy"); break;

            case "Line1": dataValue = Line1; break;

            case "Line2": dataValue = Line2; break;

            case "City": dataValue = City; break;

            case "State": dataValue = State; break;

            case "ZipCode": dataValue = ZipCode; break;

            case "ZipPlus4": dataValue = ZipPlus4; break;

            case "PostalCode": dataValue = PostalCode; break;

            case "CityStateZipCode": dataValue = CityStateZipCode; break;

            default: dataValue = "!Error"; break;
            }

            return(dataValue);
        }
示例#6
0
        public CashFlowSchedule GenerateSchedule()
        {
            var startDate = EffectiveDate;
            var endDate   = TerminationDate.Date(startDate, ResetRollType, ResetCalendar);
            var f         = new CashFlowSchedule();
            var lf        = new List <CashFlow>();

            if (NotionalExchange == ExchangeType.FrontOnly || NotionalExchange == ExchangeType.Both)
            {
                lf.Add(new CashFlow
                {
                    Notional               = (double)Nominal * (Direction == SwapPayReceiveType.Payer ? -1.0 : 1.0),
                    Fv                     = (double)Nominal * (Direction == SwapPayReceiveType.Payer ? -1.0 : 1.0),
                    SettleDate             = startDate,
                    NotionalByYearFraction = 1.0,
                    Dcf                    = 1.0,
                    FlowType               = FlowType.FixedAmount
                });
            }

            //need to handle stub types and roll day types
            switch (StubType)
            {
            case StubType.ShortFront:
            case StubType.LongFront:
            {
                var nQ           = 0;
                var currentReset = GetNextResetDate(endDate, false);
                while (GetNextResetDate(currentReset, false) >= startDate)
                {
                    var q = new CashFlow()
                    {
                        ResetDateStart     = currentReset,
                        AccrualPeriodStart = currentReset,
                        FixingDateStart    = currentReset.SubtractPeriod(FixingRollType, FixingCalendar, FixingOffset),
                        AccrualPeriodEnd   = currentReset.AddPeriod(ResetRollType, ResetCalendar, ResetFrequency)
                    };
                    q.SettleDate = (PaymentOffsetRelativeTo == OffsetRelativeToType.PeriodEnd) ?
                                   q.AccrualPeriodEnd.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset) :
                                   q.AccrualPeriodStart.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset);
                    q.NotionalByYearFraction = (LegType != SwapLegType.FixedNoAccrual && LegType != SwapLegType.FloatNoAccrual) ?
                                               q.AccrualPeriodStart.CalculateYearFraction(q.AccrualPeriodEnd, AccrualDCB) :
                                               1.0;
                    q.Dcf = q.NotionalByYearFraction;
                    q.Fv  = (LegType == SwapLegType.Fixed) ?
                            (double)Nominal * q.NotionalByYearFraction * (double)FixedRateOrMargin :
                            0;
                    q.FixedRateOrMargin = (double)FixedRateOrMargin;
                    q.FlowType          = (LegType == SwapLegType.Fixed) ? FlowType.FixedRate : FlowType.FloatRate;
                    q.Notional          = (double)Nominal;
                    lf.Add(q);
                    nQ++;
                    currentReset = GetNextResetDate(currentReset, false);
                }

                if (lf.Count == 0 || lf.Last().AccrualPeriodStart != startDate)
                {
                    if (StubType == StubType.LongFront)
                    {
                        var Q = lf.Last();
                        Q.ResetDateStart     = startDate;
                        Q.AccrualPeriodStart = startDate;
                        Q.SettleDate         = (PaymentOffsetRelativeTo == OffsetRelativeToType.PeriodEnd) ?
                                               Q.AccrualPeriodEnd.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset) :
                                               Q.AccrualPeriodStart.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset);
                        Q.Dcf = (LegType != SwapLegType.FixedNoAccrual && LegType != SwapLegType.FloatNoAccrual) ?
                                Q.AccrualPeriodStart.CalculateYearFraction(Q.AccrualPeriodEnd, AccrualDCB) :
                                1.0;
                    }
                    else
                    {
                        var q = new CashFlow()
                        {
                            AccrualPeriodStart = startDate,
                            FixingDateStart    = startDate.SubtractPeriod(FixingRollType, FixingCalendar, FixingOffset),
                            AccrualPeriodEnd   = (lf.Count > 0 && lf.Last().AccrualPeriodEnd != DateTime.MinValue)? lf.Last().AccrualPeriodStart : endDate
                        };

                        q.SettleDate = (PaymentOffsetRelativeTo == OffsetRelativeToType.PeriodEnd) ?
                                       q.AccrualPeriodEnd.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset) :
                                       q.AccrualPeriodStart.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset);
                        //Q.Currency = CCY;
                        q.NotionalByYearFraction = (LegType != SwapLegType.FixedNoAccrual && LegType != SwapLegType.FloatNoAccrual) ?
                                                   q.AccrualPeriodStart.CalculateYearFraction(q.AccrualPeriodEnd, AccrualDCB) :
                                                   1.0;
                        q.Dcf = q.NotionalByYearFraction;
                        q.Fv  = (LegType == SwapLegType.Fixed) ?
                                (double)Nominal * q.NotionalByYearFraction * (double)FixedRateOrMargin :
                                0;
                        q.FixedRateOrMargin = (double)FixedRateOrMargin;
                        q.FlowType          = (LegType == SwapLegType.Fixed) ? FlowType.FixedRate : FlowType.FloatRate;
                        q.Notional          = (double)Nominal;
                        lf.Add(q);
                        nQ++;
                    }
                }


                break;
            }

            case StubType.ShortBack:
            case StubType.LongBack:
            {
                var nQ           = 0;
                var currentReset = startDate;
                while (GetNextResetDate(currentReset, true) <= endDate)
                {
                    var Q = new CashFlow()
                    {
                        AccrualPeriodStart = currentReset,
                        FixingDateStart    = currentReset.SubtractPeriod(FixingRollType, FixingCalendar, FixingOffset),
                        AccrualPeriodEnd   = currentReset.AddPeriod(ResetRollType, ResetCalendar, ResetFrequency)
                    };
                    Q.SettleDate = (PaymentOffsetRelativeTo == OffsetRelativeToType.PeriodEnd) ?
                                   Q.AccrualPeriodEnd.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset) :
                                   Q.AccrualPeriodStart.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset);
                    //Q.Currency = CCY;
                    Q.NotionalByYearFraction = (LegType != SwapLegType.FixedNoAccrual && LegType != SwapLegType.FloatNoAccrual) ?
                                               Q.AccrualPeriodStart.CalculateYearFraction(Q.AccrualPeriodEnd, AccrualDCB) :
                                               1.0;
                    Q.Dcf      = Q.NotionalByYearFraction;
                    Q.Notional = (double)Nominal;
                    Q.Fv       = (LegType == SwapLegType.Fixed) ?
                                 (double)Nominal * Q.NotionalByYearFraction * (double)FixedRateOrMargin :
                                 0;
                    Q.FixedRateOrMargin = (double)FixedRateOrMargin;
                    Q.FlowType          = (LegType == SwapLegType.Fixed) ? FlowType.FixedRate : FlowType.FloatRate;
                    lf.Add(Q);
                    nQ++;
                    currentReset = GetNextResetDate(currentReset, false);
                }



                if (lf.Last().AccrualPeriodEnd != endDate)
                {
                    if (StubType == StubType.LongBack)
                    {
                        var Q = lf.Last();
                        Q.AccrualPeriodEnd = endDate;
                        Q.SettleDate       = (PaymentOffsetRelativeTo == OffsetRelativeToType.PeriodEnd) ?
                                             Q.AccrualPeriodEnd.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset) :
                                             Q.AccrualPeriodStart.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset);
                        Q.Dcf = (LegType != SwapLegType.FixedNoAccrual && LegType != SwapLegType.FloatNoAccrual) ?
                                Q.AccrualPeriodStart.CalculateYearFraction(Q.AccrualPeriodEnd, AccrualDCB) :
                                1.0;
                    }
                    else
                    {
                        var Q = new CashFlow()
                        {
                            AccrualPeriodStart = lf.Last().AccrualPeriodEnd,
                            FixingDateStart    = startDate.SubtractPeriod(FixingRollType, FixingCalendar, FixingOffset),
                            AccrualPeriodEnd   = endDate
                        };
                        Q.SettleDate = (PaymentOffsetRelativeTo == OffsetRelativeToType.PeriodEnd) ?
                                       Q.AccrualPeriodEnd.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset) :
                                       Q.AccrualPeriodStart.AddPeriod(PaymentRollType, PaymentCalendar, PaymentOffset);
                        //Q.Currency = CCY;
                        Q.NotionalByYearFraction = (LegType != SwapLegType.FixedNoAccrual && LegType != SwapLegType.FloatNoAccrual) ?
                                                   Q.AccrualPeriodStart.CalculateYearFraction(Q.AccrualPeriodEnd, AccrualDCB) :
                                                   1.0; Q.Notional = (double)Nominal;
                        Q.Dcf = Q.NotionalByYearFraction;
                        Q.Fv  = (LegType == SwapLegType.Fixed) ?
                                (double)Nominal * Q.NotionalByYearFraction * (double)FixedRateOrMargin :
                                0;
                        Q.FixedRateOrMargin = (double)FixedRateOrMargin;
                        Q.FlowType          = (LegType == SwapLegType.Fixed) ? FlowType.FixedRate : FlowType.FloatRate;
                        Q.Notional          = (double)Nominal;
                        lf.Add(Q);
                        nQ++;
                    }
                }
                break;
            }

            case StubType.LongBoth:
            case StubType.ShortBoth:
                throw new NotImplementedException("Schedules with Both type stubs cannot be generated");
            }

            if (NotionalExchange == ExchangeType.BackOnly || NotionalExchange == ExchangeType.Both)
            {
                lf.Add(new CashFlow
                {
                    Notional               = (double)Nominal * (Direction == SwapPayReceiveType.Receiver ? -1.0 : 1.0),
                    Fv                     = (double)Nominal * (Direction == SwapPayReceiveType.Receiver ? -1.0 : 1.0),
                    SettleDate             = endDate,
                    NotionalByYearFraction = 1.0,
                    Dcf                    = 1.0,
                    FlowType               = FlowType.FixedAmount
                });
            }
            f.Flows = lf.OrderBy(x => x.AccrualPeriodStart).ToList();

            return(f);
        }