Beispiel #1
0
        public Container ShopsContainer()
        {
            if (_shopsContainer != null)
            {
                return(_shopsContainer);
            }

            _shopsContainer = new Container(new Uri(Program.ShopsServiceUri))
            {
                MergeOption = MergeOption.OverwriteChanges,
                DisableInstanceAnnotationMaterialization = true
            };

            _shopsContainer.BuildingRequest += (s, e) =>
            {
                e.Headers.Add("ShopName", Shop);
                e.Headers.Add("ShopperId", ShopperId);
                e.Headers.Add("CustomerId", CustomerId);
                e.Headers.Add("Language", Language);
                e.Headers.Add("Currency", Currency);
                e.Headers.Add("Environment", Environment);
                e.Headers.Add("PolicyKeys", PolicyKeys);
                e.Headers.Add("EffectiveDate", EffectiveDate.ToString());
                e.Headers.Add("IsRegistered", IsRegistered.ToString());
                e.Headers.Add("Authorization", Program.SitecoreToken);
            };
            return(_shopsContainer);
        }
Beispiel #2
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);
     }
 }
Beispiel #3
0
 public void MergeFrom(ChaincodeDeploymentSpec other)
 {
     if (other == null)
     {
         return;
     }
     if (other.chaincodeSpec_ != null)
     {
         if (chaincodeSpec_ == null)
         {
             chaincodeSpec_ = new global::Chaincode.NET.Protos.ChaincodeSpec();
         }
         ChaincodeSpec.MergeFrom(other.ChaincodeSpec);
     }
     if (other.effectiveDate_ != null)
     {
         if (effectiveDate_ == null)
         {
             effectiveDate_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         EffectiveDate.MergeFrom(other.EffectiveDate);
     }
     if (other.CodePackage.Length != 0)
     {
         CodePackage = other.CodePackage;
     }
     if (other.ExecEnv != 0)
     {
         ExecEnv = other.ExecEnv;
     }
 }
Beispiel #4
0
        public SalaryDecisionModel(sal_SalaryDecision entity)
        {
            // init salary decision
            entity = entity ?? new sal_SalaryDecision();

            // init record
            _record = hr_RecordServices.GetById(entity.RecordId) ?? new hr_Record();

            // init contract type
            var contract = hr_ContractServices.GetById(entity.ContractId) ?? new hr_Contract();

            _contractType = cat_ContractTypeServices.GetById(contract.ContractTypeId) ?? new cat_ContractType();

            // init group quantum
            _groupQuantum = cat_GroupQuantumServices.GetById(entity.GroupQuantumId) ?? new cat_GroupQuantum();

            // init quantum
            _quantum = cat_QuantumServices.GetById(entity.QuantumId) ?? new cat_Quantum();

            // basic salary
            _basicSalary = cat_BasicSalaryServices.GetCurrent() ?? new cat_BasicSalary();

            //init position
            _position = cat_PositionServices.GetById(entity.SignerPositionId) ?? new cat_Position();

            // set model props
            Init(entity);

            // set custom props
            DecisionVnDate  = DecisionDate.ToVnDate();
            EffectiveVnDate = EffectiveDate.ToVnDate();
        }
        public override int GetHashCode()
        {
            int hashCode = -298722928;

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (SubscriptionEventType != null)
            {
                hashCode += SubscriptionEventType.GetHashCode();
            }

            if (EffectiveDate != null)
            {
                hashCode += EffectiveDate.GetHashCode();
            }

            if (PlanId != null)
            {
                hashCode += PlanId.GetHashCode();
            }

            return(hashCode);
        }
Beispiel #6
0
        /// <summary>
        /// Returns true if UserRole instances are equal
        /// </summary>
        /// <param name="other">Instance of UserRole to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UserRole other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     EffectiveDate == other.EffectiveDate ||
                     EffectiveDate.Equals(other.EffectiveDate)
                 ) &&
                 (
                     ExpiryDate == other.ExpiryDate ||
                     ExpiryDate != null &&
                     ExpiryDate.Equals(other.ExpiryDate)
                 ) &&
                 (
                     Role == other.Role ||
                     Role != null &&
                     Role.Equals(other.Role)
                 ));
        }
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;

                // Suitable nullity checks
                hash = hash * 59 + EffectiveDate.GetHashCode();
                hash = hash * 59 + UserId.GetHashCode();
                hash = hash * 59 + RoleId.GetHashCode();

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (ExpiryDate != null)
                {
                    hash = hash * 59 + ExpiryDate.GetHashCode();
                }

                return(hash);
            }
        }
        /// <summary>
        /// Returns true if UserRoleViewModel instances are equal
        /// </summary>
        /// <param name="other">Instance of UserRoleViewModel to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UserRoleViewModel other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     EffectiveDate == other.EffectiveDate ||
                     EffectiveDate.Equals(other.EffectiveDate)
                     ) &&
                 (
                     UserId == other.UserId ||
                     UserId.Equals(other.UserId)
                 ) &&
                 (
                     RoleId == other.RoleId ||
                     RoleId.Equals(other.RoleId)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     ExpiryDate == other.ExpiryDate ||
                     ExpiryDate != null &&
                     ExpiryDate.Equals(other.ExpiryDate)
                 ));
        }
