private void FormTareasNegocio_Load(object sender, EventArgs e) { this.Text = "Tareas de " + titulo; //dateNavigator1.EditValue; //LLENAR EMPLEADOS //DataTable dt_empleados = OpBD.SeleccionarEmpleados(); //if (dt_empleados != null) //{ // DataRow row_emp = dt_empleados.NewRow(); // row_emp[0] = 0; // row_emp[1] = "<Ninguno>"; // dt_empleados.Rows.InsertAt(row_emp, 0); // cbo_empleado.DataSource = dt_empleados; // cbo_empleado.ValueMember = "id_empleado"; // cbo_empleado.DisplayMember = "Empleado"; //} ServiceReference1.Service1Client srv = new ServiceReference1.Service1Client(); DataSet ds = srv.ObtenerEmpleados(); DataTable dt_empleados = ds.Tables[0]; DataRow row_emp = dt_empleados.NewRow(); row_emp[0] = 0; row_emp[6] = "<Ninguno>"; dt_empleados.Rows.InsertAt(row_emp, 0); cbo_empleado.DataSource = dt_empleados; cbo_empleado.ValueMember = "id_empleado_pk"; cbo_empleado.DisplayMember = "NOMBRE"; //--------------------------------------------- //Tipos DataTable dt_tipos = OpBD.SeleccionarTipoTarea(); if (dt_tipos != null) { cbo_tareas.DataSource = dt_tipos; cbo_tareas.ValueMember = "id_tipo"; cbo_tareas.DisplayMember = "tipo"; } //------------------------------------ if (btn_guardar.Text == "Actualizar") { DataTable dt_ids_empledos = OpBD.SeleccionarIdEmpleado(id_tarea); if (dt_ids_empledos != null) { DataRow row = dt_ids_empledos.Rows[0]; string id_empleado = row[0].ToString(); string empleado_ws = "--"; foreach (DataRow roww in dt_empleados.Rows) { if (roww[0].ToString() == id_empleado) { empleado_ws = roww[6].ToString(); } } int indice_empleado = cbo_empleado.FindString(empleado_ws); cbo_empleado.SelectedIndex = indice_empleado; } //int indice_empleado = cbo_empleado.FindString(empleado); //cbo_empleado.SelectedIndex = indice_empleado; int indice_tipo = cbo_tareas.FindString(tipo); cbo_tareas.SelectedIndex = indice_tipo; } }
// formulario de Nuevo Caso private void frm_NuevoCaso_Load(object sender, EventArgs e) { try { //CapaNegocio fn = new CapaNegocio(); //DataTable seg = seguridad.ObtenerPermisos.Permisos(seguridad.Conexion.User, id_form); //if (seg.Rows.Count > 0) //{ // fn.desactivarPermiso(seg, btn_guardar, btn_eliminar, btn_editar, btn_nuevo, btn_cancelar, btn_actualizar, btn_buscar, btn_anterior, btn_siguiente, btn_primero, btn_ultimo); //} //else //{ // btn_guardar.Enabled = false; btn_eliminar.Enabled = false; btn_editar.Enabled = false; btn_nuevo.Enabled = false; btn_actualizar.Enabled = false; btn_cancelar.Enabled = false; btn_buscar.Enabled = false; //} // Cargar combo box de categoria de casos //DataTable dt_categoria_casos = new DataTable(); //dt_categoria_casos = peticionescapa.cargar_categoria_caso(); //cmb_categoria.DataSource = dt_categoria_casos; //cmb_categoria.ValueMember = "id_cat_caso"; //cmb_categoria.DisplayMember = "nombre_caso"; //LLENAR CATEGORIAS DataTable dt_catcaso = OpBD.SeleccionarCategoriasCaso(); if (dt_catcaso != null) { cmb_categoria.DataSource = dt_catcaso; cmb_categoria.ValueMember = "id_cat_caso"; cmb_categoria.DisplayMember = "nombre_caso"; } // Cargar combo box de empleados //DataTable dt_empleados = new DataTable(); //dt_empleados = peticionescapa.cargar_empleados(); //cmb_responsable.DataSource = dt_empleados; //cmb_responsable.ValueMember = "id_empleado"; //cmb_responsable.DisplayMember = "nombres"; //LLENAR EMPLEADOS //DataTable dt_empleados = OpBD.SeleccionarEmpleados(); //DataRow row_emp = dt_empleados.NewRow(); //row_emp[0] = 0; //row_emp[1] = "<Ninguno>"; //dt_empleados.Rows.InsertAt(row_emp, 0); //cmb_responsable.DataSource = dt_empleados; //cmb_responsable.ValueMember = "id_empleado"; //cmb_responsable.DisplayMember = "Empleado"; ServiceReference1.Service1Client srv = new ServiceReference1.Service1Client(); DataSet ds = srv.ObtenerEmpleados(); DataTable dt_empleados = ds.Tables[0]; DataRow row_emp = dt_empleados.NewRow(); row_emp[0] = 0; row_emp[6] = "<Ninguno>"; dt_empleados.Rows.InsertAt(row_emp, 0); cmb_responsable.DataSource = dt_empleados; cmb_responsable.ValueMember = "id_empleado_pk"; cmb_responsable.DisplayMember = "NOMBRE"; //// Cargar GridView de casos //DataTable dt_casos = new DataTable(); //dt_casos = peticionescapa.cargar_casos(); //dgv_casos.DataSource = dt_casos; //// columnas ocultas //gridView1.Columns["id_empresa"].Visible = false; //gridView1.Columns["id_empleado"].Visible = false; //gridView1.Columns["id_cliente"].Visible = false; //gridView1.Columns["id_cat_caso"].Visible = false; //gridView1.Columns["id_caso"].Visible = false; //// headers de las columnas //gridView1.Columns["nombre"].Caption = "Empresa"; //gridView1.Columns["nombres"].Caption = "Nombre del cliente"; //gridView1.Columns["apellidos"].Caption = "Apellido del cliente"; //gridView1.Columns["nombres1"].Caption = "Nombre del encargado"; //gridView1.Columns["apellidos1"].Caption = "Apellido del encargado"; //gridView1.Columns["fecha_asignacion"].Caption = "Asignacion"; //gridView1.Columns["fecha_limite"].Caption = "Fecha limite"; //gridView1.Columns["nombre_caso"].Caption = "Categoria"; //gridView1.Columns["estado_caso"].Caption = "Estado"; //gridView1.Columns["id_cat_caso"].Visible = false; if (actualizar == true) { txt_titulo.Text = ""; txt_titulo.Text = titulo_e; txt_titulo.ForeColor = Color.Black; if (!String.IsNullOrEmpty(persona_e)) { cmb_ente.SelectedItem = "Persona"; int indice_per = cbo_perem.FindString(persona_e); cbo_perem.SelectedIndex = indice_per; } else if (!String.IsNullOrEmpty(empresa_e)) { cmb_ente.SelectedItem = "Empresa"; int indice_emp = cbo_perem.FindString(empresa_e); cbo_perem.SelectedIndex = indice_emp; } DataTable dt = OpBD.SeleccionarDatosRestantesCaso(id_caso_e); DataRow row = dt.Rows[0]; string fecha_asignacion = row[0].ToString(); string estado_caso = row[1].ToString(); string descripcion = row[2].ToString(); // string empleado = row[3].ToString(); string id_empleado = row[4].ToString(); //---------------WS-------------- string empleado_ws = "--"; foreach (DataRow roww in dt_empleados.Rows) { if (roww[0].ToString() == id_empleado) { empleado_ws = roww[6].ToString(); } } //------------------------------ txt_descripcion.Text = descripcion; txt_descripcion.ForeColor = Color.Black; int indice_categoria = cmb_categoria.FindString(categoria_e); cmb_categoria.SelectedIndex = indice_categoria; dtp_fecha_cierre.EditValue = Convert.ToDateTime(fecha_fin_e); if (id_empleado != "0") { int indice_empleado = cmb_responsable.FindString(empleado_ws); cmb_responsable.SelectedIndex = indice_empleado; } else { cmb_responsable.SelectedIndex = 0; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void FormDetallesNegocio_Load(object sender, EventArgs e) { this.Text = titulo; DataTable dt = OpBD.SeleccionarDatosRestantes(id_negocio); DataRow row = dt.Rows[0]; string detalles = row[0].ToString(); string etapa = row[1].ToString(); string fecha_inicio = row[2].ToString(); string id_empleado = row[3].ToString(); string nombre_empleado = row[4].ToString(); string estado = row[5].ToString(); //----------------------------------------------------------------- string empleado_ws = "--"; ServiceReference1.Service1Client srv = new ServiceReference1.Service1Client(); DataSet ds = srv.ObtenerEmpleados(); DataTable dt_empleadas = new DataTable(); dt_empleadas = ds.Tables[0]; foreach (DataRow roww in dt_empleadas.Rows) { if (roww[0].ToString() == id_empleado) { empleado_ws = roww[6].ToString(); } } lbl_encargado.Text = empleado_ws; //-------------------------------------------------------- groupControl1.Text = titulo; if (!String.IsNullOrEmpty(nombre_persona)) { lbl_cliente.Text = nombre_persona; } else if (!String.IsNullOrEmpty(nombre_empresa)) { lbl_cliente.Text = nombre_empresa; } decimal valor2 = Convert.ToDecimal(valor); lbl_valor.Text = moneda + " " + valor2.ToString("#,###.##");; string[] fecha_inicio_separado = fecha_inicio.Split(' '); lbl_fecha_ini.Text = fecha_inicio_separado[0]; string[] fecha_cierre_separado = fecha_cierre.Split(' '); lbl_fecha_cierre.Text = fecha_cierre_separado[0]; lbl_categoria.Text = categoria; label5.Text = detalles; switch (etapa) { case "0": lbl_etapa.Text = "Preparación"; break; case "1": lbl_etapa.Text = "Discusión o Desarrollo"; break; case "2": lbl_etapa.Text = "Propuesta realizada"; break; case "3": lbl_etapa.Text = "Cierre o acuerdo"; break; } // lbl_encargado.Text = nombre_empleado; lbl_estado.Text = estado; if (estado == "Perdido") { btn_perdida.ForeColor = Color.White; } else if (estado == "Proceso") { btn_proceso.ForeColor = Color.White; } else if (estado == "Ganado") { btn_Ganada.ForeColor = Color.White; } rtxt_notas.ForeColor = Color.Gray; rtxt_notas.Text = "Agrege una nota acerca de " + titulo;; btn_Ganada.Image = Image.FromFile("like20.png"); btn_perdida.Image = Image.FromFile("dislike20.png"); ObtenerNotas(); btn_eliminar_nota.Enabled = false; btn_eliminar_nota.Visible = false; //---------------------tareas-------------- DataTable dt_tareasneg = OpBD.SeleccionarTareasNEG(id_negocio); if (dt_tareasneg != null) { gridControl_tareas.DataSource = dt_tareasneg; dgv_tareas.Columns[0].Caption = "Descripción"; dgv_tareas.Columns[1].Caption = "Fecha"; dgv_tareas.Columns[2].Caption = "Tipo"; dgv_tareas.Columns[3].Caption = "Empleado"; dgv_tareas.Columns[4].Caption = "Estado"; dgv_tareas.Columns[5].Caption = "Criticidad"; dgv_tareas.Columns[6].Visible = false; dgv_tareas.Columns[7].Visible = false; dgv_tareas.Columns[8].Visible = false; dgv_tareas.Columns[3].Visible = false; dgv_tareas.Columns[0].Width = 115; dgv_tareas.Columns[1].Width = 70; dgv_tareas.Columns[2].Width = 58; dgv_tareas.Columns[3].Width = 90; dgv_tareas.Columns[4].Width = 60; dgv_tareas.Columns[5].Width = 47; } }
private void FormNuevoNegocio_Load(object sender, EventArgs e) { try { // txt_valor.Text = String.Format("#,###.##"); //WindowState = FormWindowState.Normal; //LLENAR MONEDA cbo_monedas.DataSource = OpBD.SeleccionarMonedas(); cbo_monedas.ValueMember = "id_moneda"; cbo_monedas.DisplayMember = "Moneda"; //cbo_moneda.Properties.PopulateColumns(); //cbo_moneda.Properties.Columns[0].Visible = false; //LLENAR CATEGORIAS cbo_cat.DataSource = OpBD.SeleccionarCategoriascbo(); cbo_cat.ValueMember = "id_cat"; cbo_cat.DisplayMember = "nombre_cat"; //LLENAR EMPLEADOS //DataTable dt_empleados = OpBD.SeleccionarEmpleados(); //DataRow row_emp = dt_empleados.NewRow(); //row_emp[0] = 0; //row_emp[1] = "<Ninguno>"; //dt_empleados.Rows.InsertAt(row_emp, 0); //cbo_empleado.DataSource = dt_empleados; //cbo_empleado.ValueMember = "id_empleado"; //cbo_empleado.DisplayMember = "Empleado"; ServiceReference1.Service1Client srv = new ServiceReference1.Service1Client(); DataSet ds = srv.ObtenerEmpleados(); DataTable dt_empleados = ds.Tables[0]; DataRow row_emp = dt_empleados.NewRow(); row_emp[0] = 0; row_emp[6] = "<Ninguno>"; dt_empleados.Rows.InsertAt(row_emp, 0); cbo_empleado.DataSource = dt_empleados; cbo_empleado.ValueMember = "id_empleado_pk"; cbo_empleado.DisplayMember = "NOMBRE"; if (btn_guardar.Text == "Actualizar") { txt_titulo.Text = titulo_e; if (!String.IsNullOrEmpty(persona_e)) { comboBox1.SelectedItem = "Persona"; int indice_per = cbo_perem.FindString(persona_e); cbo_perem.SelectedIndex = indice_per; } else if (!String.IsNullOrEmpty(empresa_e)) { comboBox1.SelectedItem = "Empresa"; int indice_emp = cbo_perem.FindString(empresa_e); cbo_perem.SelectedIndex = indice_emp; } DataTable dt_rest = OpBD.SeleccionarDatosRestantes(id_negocio_e); DataRow row = dt_rest.Rows[0]; string detalles = row[0].ToString(); string etapa = row[1].ToString(); string fecha_inicio = row[2].ToString(); string id_empleado = row[3].ToString(); // string nombre_empleado = row[4].ToString(); string estado = row[5].ToString(); txt_detalles.Text = detalles; //---------------WS-------------- string empleado_ws = "--"; foreach (DataRow roww in dt_empleados.Rows) { if (roww[0].ToString() == id_empleado) { empleado_ws = roww[6].ToString(); } } //------------------------------ string[] moneda_dividida = moneda_e.Split('(', ')'); string nombre_moneda = moneda_dividida[0]; string signo_moneda = moneda_dividida[1]; string moneda_final = signo_moneda + " - " + nombre_moneda; int indice_moneda = cbo_monedas.FindString(moneda_final); cbo_monedas.SelectedIndex = indice_moneda; txt_valor.Text = valor_e; int indice_categoria = cbo_cat.FindString(categoria_e); cbo_cat.SelectedIndex = indice_categoria; dtp_fecha_cierre.EditValue = Convert.ToDateTime(fecha_cierre_e); if (id_empleado != "0") { int indice_empleado = cbo_empleado.FindString(empleado_ws); cbo_empleado.SelectedIndex = indice_empleado; } else { cbo_empleado.SelectedIndex = 0; } tb_etapa.Value = Convert.ToInt32(etapa); } } catch { MessageBox.Show("sin permisos!!"); } }