Beispiel #1
0
 public void Eliminar(Ccliente obj)
 {
     Cdatos_clientes.Eliminar(obj);
     ctrlpersona.Eliminar(obj);
     lista.Remove(obj);
     Actualizar = true;
 }
Beispiel #2
0
 public void CargarBajas()
 {
     if (listabajas == null)
     {
         listabajas = new List <Ccliente>();
         Ctrl_localidades admlocalidades = Ctrl_localidades.ClaseActiva();
         DataTable        DT             = Cdatos_clientes.Devolver(false);
         Clocalidad       localidad;
         Ccliente         ocliente;
         foreach (DataRow DR in DT.Rows)
         {
             localidad = admlocalidades.BuscarPorID(Convert.ToInt32(DR[7]));
             ocliente  = new Ccliente(Convert.ToInt32(DR[0]), Convert.ToInt32(DR[1]), DR[2].ToString(), DR[5].ToString(), DR[3].ToString(), DR[4].ToString(), DR[6].ToString(), localidad);
             listabajas.Add(ocliente);
             ocliente.AgregarCuentaCorriente(new Ccuenta_corriente(Convert.ToInt32(DR[8]), Convert.ToDecimal(DR[9])));
         }
         if (DT.Rows.Count == 0)
         {
             ultimo = 0;
         }
         else
         {
             ultimo = Convert.ToInt32(DT.Rows[0][0]);
         }
     }
 }
Beispiel #3
0
 //METODOS ABM
 public void Agregar(Ccliente obj, bool cargarpersona)
 {
     try
     {
         if (cargarpersona)
         {
             obj.ID        = ctrlpersona.Agregar(obj);
             cargarpersona = false;
         }
         ultimo++;
         obj.ID_CLIENTE = ultimo;
         Cdatos_clientes.Agregar(obj);
         lista.Add(obj);
         Actualizar = true;
     }
     catch
     {
         Agregar(obj, cargarpersona);
     }
 }