Beispiel #9
0
        public bool CheckEffectiveDate(string mpi)
        {
            using (var context = new DefaulDataContext())
            {
                var mpiTrim = mpi.Trim();
                var mpiObj  = context.ProviderMpis.FirstOrDefault(o => o.Mpi == mpiTrim);
                if (mpiObj != null && !string.IsNullOrEmpty(mpiObj.EffectiveDateText))
                {
                    string effectiveStr = mpiObj.EffectiveDateText;
                    if (string.IsNullOrEmpty(effectiveStr))
                    {
                        return(false);
                    }
                    List <EffectiveDate> results = new List <EffectiveDate>();
                    int      partLength          = 8;
                    char     symbol = ';';
                    string[] part   = effectiveStr.Split(symbol);
                    for (int i = 0; i < part.Length; i++)
                    {
                        try
                        {
                            EffectiveDate efd           = new EffectiveDate();
                            string        startDateText = part[i].Substring(0, partLength);
                            int           startYear     = int.Parse(startDateText.Substring(0, 4));
                            int           startMonth    = int.Parse(startDateText.Substring(4, 2));
                            int           startDay      = int.Parse(startDateText.Substring(6, 2));
                            efd.StartDate = new DateTime(startYear, startMonth, startDay);

                            string endDateText = part[i].Substring(8, partLength);
                            int    endYear     = int.Parse(endDateText.Substring(0, 4));
                            int    endMonth    = int.Parse(endDateText.Substring(4, 2));
                            int    endDay      = int.Parse(endDateText.Substring(6, 2));
                            efd.EndDate = new DateTime(endYear, endMonth, endDay);

                            results.Add(efd);
                        }
                        catch
                        {
                            return(false);
                        }
                    }

                    var now = DateTime.Now;
                    now = new DateTime(now.Year, now.Month, now.Day);
                    foreach (var item in results)
                    {
                        if (item.StartDate <= now && now <= item.EndDate)
                        {
                            return(true);
                        }
                    }
                }

                return(false);
            }
        }
Beispiel #10
0
    //.....
    public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
    {
        var result = new List <ValidationResult>();

        foreach (var child in Children.Where(child => child.DateOfBirth.Date <EffectiveDate.AddYears(-1).Date || child.DateOfBirth.Date> EffectiveDate.Date))
        {
            result.Add(new ValidationResult($"The date of birth {child.DateOfBirth} of child {child.Name} is not between now and a year ago."));
        }
        return(result);
    }
            public string ToString(char separator)
            {
                var ns = NextSeparator(separator);

                return
                    ($"{ID}{separator}{CheckDigit}{separator}{CheckDigitScheme?.BestValue}{separator}" +
                     $"{AssigningAuthority?.ToString(ns)}{separator}{IdentifierTypeCode?.BestValue}{separator}" +
                     $"{AssigningFacility?.ToString(ns)}{EffectiveDate?.AsDTLocal()}{separator}{ExpirationDate?.AsDTLocal()}"
                     .TrimEnd(separator));
            }
Beispiel #12
0
        /// <summary>
        /// Hash code for the transaction for equality checks
        /// </summary>
        public override int GetHashCode()
        {
            // Get the hash code for the Date field if it is not null.
            int hashEffectiveDate = EffectiveDate == null ? 0 : EffectiveDate.GetHashCode();

            // Get the hash code for the FITID field.
            int hashFITID = FITID.GetHashCode();

            // Calculate the hash code for the transaction.
            return(hashEffectiveDate ^ hashFITID);
        }
