예제 #1
0
        public static void DeleteCustomerInfoFromId(int id)
        {
            using (var db = new MVPOnBoardAPIContext())
            {
                //var getSales = db.Sales.Where(record => record.CustomerId == id).ToArray();

                //foreach (var item in getSales)
                //{
                //    item.CustomerId = 0;
                //}
                //db.SaveChanges();
                _ = db.Customers.Remove(CustomerDAL.GetCustomerFromId(id));
                db.SaveChanges();
            }
        }
예제 #2
0
 public void Create(Customers customer)
 {
     CustomerDAL.CreateCustomerInfo(customer);
 }
예제 #3
0
 public void Update(Customers customer)
 {
     CustomerDAL.UpdateCustomerInfoFromId(customer);
 }
예제 #4
0
 public void Delete(int id)
 {
     CustomerDAL.DeleteCustomerInfoFromId(id);
 }
예제 #5
0
 public Customers Edit(int id)
 {
     return(CustomerDAL.GetCustomerFromId(id));
 }
예제 #6
0
        public IEnumerable <Customers> Index()
        {
            var tempList = CustomerDAL.GetAllCustomers();

            return(tempList);
        }