Example #1
0
        public void UpdateCustomer(Models.Customer model)
        {
            using (LoyaltyPointSystemEntities db = new LoyaltyPointSystemEntities())
            {
                var cus = db.Customers.ToList().FirstOrDefault(x => x.ID == model.ID);

                cus.ID             = model.ID;
                cus.Loyalty_Points = model.Loyalty_Points;

                db.SaveChanges();
            }
        }
Example #2
0
        public void CreateRole(Models.EmployeeRole model)
        {
            using (LoyaltyPointSystemEntities db = new LoyaltyPointSystemEntities())
            {
                Models.EmployeeRole role = new Models.EmployeeRole();


                role.RoleName = model.RoleName;
                db.EmployeeRoles.Add(role);
                db.SaveChanges();
            }
        }
Example #3
0
        public void CreateCustomer(Models.Customer model)
        {
            using (LoyaltyPointSystemEntities db = new LoyaltyPointSystemEntities())
            {
                Models.Customer cus = new Models.Customer();

                cus.Cell_No        = model.Cell_No;
                cus.DateCreated    = model.DateCreated;
                cus.Email          = model.Email;
                cus.GenderID       = model.GenderID;
                cus.ID_No          = model.ID_No;
                cus.Loyalty_Points = model.Loyalty_Points;
                cus.Name           = model.Name;
                cus.Surname        = model.Surname;

                db.Customers.Add(cus);
                db.SaveChanges();
            }
        }
Example #4
0
        public void CreateEmployee(Models.Employee model)
        {
            using (LoyaltyPointSystemEntities db = new LoyaltyPointSystemEntities())
            {
                Models.Employee emp = new Models.Employee();

                emp.Employee_No = model.Employee_No;
                emp.GenderID    = model.GenderID;
                emp.ID_No       = model.ID_No;
                emp.Name        = model.Name;
                emp.Surname     = model.Surname;
                emp.Password    = model.Password;
                emp.RoleID      = model.RoleID;
                emp.Username    = model.Username;
                emp.Email       = model.Email;
                emp.CellPhone   = model.CellPhone;
                emp.ClubName    = model.ClubName;
                emp.IsDeleted   = false;

                db.Employees.Add(emp);
                db.SaveChanges();
            }
        }