Exemplo n.º 1
0
        public DataTable ListarContacto(BEContacto objEContacto)
        {
            DataTable dt = new DataTable();
            MySqlConnection conn = new MySqlConnection("Server=127.0.0.1; Database=MECANICSWEB; Uid=Administrador; Pwd=admin");
            MySqlCommand command = new MySqlCommand("`mecanicsweb`.`ListarContacto`", conn);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add(ObjSqlParameter("N_ID", objEContacto.ID_Contacto, ParameterDirection.Input, System.Data.DbType.String));
            conn.Open();
            IDataReader dr = command.ExecuteReader();
            dt.Load(dr);
            conn.Close();
            return dt;
        }
Exemplo n.º 2
0
        public Object MantenimientoContacto(string ACCION, BEContacto objEContacto)
        {
            DataTable dt = new DataTable();
            MySqlConnection conn = new MySqlConnection("Server=127.0.0.1; Database=MECANICSWEB; Uid=Administrador; Pwd=admin");
            MySqlCommand command = new MySqlCommand("`mecanicsweb`.`MantenimientoContacto`", conn);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add(ObjSqlParameter("N_ID", objEContacto.ID_Contacto, ParameterDirection.Input, System.Data.DbType.Int16));
            command.Parameters.Add(ObjSqlParameter("N_IDCliente", objEContacto.ID_Cliente, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_Nombre", objEContacto.Nombre, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_TipoDocumento", objEContacto.TipoDocumento, ParameterDirection.Input, System.Data.DbType.Int16));
            command.Parameters.Add(ObjSqlParameter("N_Documento", objEContacto.Documento, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_Telefono", objEContacto.Telefono, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("N_Celular", objEContacto.Celular, ParameterDirection.Input, System.Data.DbType.String));
            command.Parameters.Add(ObjSqlParameter("ACCION", ACCION, ParameterDirection.Input, System.Data.DbType.String));

            conn.Open();

            try
            {
                if (ACCION.Equals("AGREGAR") || ACCION.Equals("MODIFICAR"))
                {
                    command.ExecuteNonQuery();
                    return "Exito";
                }
                else
                {
                    IDataReader dr = command.ExecuteReader();
                    dt.Load(dr);
                    return dt;
                }
            }
            catch (Exception e)
            {
                throw new Exception("Error interno", e);
            }
            finally
            {
                conn.Close();
            }
        }
Exemplo n.º 3
0
        public void ActualizaContacto(BEContacto objEContacto)
        {
            MySqlConnection conn = new MySqlConnection("Server=127.0.0.1; Database=MECANICSWEB; Uid=Administrador; Pwd=admin");
            MySqlCommand command = new MySqlCommand("`mecanicsweb`.`ActualizaContacto`", conn);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add(ObjSqlParameter("N_ID", objEContacto.ID_Contacto, ParameterDirection.Input, System.Data.DbType.Int16));
            command.Parameters.Add(ObjSqlParameter("N_IDCliente", objEContacto.ID_Cliente, ParameterDirection.Input, System.Data.DbType.String));

            conn.Open();

            command.ExecuteNonQuery();
            conn.Close();
        }
Exemplo n.º 4
0
 public void ActualizaContacto(BEContacto objEContacto)
 {
     objContacto.ActualizaContacto(objEContacto);
 }
Exemplo n.º 5
0
 public DataTable ListarContacto(BEContacto objEContacto)
 {
     return objContacto.ListarContacto(objEContacto);
 }
Exemplo n.º 6
0
 public Object MantenimientoContacto(string ACCION, BEContacto objEContacto)
 {
     return objContacto.MantenimientoContacto(ACCION, objEContacto);
 }
Exemplo n.º 7
0
 public DataTable ConsultarContacto(BEContacto objEContacto)
 {
     return objContacto.ConsultarContacto(objEContacto);
 }