Ejemplo n.º 1
0
        public void Modificar(Personas personas)
        {
            using (ClientEntities DB = new ClientEntities())
            {
                Client_Table client = DB.Client_Table.Where(x => x.Client_Id == profile_.id_profile).First();

                client.Name      = personas.Nombre;
                client.LastName  = personas.Apellido;
                client.Birthday  = personas.nacimiento;
                client.ProfileID = profile_.id_profile;



                DB.Entry(client).State = System.Data.Entity.EntityState.Modified;
                DB.SaveChanges();

                Profile_Table profile = DB.Profile_Table.Find(profile_.id_profile);
                {
                    profile.Profiel_Description = personas.Description;
                    profile.Profiel_Name        = personas.Description;
                };
                DB.Entry(profile).State = System.Data.Entity.EntityState.Modified;
                DB.SaveChanges();
            };
        }
Ejemplo n.º 2
0
        public void agregar_profile(Personas personas)
        {
            using (ClientEntities DB = new ClientEntities())
            {
                Profile_Table profile = new Profile_Table();

                profile.Profiel_Name        = personas.profile;
                profile.Profiel_Description = personas.Description;
                DB.Profile_Table.Add(profile);
                DB.SaveChanges();

                Profile_Table listado = DB.Profile_Table.Where(x => x.Profiel_Description == personas.Description).First();

                profile_.id_profile = listado.Id_Profiel;

                Action <Personas> action = agregar_client;
                action(personas);
            }
        }