예제 #1
0
        public tblCustomer DeleteCustomer(int customerid)
        {
            tblCustomer c1 = db.tblCustomers.Single(x => x.CustomerId == customerid);

            db.tblCustomers.Remove(c1);
            db.SaveChanges();
            return(c1);
        }
예제 #2
0
        public tblCustomer EditCustomer(int customerid, string customername, string address, int employeeid)
        {
            tblCustomer c1 = db.tblCustomers.Single(x => x.CustomerId == customerid);

            c1.CustorName = customername;
            c1.Address    = address;
            c1.EmployeeId = employeeid;
            db.SaveChanges();
            return(c1);
        }
예제 #3
0
        public tblCustomer AddCustomer(int customerid, string customername, string address, int employeeid)
        {
            tblCustomer c1 = new tblCustomer();

            c1.CustomerId = customerid;
            c1.CustorName = customername;
            c1.Address    = address;
            c1.EmployeeId = employeeid;
            db.tblCustomers.Add(c1);
            db.SaveChanges();
            return(c1);
        }