Ejemplo n.º 1
0
 public ShopCartVm()
 {
     Order               = new Fly_Order();
     ProductVariant      = new Fly_ProductVariant();
     Products            = new Fly_Product();
     Customer            = new Fly_Customer();
     CustomerAttr        = new Fly_CustomerAttribute();
     OrderNote           = new Fly_OrderNote();
     OrderProductVariant = new Fly_OrderProductVariant();
     Country             = new Fly_Country();
 }
Ejemplo n.º 2
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>();
        }
Ejemplo n.º 3
0
        public static Fly_Product UpdateEntity(Fly_Product itemNew, Fly_Product itemOld)
        {
            Fly_Product rs = itemOld;

            if (itemNew != null && itemOld != null)
            {
                rs.CreatedOn        = (itemNew.CreatedOn == null || itemNew.CreatedOn.Equals(itemOld.CreatedOn)) ? itemOld.CreatedOn : DateTime.Now;
                rs.Name             = (itemNew.Name == null || itemNew.Name.Equals(itemOld.Name)) ? itemOld.Name : itemNew.Name;
                rs.Deleted          = (itemNew.Deleted == null || itemNew.Deleted.Equals(itemOld.Deleted)) ? itemOld.Deleted : itemNew.Deleted;
                rs.FullDescription  = (itemNew.FullDescription == null || itemNew.FullDescription.Equals(itemOld.FullDescription)) ? itemOld.FullDescription : itemNew.FullDescription;
                rs.Published        = (itemNew.Published == null || itemNew.Published.Equals(itemOld.Published)) ? itemOld.Published : itemNew.Published;
                rs.ShortDescription = (itemNew.ShortDescription == null || itemNew.ShortDescription.Equals(itemOld.ShortDescription)) ? itemOld.ShortDescription : itemNew.ShortDescription;
                rs.ShowOnHomePage   = (itemNew.ShowOnHomePage == null || itemNew.ShowOnHomePage.Equals(itemOld.ShowOnHomePage)) ? itemOld.ShowOnHomePage : itemNew.ShowOnHomePage;
                rs.TemplateID       = (itemNew.TemplateID == null || itemNew.TemplateID.Equals(itemOld.TemplateID)) ? itemOld.TemplateID : itemNew.TemplateID;
                rs.UpdatedOn        = (itemNew.UpdatedOn == null || itemNew.UpdatedOn.Equals(itemOld.UpdatedOn)) ? itemOld.UpdatedOn : DateTime.Now;
            }
            return(rs);
        }