Example #1
0
    public Project.Library.Customer SearchCustomer(string firstname)
    {
        var result = _DBcontext.Customers.Where(x => x.FirstName == firstname).FirstOrDefault();

        Project.Library.Customer customer = new Project.Library.Customer(result.FirstName, result.LastName, result.CustomerId);

        return(customer);
    }
Example #2
0
    public Project.Library.Customer FindCustomerID(int customerid)
    {
        var result = _DBcontext.Customers.Where(x => x.CustomerId == customerid).FirstOrDefault();

        Project.Library.Customer customer = new Project.Library.Customer(result.FirstName, result.LastName, result.CustomerId);

        return(customer);
    }
Example #3
0
    public bool AddCustomer(Project.Library.Customer customer)
    {
        Project.SQL.Customer Newcustomer = new Project.SQL.Customer()
        {
            FirstName  = customer.FirstName,
            LastName   = customer.LastName,
            CustomerId = customer.CustomerID
        };
        _DBcontext.Add(Newcustomer);

        return(true);
    }