Ejemplo Trabajo A 3 Capas C#

Páginas: 8 (1821 palabras) Publicado: 4 de marzo de 2013
__________________________________DATOS__________________________________
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Datos
{
public class Entrada
{
private string cantidad;
private string departamento;
private string fecha;

public static string[,] entrada = new string[10, 5];

publicvoid Registrar( string codigom, string cantidad, string departamento, string fecha, int c)
{
entrada[c, 0] = Convert.ToString(c+1);
entrada[c, 1] = codigom;
entrada[c, 2] = cantidad;
entrada[c, 3] = departamento;
entrada[c, 4] = fecha;


Console.WriteLine("Registro Exitoso");
}

publicstring[,] Listar()
{

return entrada;
}
}
}
_________________________________________________________________________---
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Datos
{
public class Mercancia
{
public static string[,] mercancia = new string[10, 2];
int total = 0;public void Registrar(string codigo, string nombre, int c)
{

mercancia[c, 0] = codigo;
mercancia[c, 1] = nombre;


}

public string[,] Listar()
{
return mercancia;

}

public void Modificar(string nombre, int c)
{

mercancia[c, 1] = nombre;}
}
}
__________________________________________________________________--
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Datos
{
class Program
{
static void Main(string[] args)
{
}
}
}
________________________________________________________________________________________________________LOGICA__________________________________________-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Datos;
namespace Logica
{
public class Entrada
{
int total;
string[,] matrizM = new string[10, 2];
string[,] matrizE = new string[10, 5];

string[] vecE = new string[5];
string nombreD;Datos.Entrada e = new Datos.Entrada();

Datos.Mercancia m = new Datos.Mercancia();

public int Registrar(string codigom, string cantidad, string departamento, string fecha)
{

matrizM = m.Listar();

for (int i = 0; i < 10; i++)
{

if (matrizM[i, 0] == (codigom))
{e.Registrar(codigom, cantidad, departamento,fecha,total);
total = total + 1;

}
}
return total;
}

public string[,] Listar()
{

return e.Listar();
}

public string[] consultar(string dato)
{

matrizM = m.Listar();
matrizE = e.Listar();for (int i = 0; i < total; i++)
{

if (matrizE[i, 0] == (dato))
{

for (int k = 0; k < 10; k++)
{

if (matrizM[k, 0] == (matrizE[i, 0]))
{
nombreD = matrizM[k, 1];
}}

for (int j = 0; j < 5; j++)
{
vecE[j] = matrizE[i, j];

}
vecE[1] = nombreD;

i = total;

}
}
return vecE;
}

// • Mercancía que ingresa en un día
public int Cmercancia(string fecha)...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • EJEMPLO TRABAJO MODULO 3
  • Ejemplos c++
  • Ejemplos c#
  • Ejemplos de c++
  • Ejemplos C++
  • Ejemplos De c++
  • Capa 3 Capa de RED
  • Cap 3

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS