private void clientes(QR_Model context) { var UserManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(new ApplicationDbContext())); var cliente = UserManager.FindByName("*****@*****.**"); Direccion direccion1 = context.Direccions.Find(3); Estado_Cliente estado = context.Estado_Clientes.Where(e => e.Descripcion == "Activo").FirstOrDefault(); Tipo_Identificacion tipo = context.Tipo_Identificacions.Where(e => e.Descripcion == "Cédula").FirstOrDefault(); context.Clientes.AddRange( new List <Cliente>() { new Cliente() { Identificacion = "00122233312", Nombre = "Pedro", Apellido = "Almánzar", Fecha_Ingreso = new DateTime(2021, 2, 22), Telefono = "8091112233", UserNameID = cliente.Id, Email = cliente.Email, Direccion = direccion1, Estado_Cliente = estado, Tipo_Identificacion = tipo, } } ); }
private void empleados(QR_Model context) { var UserManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(new ApplicationDbContext())); var admin = UserManager.FindByName("*****@*****.**"); var empleado = UserManager.FindByName("*****@*****.**"); Direccion direccion1 = context.Direccions.Find(1); Direccion direccion2 = context.Direccions.Find(2); Estado_Cliente estado = context.Estado_Clientes.Where(e => e.Descripcion == "Activo").FirstOrDefault(); Tipo_Identificacion tipo = context.Tipo_Identificacions.Where(e => e.Descripcion == "Cédula").FirstOrDefault(); Sucursal sucursal1 = context.Sucursals.Where(e => e.Nombre == "Arroyo Hondo").FirstOrDefault(); Sucursal sucursal2 = context.Sucursals.Where(e => e.Nombre == "Villa Consuelo").FirstOrDefault(); Departamento departamento1 = context.Departamentos.Where(e => e.Nombre == "Soporte técnico").FirstOrDefault(); Departamento departamento2 = context.Departamentos.Where(e => e.Nombre == "Ventas").FirstOrDefault(); context.Empleados.AddRange( new List <Empleado>() { new Empleado() { Identificacion = "40200390074", Nombre = "Manuel", Apellido = "López", Fecha_Ingreso = new DateTime(2020, 8, 15), Telefono = "8297441345", UserNameID = admin.Id, Email = admin.Email, Direccion = direccion1, Estado_Cliente = estado, Tipo_Identificacion = tipo, Departamento = departamento1, Sucursal = sucursal1 }, new Empleado() { Identificacion = "55544433322", Nombre = "Benjamín", Apellido = "Ortiz", Fecha_Ingreso = new DateTime(2021, 3, 5), Telefono = "8091112233", UserNameID = empleado.Id, Email = empleado.Email, Direccion = direccion2, Estado_Cliente = estado, Tipo_Identificacion = tipo, Departamento = departamento2, Sucursal = sucursal2 } } ); }