public JsonResult GrupoObjeto_Excluir(int gro_id) { int retorno = new GrupoBLL().GrupoObjeto_Excluir(gro_id); bool valid = retorno >= 0; return(Json(new { status = valid, erroId = retorno }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Metodo que permite insertar un Grupo. /// </summary> protected void InsertarGrupo() { GrupoBLL objGrupoBLL = new GrupoBLL(); objGrupoBLL.InsertarGrupo(txtNombreGrupo.Text.Trim()); gvGrupo.DataBind(); }
public JsonResult Grupo_AtivarDesativar(int id) { int retorno = new GrupoBLL().Grupo_AtivarDesativar(id); bool valid = retorno >= 0; return(Json(new { status = valid, erroId = retorno }, JsonRequestBehavior.AllowGet)); }
private void AgregaGrupo(object sender, RoutedEventArgs e) { if (Utilidades.Validar(txtNom) && !string.IsNullOrEmpty(cbCar1.Text)) { GrupoBLL grupos = new GrupoBLL(); //var x = (Curso)cbCurso.SelectedValue; grup = new Grupo() { Nombre = txtNom.Text, Carrera = cbCar1.Text, IDCurso = 1 }; if (grupos.Agregar(grup) != -1) { MessageBox.Show(this, "Grupo Agregado, OK ", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Information); this.cargaCombos(); Utilidades.Limpiar(txtNom); } else MessageBox.Show(this,"Se produjo un Error, Fail", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Information); } else MessageBox.Show(this,"No debe haber campos vacios", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Information); }
private void LlenandoCombo() { Es = new Estudiantes(); EstudiantecomboBox.DataSource = GrupoBLL.GetLista(); EstudiantecomboBox.ValueMember = "EstudianteId"; EstudiantecomboBox.DisplayMember = "Nombres"; }
public JsonResult GrupoObjeto_Incluir(int gru_id = 0, string obj_ids = "") { int retorno = new GrupoBLL().GrupoObjeto_Incluir(gru_id, obj_ids); bool valid = retorno >= 0; return(Json(new { status = valid, erroId = retorno }, JsonRequestBehavior.AllowGet)); }
public static List <Equipos> TraerEquipos(int idGrupo) { Grupo objGrupo = GrupoBLL.SelectById(idGrupo); int idEvento = objGrupo.IdEvento; List <Equipos> objEquipo = EquipoBLL.SelectByEvento(idEvento); return(objEquipo); }
private void Guardarbutton_Click(object sender, EventArgs e) { Grupos grupito = new Grupos(); LlenarClase(grupito); GrupoBLL.Guardar(grupito); MessageBox.Show("Guardado"); }
private void Pasar(Grupos gr) { var g = GrupoBLL.Buscar(u.StringToInt(IdtextBox.Text)); IdtextBox.Text = gr.GrupoId.ToString(); NombreGrupotextBox.Text = gr.Nombre; dataGridView1.DataSource = null; dataGridView1.DataSource = gr.Estudiante; }
private void Llenar(Grupos grups) { var grup = GrupoBLL.Buscar(u.StringToInt(IdtextBox.Text)); IdtextBox.Text = grups.GrupoId.ToString(); NombreGrupotextBox.Text = grups.Nombre; dataGridView1.DataSource = null; dataGridView1.DataSource = grup.GrupoId; }
private void Buscarbutton_Click(object sender, EventArgs e) { GrupoBLL.Buscar(Convert.ToInt32(IdtextBox.Text)); if (grupo != null) { NombreGrupotextBox.Text = grupo.Nombre; } //IdtextBox.Text = ""; }
private void cargaCombos() { CursoBLL cursos = new CursoBLL(); CarreraBLL carreras = new CarreraBLL(); GrupoBLL grupos = new GrupoBLL(); cbCar1.ItemsSource = carreras.ObtenerAll(); //cbCurso.ItemsSource = cursos.ObtenerAll(); cbCar2.ItemsSource = carreras.ObtenerAll(); //cbCur2.ItemsSource = cursos.ObtenerAll(); cbDis.ItemsSource = grupos.ObtenerAll(); }
public static int EliminarGrupo(int idGrupo) { try { GrupoBLL.Delete(idGrupo); return(idGrupo); } catch (Exception) { return(-1); } }
public void ModificarTest() { int idGrupos = GrupoBLL.GetList(x => true)[0].GruposId; Grupos grupos = GrupoBLL.Buscar(idGrupos); grupos.Detalle.Add(new GrupoDetalle(0, grupos.GruposId, 2, 4)); bool paso = GrupoBLL.Modificar(grupos); Assert.AreEqual(true, paso); }
public void GuardarTest() { bool paso; Grupos grupos = new Grupos(); grupos.GruposId = 0; grupos.Fecha = DateTime.Now; grupos.Descripcion = "Soy yo Anthony"; grupos.Cantidad = 50; grupos.Gruposs = 5; grupos.Integrantes = 10; paso = GrupoBLL.Guardar(grupos); Assert.AreEqual(paso, true); }
public GrupoPage() { Title = "Grupos"; StackLayout listaView = new StackLayout(); listaView.VerticalOptions = LayoutOptions.Fill; listaView.HorizontalOptions = LayoutOptions.Fill; GrupoBLL regraGrupo = GrupoFactory.create(); ListView listaGrupos = new ListView(); listaGrupos.RowHeight = 120; listaGrupos.ItemTemplate = new DataTemplate(typeof(GruposCelula)); listaGrupos.ItemTapped += OnTap; listaGrupos.SetBinding(ListView.ItemsSourceProperty, new Binding(".")); listaGrupos.HasUnevenRows = true; listaGrupos.SeparatorColor = Color.Transparent; listaGrupos.VerticalOptions = LayoutOptions.Start; listaGrupos.HorizontalOptions = LayoutOptions.Center; var grupos = regraGrupo.listar(); listaGrupos.BindingContext = grupos; Image AdicionarRadarButton = new Image { Aspect = Aspect.AspectFit, Source = ImageSource.FromFile("mais.png"), WidthRequest = 180, HeightRequest = 180, VerticalOptions = LayoutOptions.End, HorizontalOptions = LayoutOptions.End, Margin = new Thickness(0, 0, 10, 10) }; AdicionarRadarButton.GestureRecognizers.Add( new TapGestureRecognizer() { Command = new Command(() => { adcionarGrupo(); } ) }); listaView.Children.Add(listaGrupos); listaView.Children.Add(AdicionarRadarButton); Content = listaView; }
private void btnEliminar_Click(object sender, EventArgs e) { Grupo item = gridView1.GetRow(gridView1.FocusedRowHandle) as Grupo; var resp = new GrupoBLL(); if (resp.Delete(item)) { XtraMessageBox.Show("Engraving done successfully", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); function(); } else { XtraMessageBox.Show(resp.error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static Grupo InsertarGrupo(string nombre, string idEvento) { Grupo objGrupoModelo = GrupoBLL.SelectCantActual(Convert.ToInt32(idEvento)); int cantidadActual = objGrupoModelo.IdEvento; Evento objEvento = EventoBLL.SelectById(Convert.ToInt32(idEvento)); int cantidadPermitida = objEvento.CantidadGrupos; if (cantidadActual < cantidadPermitida) { Grupo objGrupo = GrupoBLL.InsertWithReturn(nombre, idEvento); return(objGrupo); } else { Grupo objGrupo = new Grupo(); objGrupo.Nombre = "NO"; return(objGrupo); } }
public static GrupoEquipoCL InsertarGrupoEquipo(string idGrupo, string idEquipo) { GrupoEquipoCL objCantidad = GrupoEquipoBLL.SelectCantidadActual(Convert.ToInt32(idGrupo)); int cantidad = objCantidad.IdEquipo; int idEvento = GrupoBLL.SelectById(Convert.ToInt32(idGrupo)).IdEvento; int cantidadPermitida = EventoBLL.SelectById(idEvento).CantidadEquipos; if (cantidad <= cantidadPermitida) { GrupoEquipoCL objGrupoEquipo = GrupoEquipoBLL.InsertWithReturn(idEquipo, idGrupo); return(objGrupoEquipo); } else { GrupoEquipoCL objgrupoEquipoCL = new GrupoEquipoCL(); objgrupoEquipoCL.IdGrupo = 321456; return(objgrupoEquipoCL); } }
private void btnGrabar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtNombre.Text)) { XtraMessageBox.Show(Mensajes.CamposVacios, "Informativo", MessageBoxButtons.OK, MessageBoxIcon.Information); } var metodo = new GrupoBLL(); var Result = true; if (item == null) { if (!metodo.Grabar( new Grupo { Nombre = txtNombre.Text, Estado = (chEstado.Checked) ? "A" : "E", } )) { Result = false; } } else { item.Nombre = txtNombre.Text; item.Estado = (chEstado.Checked) ? "A" : "E"; if (!metodo.Update(item)) { Result = false; } } if (!Result) { XtraMessageBox.Show(metodo.error, "Informativo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { function(); } }
private void btnGerar_Click(object sender, EventArgs e) { try { String dataI, dataF; dataI = dtpDataInicial.Value.Year.ToString() + "/" + dtpDataInicial.Value.Day.ToString() + "/" + dtpDataInicial.Value.Month.ToString(); dataF = dtpDataFinal.Value.Year.ToString() + "/" + dtpDataFinal.Value.Day.ToString() + "/" + dtpDataFinal.Value.Month.ToString(); dataInical = dtpDataInicial.Value.Date; //DateTime.Parse(dataI); dataFinal = dtpDataFinal.Value.Date; //DateTime.Parse(dataF); if (cbMarca.SelectedIndex > -1) { marca = cbMarca.SelectedValue.ToString(); MarcasBLL objBLL = new MarcasBLL(); objBLL.localizarLeave(marca, "mar_codigo"); marca = objBLL.mar_descricao; objBLL = null; } else { marca = ""; } if (cbGrupo.SelectedIndex > -1) { grupo = cbGrupo.SelectedValue.ToString(); GrupoBLL objBLL = new GrupoBLL(); objBLL.localizarLeave(marca, "gru_codigo"); grupo = objBLL.gru_descricao; objBLL = null; } else { grupo = ""; } controle = "Gerar"; this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static void Delete(int id) { EventoDSTableAdapters.tbl_eventoTableAdapter adapter = new EventoDSTableAdapters.tbl_eventoTableAdapter(); adapter.DeleteEvento(id); NoticiaBLL.DeleteEvento(id); List <Grupo> listGrupos = GrupoBLL.SelectByEvento(id); foreach (Grupo objGrupo in listGrupos) { GrupoBLL.Delete(objGrupo.IdGrupo); GrupoEquipoBLL.DeleteByGrupo(objGrupo.IdGrupo); List <Fixture> listFixture = FixtureBLL.SelectByGrupo(objGrupo.IdGrupo + ""); foreach (Fixture objFixture in listFixture) { FixtureNoticiaBLL.DeleteByFixture(objFixture.IdFixture); } FixtureBLL.DeleteByGrupo(objGrupo.IdGrupo); } GolesBLL.DeleteByEvento(id); EquipoBLL.DeleteByEvento(id); }
public static Grupo TraerGrupo(int idGrupo) { Grupo objGrupo = GrupoBLL.SelectById(idGrupo); return(objGrupo); }
public static List <Grupo> TraerGruposEvento(string idEvento) { List <Grupo> listGrupo = GrupoBLL.SelectByEvento(Convert.ToInt32(idEvento)); return(listGrupo); }
private void EliminaGrupo(object sender, RoutedEventArgs e) { GrupoBLL grupos = new GrupoBLL(); if (grupos.Eliminar(grup)) { MessageBox.Show(this,"Grupo Eliminado, OK ", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Information); Utilidades.Limpiar(txtNom2); this.cargaCombos(); } else MessageBox.Show(this,"Se produjo un Error, Fail", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Error); }
public static List <Grupo> ListarGrupos(int idEvento) { List <Grupo> listGrupo = GrupoBLL.SelectByEvento(idEvento); return(listGrupo); }
public GruposCelula() { var excluirGrupo = new MenuItem { Text = "Excluir" }; excluirGrupo.SetBinding(MenuItem.CommandParameterProperty, new Binding(".")); excluirGrupo.Clicked += (sender, e) => { GrupoInfo grupo = (GrupoInfo)((MenuItem)sender).BindingContext; GrupoBLL regraGrupo = GrupoFactory.create(); regraGrupo.excluir(grupo.Id); ListView listaGrupos = this.Parent as ListView; listaGrupos.SetBinding(ListView.ItemsSourceProperty, new Binding(".")); listaGrupos.RowHeight = 120; var grupos = regraGrupo.listar(); listaGrupos.BindingContext = grupos; listaGrupos.ItemTemplate = new DataTemplate(typeof(GruposCelula)); }; ContextActions.Add(excluirGrupo); StackLayout main = new StackLayout(); main.BackgroundColor = Color.Transparent; main.Orientation = StackOrientation.Horizontal; main.VerticalOptions = LayoutOptions.StartAndExpand; main.HorizontalOptions = LayoutOptions.CenterAndExpand; StackLayout stackRight = new StackLayout(); stackRight.Orientation = StackOrientation.Vertical; stackRight.VerticalOptions = LayoutOptions.CenterAndExpand; stackRight.HorizontalOptions = LayoutOptions.StartAndExpand; StackLayout stackLeft = new StackLayout(); stackLeft.Orientation = StackOrientation.Vertical; stackLeft.VerticalOptions = LayoutOptions.StartAndExpand; stackLeft.HorizontalOptions = LayoutOptions.StartAndExpand; Image foto = new Image() { WidthRequest = 50, HeightRequest = 50, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, Source = "ic_add_a_photo_48pt.png" }; //foto.SetBinding(Image.SourceProperty, new Binding("Imagem")); Label nome = new Label { TextColor = Color.FromHex(TemaInfo.PrimaryText), FontFamily = "Roboto-Condensed", FontSize = 20, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.Center, }; nome.SetBinding(Label.TextProperty, new Binding("NomeStr")); Label descricao = new Label { TextColor = Color.FromHex(TemaInfo.PrimaryText), FontFamily = "Roboto-Condensed", FontSize = 20, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.Center, }; descricao.SetBinding(Label.TextProperty, new Binding("DescricaoStr")); var frameOuter = new Frame(); frameOuter.BackgroundColor = Color.FromHex(TemaInfo.BlueAccua); frameOuter.HeightRequest = AbsoluteLayout.AutoSize; if (Device.OS == TargetPlatform.iOS) { foto.WidthRequest = 60; //frameOuter.Padding = new Thickness(5, 10, 5, 10); frameOuter.WidthRequest = TelaUtils.Largura * 0.9; frameOuter.Margin = new Thickness(5, 10, 5, 0); } else { frameOuter.Margin = new Thickness(5, 10, 5, 10); } stackLeft.Children.Add(foto); stackRight.Children.Add(nome); stackRight.Children.Add(descricao); main.Children.Add(stackLeft); main.Children.Add(stackRight); frameOuter.Content = main; View = frameOuter; }
private void timer1_Tick(object sender, EventArgs e) { // 1 - Coletando Fabricantes // // - Coletando Clientes // progressBar1.Maximum = 2; label1.Text = "Coletando Dados"; Thread.Sleep(5000); if (atividade > 2) { label1.Text = "Coleta realizada com sucesso !"; label2.Text = "..."; timer1.Enabled = false; //progressBar1.Value = atividade; } if (atividade == 2) { label2.Text = "Selecionando Produtos"; progressBar1.Value = atividade; atividade++; ProdutosBLL cmd = new ProdutosBLL(); //DataTable dt = cmd.localizarComRetorno("", "pro_nome"); Contexto sqlcmd = new Contexto(); sqlcmd.Contexto_local(nome_base.Text); sqlcmd.AbreConexao(); DataTable dt = sqlcmd.ExecutaConsulta(new SqlCommand() { CommandText = "select * from produtos" }); sqlcmd.FechaConexao(); foreach (DataRow dtRow in dt.Rows) { cmd.limpar(); cmd.pro_nome = dtRow["pro_nome"].ToString(); cmd.pro_quantidade = decimal.Parse(dtRow["pro_quantidade"].ToString()); cmd.pro_precoCusto = decimal.Parse(dtRow["pro_precoCusto"].ToString()); cmd.pro_precoVenda = decimal.Parse(dtRow["pro_precoVenda"].ToString()); cmd.pro_categoria = 0; cmd.pro_grupo = 0; cmd.pro_subGrupo = 0; cmd.pro_unidade = 0; cmd.pro_estoqueMin = int.Parse(dtRow["pro_estoqueMin"].ToString()); cmd.pro_estoqueMax = 0; cmd.pro_dataCadastro = DateTime.Now; cmd.pro_codigoBarra = dtRow["pro_codigoBarra"].ToString(); cmd.pro_marca = 0; cmd.pro_fornecedor = 0; cmd.pro_tamanho = 0; cmd.pro_margem = 0; cmd.pro_comissao = 0; cmd.pro_aliquota = 0; cmd.porcentagem_tributos = 0; cmd.pro_csosn = ""; cmd.pro_cst = ""; cmd.cest = ""; cmd.pro_cst = ""; cmd.pro_imagem = null; cmd.cfop = int.Parse(dtRow["pro_cfop"].ToString()); cmd.ncm = dtRow["pro_ncm"].ToString(); cmd.inserir(); } } if (atividade == 1) { label2.Text = "Selecionando Grupos"; progressBar1.Value = atividade; atividade++; GrupoBLL cmd = new GrupoBLL(); DataTable dt = cmd.localizarComRetorno("", "gru_descricao"); foreach (DataRow dtRow in dt.Rows) { cmd.limpar(); try { cmd.gru_codigo = Int32.Parse(dtRow["gru_codigo"].ToString()); }catch { } try { cmd.gru_descricao = dtRow["gru_descricao"].ToString(); } catch { } cmd.inserir(); } } if (atividade == 0) { label2.Text = "Selecionando Fabricantes"; progressBar1.Value = atividade; atividade++; FornecedoresBLL cmd = new FornecedoresBLL(); DataTable dt = cmd.localizarComRetorno_SQLSERVER("", "", nome_base.Text); foreach (DataRow dtRow in dt.Rows) { cmd.limpar(); try{ cmd.for_codigo = Int32.Parse(dtRow.ItemArray[0].ToString()); }catch {} try{ cmd.for_cnpj = dtRow.ItemArray[2].ToString(); }catch {} try{ cmd.for_ie = dtRow.ItemArray[3].ToString(); }catch {} try{ cmd.for_email = dtRow.ItemArray[4].ToString(); }catch {} try{ cmd.for_cep = dtRow.ItemArray[5].ToString(); }catch {} try{ cmd.for_razaoSocial = dtRow.ItemArray[1].ToString(); }catch {} try{ cmd.for_logradouro = dtRow.ItemArray[6].ToString(); }catch {} try{ cmd.for_numero = dtRow.ItemArray[7].ToString(); }catch {} try{ cmd.for_complemento = dtRow.ItemArray[8].ToString(); }catch {} try{ cmd.for_bairro = dtRow.ItemArray[9].ToString(); }catch {} try{ cmd.for_cidade = Int32.Parse(dtRow.ItemArray[10].ToString()); }catch {} try{ cmd.for_telefone = dtRow.ItemArray[11].ToString(); }catch {} try{ cmd.for_fax = dtRow.ItemArray[12].ToString(); }catch {} try{ cmd.for_status = dtRow.ItemArray[13].ToString(); }catch {} try{ cmd.for_cpf = dtRow.ItemArray[14].ToString(); }catch {} try{ cmd.for_rg = dtRow.ItemArray[15].ToString(); }catch {} try{ cmd.for_tipo_fornecedor = dtRow.ItemArray[16].ToString(); }catch {} try{ cmd.for_nome = dtRow.ItemArray[17].ToString(); }catch {} try { cmd.for_tipo = dtRow.ItemArray[18].ToString(); }catch { } cmd.inserir(); } } }
private void Guardarbutton_Click(object sender, EventArgs e) { grupo.GrupoId = Convert.ToInt32(IdtextBox.Text); grupo.Nombre = NombreGrupotextBox.Text; GrupoBLL.Guardar(grupo); }
private void Buscarbutton_Click_1(object sender, EventArgs e) { Llenar(GrupoBLL.Buscar(u.StringToInt(IdtextBox.Text))); }
private void Window_Loaded_1(object sender, RoutedEventArgs e) { LaboratorioBLL labs = new LaboratorioBLL(); DocenteBLL docentes = new DocenteBLL(); AsignaturaBLL asignaturas = new AsignaturaBLL(); GrupoBLL grupos = new GrupoBLL(); cbLab.ItemsSource = labs.ObtenerAll().OrderBy(s => s.ID); cbDoc.ItemsSource = docentes.ObtenerAll().OrderBy(s => s.Nombre); cbMat.ItemsSource = asignaturas.ObtenerAll().OrderBy(s => s.Nombre); cbGrp.ItemsSource = grupos.ObtenerAll().OrderBy(s=>s.Nombre); this.inicializarCtrls(); }
private void GuardarCambios(object sender, RoutedEventArgs e) { var x = Utilidades.Validar(txtNom2); if (x && !string.IsNullOrEmpty(cbCar2.Text)) { GrupoBLL grupos = new GrupoBLL(); //var g = (Curso)cbCur2.SelectedValue; grup.Nombre = txtNom2.Text; grup.Carrera = cbCar2.Text; //grup.IDCurso = g.ID; if (grupos.Modificar(grup)) { MessageBox.Show(this, "Grupo Modificado, OK ", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Information); this.cargaCombos(); Utilidades.Limpiar(txtNom2); } else MessageBox.Show(this,"Se produjo un Error, Fail", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Error); } else MessageBox.Show(this,"No debe de haber campos vacios", appInfo.AssemblyProduct, MessageBoxButton.OK, MessageBoxImage.Error); }