예제 #1
0
 public static void EditPlan(PlanEntity detail)
 {
     using (fitnessEntities dbe = new DAL.fitnessEntities())
     {
         plan plan = dbe.plans.Find(detail.plan_id);
         plan.plan_name        = detail.plan_name;
         plan.plan_cost        = detail.plan_cost;
         plan.plan_period      = detail.plan_period;
         dbe.Entry(plan).State = System.Data.Entity.EntityState.Modified;
         dbe.SaveChanges();
     }
 }
예제 #2
0
        public static void SaveAdmin(AdminEntity detail)
        {
            using (fitnessEntities dbe = new DAL.fitnessEntities())
            {
                admin admin = new DAL.admin();
                admin.admin_id       = detail.admin_id;
                admin.admin_fullname = detail.admin_fullname;
                admin.admin_username = detail.admin_username;
                admin.admin_password = detail.admin_password;

                dbe.admins.Add(admin);
                dbe.SaveChanges();
            }
        }
예제 #3
0
        public static void EditAdmin(AdminEntity detail)
        {
            using (fitnessEntities dbe = new DAL.fitnessEntities())
            {
                admin admin = dbe.admins.Find(detail.admin_id);
                admin.admin_fullname = detail.admin_fullname;
                admin.admin_username = detail.admin_username;
                admin.admin_password = detail.admin_password;


                dbe.Entry(admin).State = System.Data.Entity.EntityState.Modified;
                dbe.SaveChanges();
            }
        }
예제 #4
0
        public static void Saveplan(PlanEntity detail)
        {
            using (fitnessEntities dbe = new DAL.fitnessEntities())
            {
                plan plan = new DAL.plan();
                plan.plan_id     = detail.plan_id;
                plan.plan_name   = detail.plan_name;
                plan.plan_cost   = detail.plan_cost;
                plan.plan_period = detail.plan_period;


                dbe.plans.Add(plan);
                dbe.SaveChanges();
            }
        }
예제 #5
0
        public static void SaveTrainer(TrainerEntity detail)
        {
            using (fitnessEntities dbe = new DAL.fitnessEntities())
            {
                trainer trainer = new DAL.trainer();
                trainer.trainer_id      = detail.trainer_id;
                trainer.trainer_name    = detail.trainer_name;
                trainer.trainer_contact = detail.trainer_contact;
                trainer.trainer_address = detail.trainer_address;
                trainer.trainer_photo   = detail.trainer_photo;


                dbe.trainers.Add(trainer);
                dbe.SaveChanges();
            }
        }
예제 #6
0
        public static void EditTrainer(TrainerEntity detail)
        {
            using (fitnessEntities dbe = new DAL.fitnessEntities())
            {
                trainer trainer = dbe.trainers.Find(detail.trainer_id);
                trainer.trainer_name    = detail.trainer_name;
                trainer.trainer_contact = detail.trainer_contact;
                trainer.trainer_address = detail.trainer_address;
                //    trainer.trainer_photo = detail.trainer_photo;



                //    dbe.Entry(trainer).State = System.Data.Entity.EntityState.Modified;
                dbe.SaveChanges();
            }
        }
예제 #7
0
        public static void SaveEquipment(EquipmentEntity detail)
        {
            using (fitnessEntities dbe = new DAL.fitnessEntities())
            {
                equipment equipment = new DAL.equipment();
                equipment.equipment_id       = detail.equipment_id;
                equipment.equipment_name     = detail.equipment_name;
                equipment.equipment_quantity = detail.equipment_quantity;
                equipment.equipment_cost     = detail.equipment_cost;
                equipment.equipment_photo    = detail.equipment_photo;


                dbe.equipments.Add(equipment);
                dbe.SaveChanges();
            }
        }
예제 #8
0
        public static void EditEquipment(EquipmentEntity detail)
        {
            using (fitnessEntities dbe = new DAL.fitnessEntities())
            {
                equipment equipment = dbe.equipments.Find(detail.equipment_id);
                equipment.equipment_name     = detail.equipment_name;
                equipment.equipment_quantity = detail.equipment_quantity;
                equipment.equipment_cost     = detail.equipment_cost;
                //    equipment.equipment_photo = detail.equipment_photo;



                //    dbe.Entry(equipment).State = System.Data.Entity.EntityState.Modified;
                dbe.SaveChanges();
            }
        }
예제 #9
0
        public static void EditCustomer(CustomerEntity detail)
        {
            using (fitnessEntities dbe = new DAL.fitnessEntities())
            {
                customer customer = dbe.customers.Find(detail.customer_id);
                customer.customer_fullname = detail.customer_fullname;
                customer.customer_address  = detail.customer_address;
                customer.customer_phone    = detail.customer_phone;
                customer.customer_photo    = detail.customer_photo;
                customer.customer_gender   = detail.customer_gender;
                customer.customer_joindate = detail.customer_joindate;
                customer.trainer_id        = detail.trainer_id;
                customer.plan_id           = detail.plan_id;
                customer.customer_username = detail.customer_username;
                customer.customer_password = detail.customer_password;



                dbe.Entry(customer).State = System.Data.Entity.EntityState.Modified;
                dbe.SaveChanges();
            }
        }
예제 #10
0
        public static void SaveCustomer(CustomerEntity detail)
        {
            using (fitnessEntities dbe = new DAL.fitnessEntities())
            {
                customer customer = new DAL.customer();
                customer.customer_id       = detail.customer_id;
                customer.customer_fullname = detail.customer_fullname;
                customer.customer_address  = detail.customer_address;
                customer.customer_phone    = detail.customer_phone;
                customer.customer_photo    = detail.customer_photo;
                customer.customer_gender   = detail.customer_gender;
                customer.customer_joindate = detail.customer_joindate;
                customer.trainer_id        = detail.trainer_id;
                customer.plan_id           = detail.plan_id;
                customer.customer_username = detail.customer_username;
                customer.customer_password = detail.customer_password;



                dbe.customers.Add(customer);
                dbe.SaveChanges();
            }
        }