private object BuildReferenceDto(Customer item)
 {
     return new{
         StringId = _stringConverter.ToString(item),
         Description = item.ToString(),
     };
 }
 private object BuildFullDto(Customer item)
 {
     return new{
         StringId = _stringConverter.ToString(item),
         item.CustomerId,
         item.CompanyName,
         item.ContactName,
         item.ContactTitle,
         item.Address,
         item.City,
         item.Region,
         item.PostalCode,
         item.Country,
         item.Phone,
         item.Fax,
         item.Customerdemographics,
         // item.Orders, // Skip bacause is collection of non detail objects
     };
 }
 public string ToString(Customer obj)
 {
     return obj.CustomerId;
 }
Ejemplo n.º 4
0
 public void Update(Customer v)
 {
     _Northwind.Update(v);
 }
Ejemplo n.º 5
0
 public void Delete(Customer v)
 {
     _Northwind.Delete(v);
 }
Ejemplo n.º 6
0
 public void Create(Customer v)
 {
     _Northwind.Save(v);
 }
Ejemplo n.º 7
0
        public IQueryable<Order> SearchNormal(int? orderId, DateTime? orderDate, DateTime? requiredDate, DateTime? shippedDate, decimal? freight, string shipName, string shipAddress, string shipCity, string shipRegion, string shipPostalCode, string shipCountry, Customer customer, Employee employee, Shipper shipper)
        {
            IQueryable<Order> queryable = _Northwind.Linq<Order>();
            if (orderId != default(int?))
            {
                queryable = queryable.Where(x => x.OrderId == orderId);
            }
            if (orderDate != default(DateTime?))
            {
                queryable = queryable.Where(x => x.OrderDate == orderDate);
            }
            if (requiredDate != default(DateTime?))
            {
                queryable = queryable.Where(x => x.RequiredDate == requiredDate);
            }
            if (shippedDate != default(DateTime?))
            {
                queryable = queryable.Where(x => x.ShippedDate == shippedDate);
            }
            if (freight != default(decimal?))
            {
                queryable = queryable.Where(x => x.Freight == freight);
            }
            if (shipName != default(string))
            {
                queryable = queryable.Where(x => x.ShipName == shipName);
            }
            if (shipAddress != default(string))
            {
                queryable = queryable.Where(x => x.ShipAddress == shipAddress);
            }
            if (shipCity != default(string))
            {
                queryable = queryable.Where(x => x.ShipCity == shipCity);
            }
            if (shipRegion != default(string))
            {
                queryable = queryable.Where(x => x.ShipRegion == shipRegion);
            }
            if (shipPostalCode != default(string))
            {
                queryable = queryable.Where(x => x.ShipPostalCode == shipPostalCode);
            }
            if (shipCountry != default(string))
            {
                queryable = queryable.Where(x => x.ShipCountry == shipCountry);
            }
            if (customer != default(Customer))
            {
                queryable = queryable.Where(x => x.Customer == customer);
            }
            if (employee != default(Employee))
            {
                queryable = queryable.Where(x => x.Employee == employee);
            }
            if (shipper != default(Shipper))
            {
                queryable = queryable.Where(x => x.Shipper == shipper);
            }

            return queryable;
        }
Ejemplo n.º 8
0
 public void Update(Customer v)
 {
     _northwind.GetCurrentSession().Update(v);
 }
Ejemplo n.º 9
0
 public void Delete(Customer v)
 {
     _northwind.GetCurrentSession().Delete(v);
 }
Ejemplo n.º 10
0
 public void Create(Customer v)
 {
     _northwind.GetCurrentSession().Save(v);
 }
Ejemplo n.º 11
0
        public IPresentableSet<Order> SearchNormal(int? orderId, DateTime? orderDate, DateTime? requiredDate, DateTime? shippedDate, decimal? freight, string shipName, string shipAddress, string shipCity, string shipRegion, string shipPostalCode, string shipCountry, Customer customer, Employee employee, Shipper shipper)
        {
            IQueryable<Order> queryable = _northwind.GetCurrentSession().Linq<Order>();
            if(orderId != default(int?))
            {
                queryable = queryable.Where(x => x.OrderId == orderId);
            }
            if(orderDate != default(DateTime?))
            {
                queryable = queryable.Where(x => x.OrderDate == orderDate);
            }
            if(requiredDate != default(DateTime?))
            {
                queryable = queryable.Where(x => x.RequiredDate == requiredDate);
            }
            if(shippedDate != default(DateTime?))
            {
                queryable = queryable.Where(x => x.ShippedDate == shippedDate);
            }
            if(freight != default(decimal?))
            {
                queryable = queryable.Where(x => x.Freight == freight);
            }
            if(!string.IsNullOrEmpty(shipName))
            {
                queryable = queryable.Where(x => x.ShipName == shipName);
            }
            if(!string.IsNullOrEmpty(shipAddress))
            {
                queryable = queryable.Where(x => x.ShipAddress == shipAddress);
            }
            if(!string.IsNullOrEmpty(shipCity))
            {
                queryable = queryable.Where(x => x.ShipCity == shipCity);
            }
            if(!string.IsNullOrEmpty(shipRegion))
            {
                queryable = queryable.Where(x => x.ShipRegion == shipRegion);
            }
            if(!string.IsNullOrEmpty(shipPostalCode))
            {
                queryable = queryable.Where(x => x.ShipPostalCode == shipPostalCode);
            }
            if(!string.IsNullOrEmpty(shipCountry))
            {
                queryable = queryable.Where(x => x.ShipCountry == shipCountry);
            }
            if(customer != default(Customer))
            {
                queryable = queryable.Where(x => x.Customer == customer);
            }
            if(employee != default(Employee))
            {
                queryable = queryable.Where(x => x.Employee == employee);
            }
            if(shipper != default(Shipper))
            {
                queryable = queryable.Where(x => x.Shipper == shipper);
            }

            return new QueryablePresentableSet<Order>(queryable);
        }
Ejemplo n.º 12
0
 public virtual bool Equals(Customer other)
 {
     if(ReferenceEquals(null, other))
     {
         return false;
     }
     if(ReferenceEquals(this, other))
     {
         return true;
     }
     if(CustomerId != default(string))
     {
         return other.CustomerId == CustomerId;
     }
     return other.CustomerId == CustomerId && other.CompanyName == CompanyName && other.ContactName == ContactName && other.ContactTitle == ContactTitle && other.Address == Address && other.City == City && other.Region == Region && other.PostalCode == PostalCode && other.Country == Country && other.Phone == Phone && other.Fax == Fax && 1 == 1 && 1 == 1;
 }