private object BuildReferenceDto(Employee item)
 {
     return new{
         StringId = _stringConverter.ToString(item),
         Description = item.ToString(),
     };
 }
        private object BuildFullDto(Employee item)
        {
            return new{
                StringId = _stringConverter.ToString(item),
                item.EmployeeId,
                item.LastName,
                item.FirstName,
                item.Title,
                item.TitleOfCourtesy,
                item.BirthDate,
                item.HireDate,
                item.Address,
                item.City,
                item.Region,
                item.PostalCode,
                item.Country,
                item.HomePhone,
                item.Extension,
                // item.Photo, // Skip bacause is binary data

                item.Notes,
                item.PhotoPath,
                // item.RelatedEmployee, // Skip bacause is inverse association

                // item.Employees, // Skip bacause is collection of non detail objects

                // item.Territories, // Skip bacause is collection of non detail objects

                // item.Orders, // Skip bacause is collection of non detail objects
            };
        }
 public void Update(Employee v)
 {
     _northwind.GetCurrentSession().Update(v);
 }
 public void Delete(Employee v)
 {
     _northwind.GetCurrentSession().Delete(v);
 }
 public void Create(Employee v)
 {
     _northwind.GetCurrentSession().Save(v);
 }
        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;
        }
        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);
        }
Example #8
0
 public virtual bool Equals(Employee other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     if (EmployeeId != default(int))
     {
         return other.EmployeeId == EmployeeId;
     }
     return other.EmployeeId == EmployeeId && other.LastName == LastName && other.FirstName == FirstName && other.Title == Title && other.TitleOfCourtesy == TitleOfCourtesy && other.BirthDate == BirthDate && other.HireDate == HireDate && other.Address == Address && other.City == City && other.Region == Region && other.PostalCode == PostalCode && other.Country == Country && other.HomePhone == HomePhone && other.Extension == Extension && other.Photo == Photo && other.Notes == Notes && other.PhotoPath == PhotoPath && other.RelatedEmployee == RelatedEmployee && 1 == 1 && 1 == 1 && 1 == 1;
 }
 public string ToString(Employee obj)
 {
     return obj.EmployeeId.ToString();
 }