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(); }
public static Fly_CustomerAttribute UpdateEntity(Fly_CustomerAttribute itemNew, Fly_CustomerAttribute itemOld) { Fly_CustomerAttribute rs = itemOld; if (itemNew != null && itemOld != null) { rs.CustomerId = (itemNew.CustomerId.Equals(itemOld.CustomerId)) ? itemOld.CustomerId : itemNew.CustomerId; rs.FirstName = (itemNew.FirstName != null && itemNew.FirstName.Equals(itemOld.FirstName)) ? itemOld.FirstName : itemNew.FirstName; rs.LastName = (itemNew.LastName != null && itemNew.LastName.Equals(itemOld.LastName)) ? itemOld.LastName : itemNew.LastName; rs.StreetAddress = (itemNew.StreetAddress != null && itemNew.StreetAddress.Equals(itemOld.StreetAddress)) ? itemOld.StreetAddress : itemNew.StreetAddress; rs.City = (itemNew.City != null && itemNew.City.Equals(itemOld.City)) ? itemOld.City : itemNew.City; rs.CountryID = (itemNew.CountryID != null && itemNew.CountryID.Equals(itemOld.CountryID)) ? itemOld.CountryID : itemNew.CountryID; rs.MobilePhone = (itemNew.MobilePhone != null && itemNew.MobilePhone.Equals(itemOld.MobilePhone)) ? itemOld.MobilePhone : itemNew.MobilePhone; } return(rs); }