public bool Equals(Make other)
 {
     return(other != null &&
            Manufacturer.Equals(other.Manufacturer) &&
            AlternativeNames.Equals(other.AlternativeNames) &&
            Models.Equals(other.Models));
 }
Beispiel #2
0
 public override bool Equals(object obj)
 {
     if (obj == null)
     {
         throw new ArgumentNullException();
     }
     return(obj is Part p && Manufacturer.Equals(p.Manufacturer) && Name.Equals(p.Name) && Model.Equals(p.Model));
 }
Beispiel #3
0
        //Returns true if name and numCyl from this vehicle are equivalent to the other vehicle.
        public override bool Equals(object obj)
        {
            if (null == obj && GetType() != obj.GetType())
            {
                return(false);
            }
            Vehicle other = (Vehicle)obj;

            return(name.Equals(other.name) && numCyl == other.numCyl);
        }
        public override bool Equals(object obj)
        {
            var makeModel = obj as Make;

            if (makeModel == null)
            {
                return(false);
            }

            return(Manufacturer.Equals(makeModel.Manufacturer) &&
                   AlternativeNames.Equals(makeModel.AlternativeNames) &&
                   Models.Equals(makeModel.Models));
        }
Beispiel #5
0
        public async Task <IHttpActionResult> Manufacturer(Manufacturer ManufacturerID, Manufacturer manufacturer)
        {
            if (manufacturer == null || ManufacturerID.Equals(0))
            {
                return(BadRequest());
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            ManufacturerRepo.Insert(manufacturer);

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #6
0
        public override bool Equals(Object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            var that = obj as DeviceInformation;

            return(Manufacturer.Equals(that.Manufacturer) && ModelNumber.Equals(that.ModelNumber) && SerialNumber.Equals(that.SerialNumber) &&
                   FirmwareRevision.Equals(that.FirmwareRevision) && HardwareRevision.Equals(that.HardwareRevision));
        }
Beispiel #7
0
        public async Task ReadAsync_ShouldReadManufacturer_True()
        {
            //arrange
            Manufacturer manufacturer = new Manufacturer
            {
                Name        = "TestName",
                Address     = "TestAdress",
                PhoneNumber = "TestPhone"
            };

            //act
            await DataAccess.Manufacturers.CreateAsync(manufacturer);

            manufacturer.Id = SqlWorker.ExecuteScalar <int>("SELECT MAX([ID]) FROM [Manufacturer]");
            Manufacturer manufacturerForCompare = DataAccess.Manufacturers.ReadAsync(manufacturer.Id).Result;
            await DataAccess.Manufacturers.DeleteAsync(manufacturer.Id);

            //assert
            Assert.IsTrue(manufacturer.Equals(manufacturerForCompare));
        }
Beispiel #8
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            var oth = obj as ModemStatus;

            if (oth == null)
            {
                return(false);
            }
            return(IsSuccess == oth.IsSuccess &&
                   State.Equals(oth.State) &&
                   Manufacturer.Equals(oth.Manufacturer) &&
                   ModelName.Equals(oth.ModelName) &&
                   SerialNumber.Equals(oth.SerialNumber) &&
                   SignalQuality == oth.SignalQuality &&
                   Imsi.Equals(oth.Imsi) &&
                   Imei.Equals(oth.Imei) &&
                   OperatorName.Equals(oth.OperatorName));
        }
Beispiel #9
0
        /// <summary>
        /// Returns true if ProductInformationDto instances are equal
        /// </summary>
        /// <param name="other">Instance of ProductInformationDto to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ProductInformationDto other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Barcode == other.Barcode ||
                     Barcode != null &&
                     Barcode.Equals(other.Barcode)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Manufacturer == other.Manufacturer ||
                     Manufacturer != null &&
                     Manufacturer.Equals(other.Manufacturer)
                 ) &&
                 (
                     Images == other.Images ||
                     Images != null &&
                     other.Images != null &&
                     Images.SequenceEqual(other.Images)
                 ) &&
                 (
                     Category == other.Category ||
                     Category != null &&
                     Category.Equals(other.Category)
                 ));
        }
        public virtual Manufacturer UpdateManufacturer(Manufacturer entity)
        {
            if (entity.IsTransient())
            {
                return(entity);
            }
            Manufacturer other = GetManufacturer(entity.ManufacturerId);

            if (entity.Equals(other))
            {
                return(entity);
            }
            string sql = @"Update Manufacturer set  [ManufacturerGUID]=@ManufacturerGUID
							, [Name]=@Name
							, [SEName]=@SEName
							, [SEKeywords]=@SEKeywords
							, [SEDescription]=@SEDescription
							, [SETitle]=@SETitle
							, [SENoScript]=@SENoScript
							, [SEAltText]=@SEAltText
							, [Address1]=@Address1
							, [Address2]=@Address2
							, [Suite]=@Suite
							, [City]=@City
							, [State]=@State
							, [ZipCode]=@ZipCode
							, [Country]=@Country
							, [Phone]=@Phone
							, [FAX]=@FAX
							, [URL]=@URL
							, [Email]=@Email
							, [QuantityDiscountID]=@QuantityDiscountID
							, [SortByLooks]=@SortByLooks
							, [Summary]=@Summary
							, [Description]=@Description
							, [Notes]=@Notes
							, [RelatedDocuments]=@RelatedDocuments
							, [XmlPackage]=@XmlPackage
							, [ColWidth]=@ColWidth
							, [DisplayOrder]=@DisplayOrder
							, [ExtensionData]=@ExtensionData
							, [ContentsBGColor]=@ContentsBGColor
							, [PageBGColor]=@PageBGColor
							, [GraphicsColor]=@GraphicsColor
							, [ImageFilenameOverride]=@ImageFilenameOverride
							, [Published]=@Published
							, [Wholesale]=@Wholesale
							, [ParentManufacturerID]=@ParentManufacturerID
							, [IsImport]=@IsImport
							, [Deleted]=@Deleted
							, [CreatedOn]=@CreatedOn
							, [PageSize]=@PageSize
							, [SkinID]=@SkinID
							, [TemplateName]=@TemplateName 
							 where ManufacturerID=@ManufacturerID"                            ;

            SqlParameter[] parameterArray = new SqlParameter[] {
                new SqlParameter("@ManufacturerID", entity.ManufacturerId)
                , new SqlParameter("@ManufacturerGUID", entity.ManufacturerGuid)
                , new SqlParameter("@Name", entity.Name)
                , new SqlParameter("@SEName", entity.SeName ?? (object)DBNull.Value)
                , new SqlParameter("@SEKeywords", entity.SeKeywords ?? (object)DBNull.Value)
                , new SqlParameter("@SEDescription", entity.SeDescription ?? (object)DBNull.Value)
                , new SqlParameter("@SETitle", entity.SeTitle ?? (object)DBNull.Value)
                , new SqlParameter("@SENoScript", entity.SeNoScript ?? (object)DBNull.Value)
                , new SqlParameter("@SEAltText", entity.SeAltText ?? (object)DBNull.Value)
                , new SqlParameter("@Address1", entity.Address1 ?? (object)DBNull.Value)
                , new SqlParameter("@Address2", entity.Address2 ?? (object)DBNull.Value)
                , new SqlParameter("@Suite", entity.Suite ?? (object)DBNull.Value)
                , new SqlParameter("@City", entity.City ?? (object)DBNull.Value)
                , new SqlParameter("@State", entity.State ?? (object)DBNull.Value)
                , new SqlParameter("@ZipCode", entity.ZipCode ?? (object)DBNull.Value)
                , new SqlParameter("@Country", entity.Country ?? (object)DBNull.Value)
                , new SqlParameter("@Phone", entity.Phone ?? (object)DBNull.Value)
                , new SqlParameter("@FAX", entity.Fax ?? (object)DBNull.Value)
                , new SqlParameter("@URL", entity.Url ?? (object)DBNull.Value)
                , new SqlParameter("@Email", entity.Email ?? (object)DBNull.Value)
                , new SqlParameter("@QuantityDiscountID", entity.QuantityDiscountId ?? (object)DBNull.Value)
                , new SqlParameter("@SortByLooks", entity.SortByLooks)
                , new SqlParameter("@Summary", entity.Summary ?? (object)DBNull.Value)
                , new SqlParameter("@Description", entity.Description ?? (object)DBNull.Value)
                , new SqlParameter("@Notes", entity.Notes ?? (object)DBNull.Value)
                , new SqlParameter("@RelatedDocuments", entity.RelatedDocuments ?? (object)DBNull.Value)
                , new SqlParameter("@XmlPackage", entity.XmlPackage ?? (object)DBNull.Value)
                , new SqlParameter("@ColWidth", entity.ColWidth)
                , new SqlParameter("@DisplayOrder", entity.DisplayOrder)
                , new SqlParameter("@ExtensionData", entity.ExtensionData ?? (object)DBNull.Value)
                , new SqlParameter("@ContentsBGColor", entity.ContentsBgColor ?? (object)DBNull.Value)
                , new SqlParameter("@PageBGColor", entity.PageBgColor ?? (object)DBNull.Value)
                , new SqlParameter("@GraphicsColor", entity.GraphicsColor ?? (object)DBNull.Value)
                , new SqlParameter("@ImageFilenameOverride", entity.ImageFilenameOverride ?? (object)DBNull.Value)
                , new SqlParameter("@Published", entity.Published)
                , new SqlParameter("@Wholesale", entity.Wholesale)
                , new SqlParameter("@ParentManufacturerID", entity.ParentManufacturerId)
                , new SqlParameter("@IsImport", entity.IsImport)
                , new SqlParameter("@Deleted", entity.Deleted)
                , new SqlParameter("@CreatedOn", entity.CreatedOn)
                , new SqlParameter("@PageSize", entity.PageSize)
                , new SqlParameter("@SkinID", entity.SkinId)
                , new SqlParameter("@TemplateName", entity.TemplateName)
            };
            SqlHelper.ExecuteNonQuery(this.ConnectionString, CommandType.Text, sql, parameterArray);
            return(GetManufacturer(entity.ManufacturerId));
        }