Beispiel #13
0
 private DateTime GetMaturity()
 {
     if (Maturity.HasValue)
     {
         return(Maturity.Value);
     }
     if (Tenor.HasValue)
     {
         return(EffectiveDate?.AddPeriod(Tenor.Value.AsCfPeriod()) ?? Settings.QlEvaluationDate.Add(Tenor.Value.QlObj).AsDateTime());
     }
     throw new ArgumentException("Missing either Maturity or Tenor to build CDS Schedule");
 }
Beispiel #14
0
        public string this[string columnName]
        {
            get
            {
                if (columnName == "NewTitle")
                {
                    if (string.IsNullOrEmpty(NewTitle.ToString()))
                    {
                        return("New title is required");
                    }
                }
                if (columnName == "NewLocation")
                {
                    if (string.IsNullOrEmpty(NewLocation.ToString()))
                    {
                        return("New location is required");
                    }
                }

                if (columnName == "EffectiveDate")
                {
                    if (string.IsNullOrEmpty(EffectiveDate.ToString()))
                    {
                        return("Effective date is required");
                    }
                }

                if (columnName == "ApprovedBy")
                {
                    if (string.IsNullOrEmpty(ApprovedBy))
                    {
                        return("Approved by is required");
                    }
                }

                if (columnName == "TransferDate")
                {
                    if (string.IsNullOrEmpty(TransferDate.ToString()))
                    {
                        return("Transfer date is required");
                    }
                }
                if (columnName == "TransferReason")
                {
                    if (string.IsNullOrEmpty(TransferReason))
                    {
                        return("Transfer reason is required");
                    }
                }
                return(string.Empty);
            }
        }
        public override int GetHashCode()
        {
            int result = BlockedId != null?BlockedId.GetHashCode() : 0;

            result = (31 * result) + (StateName != null ? StateName.GetHashCode() : 0);
            result = (31 * result) + (Service != null ? Service.GetHashCode() : 0);
            result = (31 * result) + BlockChange.GetHashCode();
            result = (31 * result) + BlockEntitlement.GetHashCode();
            result = (31 * result) + BlockBilling.GetHashCode();
            result = (31 * result) + (EffectiveDate != null ? EffectiveDate.GetHashCode() : 0);
            result = (31 * result) + Type.GetHashCode();
            return(result);
        }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is SubscriptionEvent other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((SubscriptionEventType == null && other.SubscriptionEventType == null) || (SubscriptionEventType?.Equals(other.SubscriptionEventType) == true)) &&
                   ((EffectiveDate == null && other.EffectiveDate == null) || (EffectiveDate?.Equals(other.EffectiveDate) == true)) &&
                   ((PlanId == null && other.PlanId == null) || (PlanId?.Equals(other.PlanId) == true)));
        }
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (!(o is BlockingState))
            {
                return(false);
            }

            BlockingState that = (BlockingState)o;

            if (BlockedId != null ? !BlockedId.Equals(that.BlockedId) : that.BlockedId != null)
            {
                return(false);
            }
            if (StateName != null ? !StateName.Equals(that.StateName) : that.StateName != null)
            {
                return(false);
            }
            if (Service != null ? !Service.Equals(that.Service) : that.Service != null)
            {
                return(false);
            }
            if (!BlockChange.Equals(that.BlockChange))
            {
                return(false);
            }
            if (!BlockEntitlement.Equals(that.BlockEntitlement))
            {
                return(false);
            }
            if (!BlockBilling.Equals(that.BlockBilling))
            {
                return(false);
            }
            if (EffectiveDate != null ? EffectiveDate.CompareTo(that.EffectiveDate) != 0 : that.EffectiveDate != null)
            {
                return(false);
            }
            return(Type == that.Type);
        }
Beispiel #18
0
 public bool Contains(string value)
 {
     return
         (
         FriendlyName.Contains(value) ||
         Subject.Contains(value) ||
         Issuer.Contains(value) ||
         SerialNumber.Contains(value) ||
         Thumbprint.Contains(value) ||
         KeyAlgorithm.Contains(value) ||
         SignatureAlgorithm.Contains(value) ||
         Version.Contains(value) ||
         Format.Contains(value) ||
         Extentions.Contains(value) ||
         StoreLocation.Contains(value) ||
         StoreName.Contains(value) ||
         EffectiveDate.ToString().Contains(value) ||
         ExpirationDate.ToString().Contains(value)
         );
 }
        public void FillReimbursementDetails()
        {
            EffectiveDate.Clear();

            // Select Current business date from screen
            var text_input = driver.FindElement(By.XPath(".//*[@id='Form1']/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/font")).Text;
            var result = text_input.Substring(text_input.Length - 11);
            string currentDate = result.Remove(result.Length - 1);

            ExcelOperation.AddData("TestData17", currentDate, "TC1_CreateAnEmployee");
            EffectiveDate.SendKeys(currentDate);

            PreferedMethodToContact.Click();
            ChequeAddress.Click();
            EFTRemittanceCommunicationDetailsMethod.Click();
            IQueueNumberText.Clear();

            IQueueNumberText.SendKeys(ExcelOperation.GetData[18]);
            GenericHelper.AllScreenShot(driver);
            NextButton.Click();            
        }
