public SWPGenericControl(IGraficador graficadorConsultas) : base() { _documento = new Documento(); escritorio = new Escritorio(_documento, graficadorConsultas); escritorio.ActualizarPresentacion += new EventHandler(contpresentacion_ActualizarPresentacion); escritorio.Dimensiones = new TamBloque(new Medicion(50, Unidad.Milimetros), new Medicion(50, Unidad.Milimetros)); }
public async Task <ActionResult> PostMensagem(Guid codigo, AdicionarNovaMensagemCommand command) { var escritorio = new Escritorio(codigo, string.Empty); _servicoUsuarios.AtualizarComoUsuarioSistema(escritorio); command.CodigoEscritorio = codigo; return(RespostaCasoDeUso(await _mediator.Send(command))); }
public void AtualizarUsuario(Usuario usuario, Escritorio escritorio) { if (UsuarioAtual != null || usuario == null || EscritorioAtual != null || escritorio == null) { throw new ArgumentException("Não é possível atualizar o usuário atual"); } UsuarioAtual = usuario; EscritorioAtual = escritorio; }
private void button1_Click(object sender, EventArgs e) { DatosUsuario.nombreRol = comboBox1.SelectedItem.ToString(); string comando = "select ID_Rol from THE_GRID.Rol " + "where Nombre = '" + comboBox1.SelectedItem.ToString() + "'"; DataRow resultado = TG.realizarConsulta(comando).Rows[0]; DatosUsuario.codigoRol = resultado["ID_Rol"].ToString(); FrbaCommerce.Escritorio desk = new Escritorio(this); desk.Show(); this.Visible = false; }
static void Main(string[] args) { Bitmap bmp = new Bitmap(100, 100, System.Drawing.Imaging.PixelFormat.Format24bppRgb); Escritorio g = new Escritorio(new Documento(), new GraficadorGDI(Graphics.FromImage(bmp))); SWPEditor.Tests.PruebaTexto p = new SWPEditor.Tests.PruebaTexto(); p.ProbarFormato(); p.ProbarInsercion(); p.ProbarEliminacion(); PruebaBloques t = new PruebaBloques(); t.ProbarBloques(); }
public ProcessoRepositorio(Contexto contexto) { _contexto = contexto; _escritorios = new List <Escritorio>(); _processos = new List <Processo>(); // Carga de dados Escritorio e1 = new Escritorio(); e1.Id = 1; e1.Nome = "Escritório I"; _escritorios.Add(e1); Escritorio e2 = new Escritorio(); e2.Id = 2; e2.Nome = "Escritório II"; _escritorios.Add(e2); Escritorio e3 = new Escritorio(); e3.Id = 3; e3.Nome = "Escritório III"; _escritorios.Add(e3); Processo p1 = new Processo(); p1.Id = 1; p1.Numero = "011111111111111111"; p1.DataCriacao = new DateTime(2019, 1, 1); p1.Valor = 1000M; p1.EscritorioId = 1; p1.Escritorio = e1; _processos.Add(p1); Processo p2 = new Processo(); p2.Id = 2; p2.Numero = "022222222222222222"; p2.DataCriacao = new DateTime(2018, 1, 10); p2.Valor = 1500M; p2.EscritorioId = 2; p2.Escritorio = e2; _processos.Add(p2); Processo p3 = new Processo(); p3.Id = 3; p3.Numero = "033333333333333333"; p3.DataCriacao = new DateTime(2017, 12, 7); p3.Valor = 2000M; p3.EscritorioId = 3; p3.Escritorio = e3; _processos.Add(p3); Processo p4 = new Processo(); p4.Id = 4; p4.Numero = "044444444444444444"; p4.DataCriacao = new DateTime(2016, 5, 31); p4.Valor = 1700M; p4.EscritorioId = 3; p4.Escritorio = e3; _processos.Add(p4); Processo p5 = new Processo(); p5.Id = 5; p5.Numero = "055555555555555555"; p5.DataCriacao = new DateTime(2015, 3, 1); p5.Valor = 2000M; p5.EscritorioId = 3; p5.Escritorio = e3; _processos.Add(p5); }
public void OnActionExecuting(ActionExecutingContext context) { var claims = context.HttpContext.User; if (!claims.Claims.Any()) { return; } var usuario = new Usuario( Guid.Parse(claims.FindFirst("user_id").Value), claims.FindFirst("user_first_name").Value, claims.FindFirst("user_last_name").Value ); var escritorio = new Escritorio( Guid.Parse(claims.FindFirst("office_id").Value), claims.FindFirst("office_name").Value ); _provedor.AtualizarUsuario(usuario, escritorio); }
public static void Inicializador(Contexto contexto) { contexto.Database.EnsureCreated(); Console.Write("Entrou"); if (contexto.Estudantes.Any()) { Console.WriteLine("Saiu"); return; // O banco esta populado } var estudantes = new Estudante[] { new Estudante { Nome = "Carson", Sobrenome = "Alexander", EnrollmentDate = DateTime.Parse("2010-09-01") }, new Estudante { Nome = "Meredith", Sobrenome = "Alonso", EnrollmentDate = DateTime.Parse("2012-09-01") }, new Estudante { Nome = "Arturo", Sobrenome = "Anand", EnrollmentDate = DateTime.Parse("2013-09-01") }, new Estudante { Nome = "Gytis", Sobrenome = "Barzdukas", EnrollmentDate = DateTime.Parse("2012-09-01") }, new Estudante { Nome = "Yan", Sobrenome = "Li", EnrollmentDate = DateTime.Parse("2012-09-01") }, new Estudante { Nome = "Peggy", Sobrenome = "Justice", EnrollmentDate = DateTime.Parse("2011-09-01") }, new Estudante { Nome = "Laura", Sobrenome = "Norman", EnrollmentDate = DateTime.Parse("2013-09-01") }, new Estudante { Nome = "Nino", Sobrenome = "Olivetto", EnrollmentDate = DateTime.Parse("2005-09-01") } }; foreach (var estudante in estudantes) { contexto.Estudantes.Add(estudante); } contexto.SaveChanges(); var instrutores = new Instrutor[] { new Instrutor { Nome = "Kim", Sobrenome = "Abercrombie", DataContratacao = DateTime.Parse("1995-03-11") }, new Instrutor { Nome = "Fadi", Sobrenome = "Fakhouri", DataContratacao = DateTime.Parse("2002-07-06") }, new Instrutor { Nome = "Roger", Sobrenome = "Harui", DataContratacao = DateTime.Parse("1998-07-01") }, new Instrutor { Nome = "Candace", Sobrenome = "Kapoor", DataContratacao = DateTime.Parse("2001-01-15") }, new Instrutor { Nome = "Roger", Sobrenome = "Zheng", DataContratacao = DateTime.Parse("2004-02-12") } }; foreach (Instrutor i in instrutores) { contexto.Instrutores.Add(i); } contexto.SaveChanges(); var departments = new Departamento[] { new Departamento { Nome = "English", Orcamento = 350000, DataInicio = DateTime.Parse("2007-09-01"), InstrutorId = instrutores.Single(i => i.Sobrenome == "Abercrombie").Id }, new Departamento { Nome = "Mathematics", Orcamento = 100000, DataInicio = DateTime.Parse("2007-09-01"), InstrutorId = instrutores.Single(i => i.Sobrenome == "Fakhouri").Id }, new Departamento { Nome = "Engineering", Orcamento = 350000, DataInicio = DateTime.Parse("2007-09-01"), InstrutorId = instrutores.Single(i => i.Sobrenome == "Harui").Id }, new Departamento { Nome = "Economics", Orcamento = 100000, DataInicio = DateTime.Parse("2007-09-01"), InstrutorId = instrutores.Single(i => i.Sobrenome == "Kapoor").Id } }; foreach (Departamento d in departments) { contexto.Departamentos.Add(d); } contexto.SaveChanges(); var courses = new Curso[] { new Curso { CursoId = 1050, Titulo = "Chemistry", Creditos = 3, DepartamentoId = departments.Single(s => s.Nome == "Engineering").DepartamentoId }, new Curso { CursoId = 4022, Titulo = "Microeconomics", Creditos = 3, DepartamentoId = departments.Single(s => s.Nome == "Economics").DepartamentoId }, new Curso { CursoId = 4041, Titulo = "Macroeconomics", Creditos = 3, DepartamentoId = departments.Single(s => s.Nome == "Economics").DepartamentoId }, new Curso { CursoId = 1045, Titulo = "Calculus", Creditos = 4, DepartamentoId = departments.Single(s => s.Nome == "Mathematics").DepartamentoId }, new Curso { CursoId = 3141, Titulo = "Trigonometry", Creditos = 4, DepartamentoId = departments.Single(s => s.Nome == "Mathematics").DepartamentoId }, new Curso { CursoId = 2021, Titulo = "Composition", Creditos = 3, DepartamentoId = departments.Single(s => s.Nome == "English").DepartamentoId }, new Curso { CursoId = 2042, Titulo = "Literature", Creditos = 4, DepartamentoId = departments.Single(s => s.Nome == "English").DepartamentoId }, }; foreach (Curso c in courses) { contexto.Cursos.Add(c); } contexto.SaveChanges(); var officeAssignments = new Escritorio[] { new Escritorio { InstrutorId = instrutores.Single(i => i.Sobrenome == "Fakhouri").Id, Localizacao = "Smith 17" }, new Escritorio { InstrutorId = instrutores.Single(i => i.Sobrenome == "Harui").Id, Localizacao = "Gowan 27" }, new Escritorio { InstrutorId = instrutores.Single(i => i.Sobrenome == "Kapoor").Id, Localizacao = "Thompson 304" }, }; foreach (Escritorio o in officeAssignments) { contexto.Escritorios.Add(o); } contexto.SaveChanges(); var courseInstructors = new CursoInstrutor[] { new CursoInstrutor { CursoId = courses.Single(c => c.Titulo == "Chemistry").CursoId, InstrutorId = instrutores.Single(i => i.Sobrenome == "Kapoor").Id }, new CursoInstrutor { CursoId = courses.Single(c => c.Titulo == "Chemistry").CursoId, InstrutorId = instrutores.Single(i => i.Sobrenome == "Harui").Id }, new CursoInstrutor { CursoId = courses.Single(c => c.Titulo == "Microeconomics").CursoId, InstrutorId = instrutores.Single(i => i.Sobrenome == "Zheng").Id }, new CursoInstrutor { CursoId = courses.Single(c => c.Titulo == "Macroeconomics").CursoId, InstrutorId = instrutores.Single(i => i.Sobrenome == "Zheng").Id }, new CursoInstrutor { CursoId = courses.Single(c => c.Titulo == "Calculus").CursoId, InstrutorId = instrutores.Single(i => i.Sobrenome == "Fakhouri").Id }, new CursoInstrutor { CursoId = courses.Single(c => c.Titulo == "Trigonometry").CursoId, InstrutorId = instrutores.Single(i => i.Sobrenome == "Harui").Id }, new CursoInstrutor { CursoId = courses.Single(c => c.Titulo == "Composition").CursoId, InstrutorId = instrutores.Single(i => i.Sobrenome == "Abercrombie").Id }, new CursoInstrutor { CursoId = courses.Single(c => c.Titulo == "Literature").CursoId, InstrutorId = instrutores.Single(i => i.Sobrenome == "Abercrombie").Id }, }; foreach (CursoInstrutor ci in courseInstructors) { contexto.CursoInstrutores.Add(ci); } contexto.SaveChanges(); var enrollments = new CursoEstudante[] { new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Alexander").Id, CursoID = courses.Single(c => c.Titulo == "Chemistry").CursoId, Grade = Grades.A }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Alexander").Id, CursoID = courses.Single(c => c.Titulo == "Microeconomics").CursoId, Grade = Grades.C }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Alexander").Id, CursoID = courses.Single(c => c.Titulo == "Macroeconomics").CursoId, Grade = Grades.B }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Alonso").Id, CursoID = courses.Single(c => c.Titulo == "Calculus").CursoId, Grade = Grades.B }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Alonso").Id, CursoID = courses.Single(c => c.Titulo == "Trigonometry").CursoId, Grade = Grades.B }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Alonso").Id, CursoID = courses.Single(c => c.Titulo == "Composition").CursoId, Grade = Grades.B }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Anand").Id, CursoID = courses.Single(c => c.Titulo == "Chemistry").CursoId }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Anand").Id, CursoID = courses.Single(c => c.Titulo == "Microeconomics").CursoId, Grade = Grades.B }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Barzdukas").Id, CursoID = courses.Single(c => c.Titulo == "Chemistry").CursoId, Grade = Grades.B }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Li").Id, CursoID = courses.Single(c => c.Titulo == "Composition").CursoId, Grade = Grades.B }, new CursoEstudante { EstudanteId = estudantes.Single(s => s.Sobrenome == "Justice").Id, CursoID = courses.Single(c => c.Titulo == "Literature").CursoId, Grade = Grades.B } }; foreach (CursoEstudante e in enrollments) { var enrollmentInDataBase = contexto.CursoEstudantes.Where( s => s.Estudante.Id == e.EstudanteId && s.Curso.CursoId == e.CursoID).SingleOrDefault(); if (enrollmentInDataBase == null) { contexto.CursoEstudantes.Add(e); } } contexto.SaveChanges(); }
public void AtualizarComoUsuarioSistema(Escritorio escritorio = null, Usuario usuario = null) { escritorio ??= new Escritorio(Guid.Empty, "Jurify"); usuario ??= new Usuario(Guid.Empty, "Aplicação", "CRM"); AtualizarUsuario(usuario, escritorio); }
public static void Initialize(IServiceProvider serviceProvider) { using (var context = new WebEscolaContext( serviceProvider.GetRequiredService < DbContextOptions <WebEscolaContext> >())) { context.Database.EnsureCreated(); if (context.Aluno.Any()) { return; } var alunos = new Aluno[] { new Aluno { Nome = "Alberto", Sobrenome = "Almeida", Data = DateTime.Parse("1970-09-21") }, new Aluno { Nome = "Marcelo", Sobrenome = "Barros", Data = DateTime.Parse("2001-04-07") }, new Aluno { Nome = "Henrique", Sobrenome = "Carvalho", Data = DateTime.Parse("1994-12-10") }, new Aluno { Nome = "Daniel", Sobrenome = "Freitas", Data = DateTime.Parse("1974-02-01") }, new Aluno { Nome = "Fábio", Sobrenome = "Henrique", Data = DateTime.Parse("1978-07-10") }, new Aluno { Nome = "Fernanda", Sobrenome = "Machado", Data = DateTime.Parse("1994-12-15") }, new Aluno { Nome = "Cristina", Sobrenome = "Miranda", Data = DateTime.Parse("2003-09-01") }, new Aluno { Nome = "Roberto", Sobrenome = "Santos", Data = DateTime.Parse("1998-03-17") } }; foreach (Aluno a in alunos) { context.Aluno.Add(a); } context.SaveChanges(); var instrutores = new Instrutor[] { new Instrutor { Nome = "João", Sobrenome = "Miguel", Contratacao = DateTime.Parse("2015-02-5") }, new Instrutor { Nome = "Maria", Sobrenome = "Cecilia", Contratacao = DateTime.Parse("2017-03-10") }, new Instrutor { Nome = "Ana", Sobrenome = "Julia", Contratacao = DateTime.Parse("2013-4-15") }, new Instrutor { Nome = "Davi", Sobrenome = "Lucas", Contratacao = DateTime.Parse("2019-05-20") }, new Instrutor { Nome = "Laura", Sobrenome = "Neves", Contratacao = DateTime.Parse("2020-01-25") } }; foreach (Instrutor i in instrutores) { context.Instrutor.Add(i); } context.SaveChanges(); var departamentos = new Departamento[] { new Departamento { Nome = "Treinamento", Orcamento = 100000, Inicio = DateTime.Parse("1993-09-25"), InstrutorID = instrutores.Single(i => i.Sobrenome == "Julia").InstrutorID }, new Departamento { Nome = "Desenvolvimento", Orcamento = 250000, Inicio = DateTime.Parse("1993-09-25"), InstrutorID = instrutores.Single(i => i.Sobrenome == "Neves").InstrutorID }, new Departamento { Nome = "Consultoria", Orcamento = 50000, Inicio = DateTime.Parse("1993-09-25"), InstrutorID = instrutores.Single(i => i.Sobrenome == "Lucas").InstrutorID } }; foreach (Departamento d in departamentos) { context.Departamento.Add(d); } context.SaveChanges(); var cursos = new Curso[] { new Curso { Titulo = "Blazor Avançado", Credito = 4, DepartamentoID = departamentos.Single(s => s.Nome == "Consultoria").DepartamentoID }, new Curso { Titulo = "Blazor", Credito = 3, DepartamentoID = departamentos.Single(s => s.Nome == "Consultoria").DepartamentoID }, new Curso { Titulo = "ASP NET Core - API e SignalR", Credito = 4, DepartamentoID = departamentos.Single(s => s.Nome == "Consultoria").DepartamentoID }, new Curso { Titulo = "ASP NET Core MVC Avançado", Credito = 4, DepartamentoID = departamentos.Single(s => s.Nome == "Desenvolvimento").DepartamentoID }, new Curso { Titulo = "ASP NET Core MVC", Credito = 3, DepartamentoID = departamentos.Single(s => s.Nome == "Treinamento").DepartamentoID }, new Curso { Titulo = "ASP NET Core", Credito = 2, DepartamentoID = departamentos.Single(s => s.Nome == "Treinamento").DepartamentoID }, new Curso { Titulo = "C# básico", Credito = 1, DepartamentoID = departamentos.Single(s => s.Nome == "Treinamento").DepartamentoID } }; foreach (Curso c in cursos) { context.Curso.Add(c); } context.SaveChanges(); var escritorios = new Escritorio[] { new Escritorio { InstrutorID = instrutores.Single(i => i.Sobrenome == "Julia").InstrutorID, Localizacao = "Paulista" }, new Escritorio { InstrutorID = instrutores.Single(i => i.Sobrenome == "Neves").InstrutorID, Localizacao = "Berrini" }, new Escritorio { InstrutorID = instrutores.Single(i => i.Sobrenome == "Lucas").InstrutorID, Localizacao = "Faria Lima" } }; foreach (Escritorio e in escritorios) { context.Escritorio.Add(e); } context.SaveChanges(); var cursosInstrutor = new CursoInstrutor[] { new CursoInstrutor { InstrutorID = instrutores.Single(i => i.Sobrenome == "Miguel").InstrutorID, CursoID = cursos.Single(i => i.Titulo == "C# básico").CursoID }, new CursoInstrutor { InstrutorID = instrutores.Single(i => i.Sobrenome == "Cecilia").InstrutorID, CursoID = cursos.Single(i => i.Titulo == "ASP NET Core").CursoID }, new CursoInstrutor { InstrutorID = instrutores.Single(i => i.Sobrenome == "Cecilia").InstrutorID, CursoID = cursos.Single(i => i.Titulo == "ASP NET Core MVC").CursoID }, new CursoInstrutor { InstrutorID = instrutores.Single(i => i.Sobrenome == "Cecilia").InstrutorID, CursoID = cursos.Single(i => i.Titulo == "ASP NET Core MVC Avançado").CursoID }, new CursoInstrutor { InstrutorID = instrutores.Single(i => i.Sobrenome == "Julia").InstrutorID, CursoID = cursos.Single(i => i.Titulo == "ASP NET Core - API e SignalR").CursoID }, new CursoInstrutor { InstrutorID = instrutores.Single(i => i.Sobrenome == "Lucas").InstrutorID, CursoID = cursos.Single(i => i.Titulo == "Blazor").CursoID }, new CursoInstrutor { InstrutorID = instrutores.Single(i => i.Sobrenome == "Lucas").InstrutorID, CursoID = cursos.Single(i => i.Titulo == "Blazor Avançado").CursoID } }; foreach (CursoInstrutor ci in cursosInstrutor) { context.CursoInstrutor.Add(ci); } context.SaveChanges(); var matriculas = new Matricula[] { new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Almeida").AlunoID, CursoID = cursos.Single(c => c.Titulo == "C# básico").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Almeida").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Almeida").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core MVC").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Barros").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Barros").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core MVC").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Barros").AlunoID, CursoID = cursos.Single(c => c.Titulo == "Blazor").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Carvalho").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Carvalho").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core MVC").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Carvalho").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core MVC Avançado").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Carvalho").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core - API e SignalR").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Freitas").AlunoID, CursoID = cursos.Single(c => c.Titulo == "Blazor").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Freitas").AlunoID, CursoID = cursos.Single(c => c.Titulo == "Blazor Avançado").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Henrique").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core MVC").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Machado").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core MVC Avançado").CursoID }, new Matricula { AlunoID = alunos.Single(i => i.Sobrenome == "Miranda").AlunoID, CursoID = cursos.Single(c => c.Titulo == "ASP NET Core").CursoID }, }; foreach (Matricula m in matriculas) { context.Matricula.Add(m); } context.SaveChanges(); } }
public void EscritorioAdd(Escritorio itens) { _repositorio.Add(itens); }
public void EscritorioUpdate(Escritorio itens) { _repositorio.Update(itens); }