示例#1
0
        public static int Agregar(usuario_agenda pusuarioa)
        {
            int          retorno = 0;
            MySqlCommand comando = new MySqlCommand(string.Format("insert into usuario_agenda (idusuario_agenda,id_creador, id_responsable, id_ejecutor, est_fecha_inicio, est_fecha_fin) values ('{0}','{1}','{2}','{3}', '{4}', '{5}')",
                                                                  pusuarioa.idusuario_agenda, pusuarioa.idusuario_creador, pusuarioa.idusuario_ejecutor, pusuarioa.idusuario_responsable, pusuarioa.fecha_inicio, pusuarioa.fecha_fin), conexion.obtenerconexion());

            retorno = comando.ExecuteNonQuery();
            return(retorno);
        }
示例#2
0
        private void buttoningresar_Click(object sender, EventArgs e)
        {
            usuario_agenda u = new usuario_agenda();

            u.idusuario_creador = Convert.ToInt32(txtusuarioagenda.Text);

            u.idusuario_ejecutor = Convert.ToInt32(comboejecutor.SelectedValue);

            u.idusuario_responsable = Convert.ToInt32(comboresponsable.SelectedValue);

            u.fecha_inicio = label5.Text;
            u.fecha_fin    = label6.Text;
            int respuesta = ventana.Agregar(u);

            if (respuesta > 0)
            {
                agendar a = new agendar();
                a.id_trabajo      = Convert.ToInt32(combotrabajo.SelectedValue);
                a.detalle         = textdetalle.Text;
                a.id_servicio     = Convert.ToInt32(comboservicio.SelectedValue);
                a.id_departamento = Convert.ToInt32(combodepartamento.SelectedValue);
                a.id_zona         = Convert.ToInt32(combozona.SelectedValue);
                a.id_grupo        = Convert.ToInt32(combogrupo.SelectedValue);
                a.id_estado       = Convert.ToInt32(comboestado.SelectedValue);
                int resultado = ventana.AgregarAgenda(a);
                if (resultado > 0)
                {
                    MessageBox.Show("Ingresado con exito");
                }
                else
                {
                    MessageBox.Show("Error al Agendar Ventana");
                }
            }

            else
            {
                MessageBox.Show("Error Al Elegir Usuarios Involucrados");
            }
        }