Beispiel #20
0
 public void MergeFrom(HousekeepingAssignment other)
 {
     if (other == null)
     {
         return;
     }
     if (other.createdAt_ != null)
     {
         if (createdAt_ == null)
         {
             createdAt_ = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         CreatedAt.MergeFrom(other.CreatedAt);
     }
     if (other.effectiveDate_ != null)
     {
         if (effectiveDate_ == null)
         {
             effectiveDate_ = new global::HOLMS.Types.Primitive.PbLocalDate();
         }
         EffectiveDate.MergeFrom(other.EffectiveDate);
     }
     if (other.housekeeper_ != null)
     {
         if (housekeeper_ == null)
         {
             housekeeper_ = new global::HOLMS.Types.IAM.StaffMemberIndicator();
         }
         Housekeeper.MergeFrom(other.Housekeeper);
     }
     if (other.room_ != null)
     {
         if (room_ == null)
         {
             room_ = new global::HOLMS.Types.Operations.Rooms.RoomIndicator();
         }
         Room.MergeFrom(other.Room);
     }
 }
Beispiel #21
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (createdAt_ != null)
            {
                hash ^= CreatedAt.GetHashCode();
            }
            if (effectiveDate_ != null)
            {
                hash ^= EffectiveDate.GetHashCode();
            }
            if (housekeeper_ != null)
            {
                hash ^= Housekeeper.GetHashCode();
            }
            if (room_ != null)
            {
                hash ^= Room.GetHashCode();
            }
            return(hash);
        }
        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);
        }
Beispiel #23
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (chaincodeSpec_ != null)
            {
                hash ^= ChaincodeSpec.GetHashCode();
            }
            if (effectiveDate_ != null)
            {
                hash ^= EffectiveDate.GetHashCode();
            }
            if (CodePackage.Length != 0)
            {
                hash ^= CodePackage.GetHashCode();
            }
            if (ExecEnv != 0)
            {
                hash ^= ExecEnv.GetHashCode();
            }
            return(hash);
        }
 public override int GetHashCode()
 {
     if (Flow != null && Item != null && Uom != null && UnitCount != null && StartTime != null && WindowTime != null && EffectiveDate != null)
     {
         return(Flow.GetHashCode() ^ Item.GetHashCode() ^ Uom.GetHashCode() ^ UnitCount.GetHashCode() ^ StartTime.GetHashCode() ^ WindowTime.GetHashCode() ^ EffectiveDate.GetHashCode());
     }
     else
     {
         return(base.GetHashCode());
     }
 }
Beispiel #25
0
 public string GetEffectiveDate()
 {
     return(EffectiveDate.ToShortDateString());
 }
Beispiel #26
0
 public override string ToString()
 {
     return($"{Variables.safeCount()} Variables as of: {EffectiveDate.FormatAPIDate() ?? TWPApiUtil.Api_Unset_Token}, ");
 }
Beispiel #27
0
 public override string ToString()
 {
     return(string.Format("航空公司:{0} 里程:{1} 生效日期:{2} 失效日期:{3} 成人:{4} 儿童:{5}",
                          AirlineCode.Value, Mileage, EffectiveDate.ToShortDateString(),
                          ExpiredDate.HasValue ? ExpiredDate.Value.ToShortDateString() : string.Empty, Adult, Child));
 }
 public override string ToString()
 {
     return($"{Variables.SafeCount()} Variables as of: {EffectiveDate.FormatAPIDate() ?? TWP_API_UTILS.API_UNSET_TOKEN}, ");
 }
 public void Validate()
 {
     Key.ValidateRequired("Key");
     EffectiveDate.ValidateRequired("EffectiveDate");
 }
Beispiel #30
0
 public override string ToString()
 {
     return($"{Id} {EffectiveDate.ToShortDateString()} {UnitOfMeasure} {Rate}");
 }