コード例 #1
0
        public StringModel ToStringModel <BLModel, StringModel>()
        {
            Mapper.CreateMap <OpenPurchaseOrders, StringOpenPurchaseOrders>()
            .ForAllMembers(item => item.ToString().CutDownTo(50));

            var stringModel = Mapper.Map <OpenPurchaseOrders, StringOpenPurchaseOrders>(this);

            stringModel.RowTransactionType = RowTransactionType.CutDownTo(1);

            stringModel.ExtractionDate = ExtractionDate.DateTimeToString();
            stringModel.OrderDate      = OrderDate.DateToString();

            stringModel.RequestedDate = RequestedDate.DateToString();
            stringModel.ReceivedDate  = ReceivedDate.DateToString();

            stringModel.FreeText1 = FreeText1.CutDownTo(100);
            stringModel.FreeText2 = FreeText2.CutDownTo(100);
            stringModel.FreeText3 = FreeText3.CutDownTo(100);
            stringModel.FreeText4 = FreeText4.CutDownTo(100);


            Mapper.CreateMap <StringDealerPartsMaster, StringModel>();
            var stringModelRet = Mapper.Map <StringOpenPurchaseOrders, StringModel>(stringModel);


            return(stringModelRet);
        }
コード例 #2
0
ファイル: TrainingRequest.cs プロジェクト: yareda/backoffice
 public string this[string columnName]
 {
     get
     {
         if (columnName == "TrainingTitle")
         {
             if (string.IsNullOrEmpty(TrainingTitle))
             {
                 return("Training title is required");
             }
         }
         if (columnName == "RequestedDate")
         {
             if (string.IsNullOrEmpty(RequestedDate.ToString()))
             {
                 return("Requested date is required");
             }
         }
         if (columnName == "RequestedBy")
         {
             if (string.IsNullOrEmpty(RequestedBy))
             {
                 return("Requested by is required");
             }
         }
         return(string.Empty);
     }
 }
コード例 #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Company != null ? Company.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (From != null ? From.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (To != null ? To.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ RequestedDate.GetHashCode();
         hashCode = (hashCode * 397) ^ DepartureDate.GetHashCode();
         hashCode = (hashCode * 397) ^ ArrivalDate.GetHashCode();
         hashCode = (hashCode * 397) ^ DepartureTime.GetHashCode();
         hashCode = (hashCode * 397) ^ ArrivalTime.GetHashCode();
         hashCode = (hashCode * 397) ^ Price.GetHashCode();
         return(hashCode);
     }
 }
コード例 #4
0
        public bool Equals(Flight other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(string.Equals(Company, other.Company) && string.Equals(From, other.From) && string.Equals(To, other.To) && RequestedDate.Equals(other.RequestedDate) && DepartureDate.Equals(other.DepartureDate) && ArrivalDate.Equals(other.ArrivalDate) && DepartureTime.Equals(other.DepartureTime) && ArrivalTime.Equals(other.ArrivalTime) && Price.Equals(other.Price));
        }