Beispiel #11
0
        /// <summary>
        /// Returns true if Item instances are equal
        /// </summary>
        /// <param name="other">Instance of Item to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Item other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Upc == other.Upc ||
                     Upc != null &&
                     Upc.Equals(other.Upc)
                     ) &&
                 (
                     Ean == other.Ean ||
                     Ean != null &&
                     Ean.Equals(other.Ean)
                 ) &&
                 (
                     Isbn == other.Isbn ||
                     Isbn != null &&
                     Isbn.Equals(other.Isbn)
                 ) &&
                 (
                     Asin == other.Asin ||
                     Asin != null &&
                     Asin.Equals(other.Asin)
                 ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ) &&
                 (
                     Sku == other.Sku ||
                     Sku != null &&
                     Sku.Equals(other.Sku)
                 ) &&
                 (
                     Mpn == other.Mpn ||
                     Mpn != null &&
                     Mpn.Equals(other.Mpn)
                 ) &&
                 (
                     PartNumber == other.PartNumber ||
                     PartNumber != null &&
                     PartNumber.Equals(other.PartNumber)
                 ) &&
                 (
                     Upcs == other.Upcs ||
                     Upcs != null &&
                     other.Upcs != null &&
                     Upcs.SequenceEqual(other.Upcs)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Brand == other.Brand ||
                     Brand != null &&
                     Brand.Equals(other.Brand)
                 ) &&
                 (
                     Manufacturer == other.Manufacturer ||
                     Manufacturer != null &&
                     Manufacturer.Equals(other.Manufacturer)
                 ) &&
                 (
                     Color == other.Color ||
                     Color != null &&
                     Color.Equals(other.Color)
                 ) &&
                 (
                     NewPrice == other.NewPrice ||

                     NewPrice.Equals(other.NewPrice)
                 ) &&
                 (
                     UsedPrice == other.UsedPrice ||

                     UsedPrice.Equals(other.UsedPrice)
                 ) &&
                 (
                     CurrencyCode == other.CurrencyCode ||
                     CurrencyCode != null &&
                     CurrencyCode.Equals(other.CurrencyCode)
                 ) &&
                 (
                     Url == other.Url ||
                     Url != null &&
                     Url.Equals(other.Url)
                 ) &&
                 (
                     Features == other.Features ||
                     Features != null &&
                     other.Features != null &&
                     Features.SequenceEqual(other.Features)
                 ) &&
                 (
                     Dimensions == other.Dimensions ||
                     Dimensions != null &&
                     other.Dimensions != null &&
                     Dimensions.SequenceEqual(other.Dimensions)
                 ) &&
                 (
                     Images == other.Images ||
                     Images != null &&
                     other.Images != null &&
                     Images.SequenceEqual(other.Images)
                 ) &&
                 (
                     MatchedItems == other.MatchedItems ||
                     MatchedItems != null &&
                     other.MatchedItems != null &&
                     MatchedItems.SequenceEqual(other.MatchedItems)
                 ) &&
                 (
                     IsoCountryCodes == other.IsoCountryCodes ||
                     IsoCountryCodes != null &&
                     other.IsoCountryCodes != null &&
                     IsoCountryCodes.SequenceEqual(other.IsoCountryCodes)
                 ) &&
                 (
                     CompanyName == other.CompanyName ||
                     CompanyName != null &&
                     CompanyName.Equals(other.CompanyName)
                 ) &&
                 (
                     CompanyAddress == other.CompanyAddress ||
                     CompanyAddress != null &&
                     CompanyAddress.Equals(other.CompanyAddress)
                 ) &&
                 (
                     Categories == other.Categories ||
                     Categories != null &&
                     other.Categories != null &&
                     Categories.SequenceEqual(other.Categories)
                 ) &&
                 (
                     CategoryHierarchies == other.CategoryHierarchies ||
                     CategoryHierarchies != null &&
                     other.CategoryHierarchies != null &&
                     CategoryHierarchies.SequenceEqual(other.CategoryHierarchies)
                 ));
        }