private void CargarSerie_correlativo()
 {
     try
     {
         serie = negVenta.Intancia.CargarSerie(1, 5);
         ser   = serie.Numero_Serie;
         lblCorrelativo.Text = negVenta.Intancia.CargarCorrelativo(serie.tipocom.Id_TipCom, serie.Numero_Serie);
         corr = negVenta.Intancia.CargarCorrelativo(serie.tipocom.Id_TipCom, serie.Numero_Serie);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #2
0
 private void CargarSerie_correlativo()
 {
     try
     {
         serie               = negVenta.Intancia.CargarSerie(1, 1);
         ser                 = serie.Numero_Serie;
         lblSerie.Text       = serie.Numero_Serie + "-";
         lblCorrelativo.Text = "NÂș " + negVenta.Intancia.CargarCorrelativo(1, serie.Numero_Serie);
         corr                = negVenta.Intancia.CargarCorrelativo(1, serie.Numero_Serie);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #3
0
 public entSerie CargarSerie(int id_suc, int id_tipcom)
 {
     try
     {
         entSerie s = VentaRepository.Instancia.CargarSerie(id_suc, id_tipcom);
         if (s == null)
         {
             throw new ApplicationException("Error al cargar serie, problema con dato de sucursal");
         }
         return(s);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public entSerie CargarSerie(int id_Suc, int id_tipcom)
        {
            SqlCommand    cmd = null;
            entSerie      s   = null;
            SqlDataReader dr  = null;

            try
            {
                SqlConnection cn = Conexion.Instancia.Conectar();
                cmd = new SqlCommand("spCargarSerie", cn);
                cmd.Parameters.AddWithValue("@prmIdSuc", id_Suc);
                cmd.Parameters.AddWithValue("@prmIdTipcom", id_tipcom);

                cmd.CommandType = CommandType.StoredProcedure;
                cn.Open();
                dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    s              = new entSerie();
                    s.Id_Serie     = Convert.ToInt32(dr["Id_Serie"]);
                    s.Numero_Serie = dr["Numero_Serie"].ToString();
                    entSucursal suc = new entSucursal();
                    suc.Id_Suc = Convert.ToInt32(dr["Id_Sucursal_Serie"]);
                    s.sucursal = suc;
                    entTipComprobante tc = new entTipComprobante();
                    tc.Id_TipCom = Convert.ToInt32(dr["Id_TipCom_Serie"]);
                    s.tipocom    = tc;
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally { cmd.Connection.Close(); }
            return(s);
        }