Beispiel #1
0
        public static Fly_RelatedProduct UpdateEntity(Fly_RelatedProduct itemNew, Fly_RelatedProduct itemOld)
        {
            Fly_RelatedProduct rs = itemOld;

            if (itemNew != null && itemOld != null)
            {
                rs.ProductID1       = (itemNew.ProductID1 == null || itemNew.ProductID1.Equals(itemOld.ProductID1)) ? itemOld.ProductID1 : itemNew.ProductID1;
                rs.ProductID2       = (itemNew.ProductID2 == null || itemNew.ProductID2.Equals(itemOld.ProductID2)) ? itemOld.ProductID2 : itemNew.ProductID2;
                rs.RelatedProductID = (itemNew.RelatedProductID.Equals(itemOld.RelatedProductID)) ? itemOld.RelatedProductID : itemNew.RelatedProductID;
            }
            return(rs);
        }
Beispiel #2
0
        public static Fly_RelatedProduct UpdateEntity(Fly_RelatedProduct ItemNew, Fly_RelatedProduct ItemOld)
        {
            Fly_RelatedProduct rs = ItemOld;

            if (ItemNew != null && ItemOld != null)
            {
                rs.ProductID1       = (ItemNew.ProductID1 == null || ItemNew.ProductID1.Equals(ItemOld.ProductID1)) ? ItemOld.ProductID1 : ItemNew.ProductID1;
                rs.ProductID2       = (ItemNew.ProductID2 == null || ItemNew.ProductID2.Equals(ItemOld.ProductID2)) ? ItemOld.ProductID2 : ItemNew.ProductID2;
                rs.RelatedProductID = (ItemNew.RelatedProductID == null || ItemNew.RelatedProductID.Equals(ItemOld.RelatedProductID)) ? ItemOld.RelatedProductID : ItemNew.RelatedProductID;
            }
            return(rs);
        }
Beispiel #3
0
        public ProductVM()
        {
            // attribute
            Product                 = new Fly_Product();
            ProductLocalized        = new Fly_ProductLocalized();
            ProductVariant          = new Fly_ProductVariant();
            ProductVariantLocalized = new Fly_ProductVariantLocalized();
            Categories              = new Fly_Category();
            Manufacturers           = new Fly_Manufacturer();
            RelateProducts          = new Fly_RelatedProduct();
            ProductPictures         = new Fly_ProductPicture();
            MappingCategories       = new Fly_Product_Category_Mapping();
            MappingManufacturer     = new Fly_Product_Manufacturer_Mapping();
            MappingDiscount         = new Fly_ProductVariant_Discount_Mapping();
            SectionGalleries        = new Fly_SectionGallery();

            // ListObject
            ProductList                 = new List <Fly_Product>();
            ProductLocalizedList        = new List <Fly_ProductLocalized>();
            ProductVariantList          = new List <Fly_ProductVariant>();
            ProductVariantLocalizedList = new List <Fly_ProductVariantLocalized>();
            CategoryList                = new List <Fly_Category>();
            ManufacturerList            = new List <Fly_Manufacturer>();
            RelatedProductList          = new List <Fly_RelatedProduct>();
            ProductPictureList          = new List <Fly_ProductPicture>();
            MappingCategoriesList       = new List <Fly_Product_Category_Mapping>();
            MappingManufacturerList     = new List <Fly_Product_Manufacturer_Mapping>();
            MappingDiscountList         = new List <Fly_ProductVariant_Discount_Mapping>();

            // attribute bool
            isHome         = true;
            isDelete       = false;
            isPublish      = true;
            isShipEnabled  = true;
            isFreeShipping = false;
            isCallForPrice = false;
            isHot          = false;
            isNew          = true;
            isGift         = false;
            isNullData     = false;
            isAccessories  = false;

            //// Select Item
            //CategoriesItemList = new IEnumerable<SelectListItem>();
            //ManufacturerItemList = new IEnumerable<SelectListItem>();
            //DiscountItemList = new IEnumerable<SelectListItem>();
        }