Example #1
0
 public string RegistrarGuia(EGuia oDatos, List <EGuiaDet> Detalle, string Usuario)
 {
     try
     {
         return(Data.RegistrarGuia(oDatos, Detalle, Usuario));
     }
     catch (Exception Exception)
     {
         throw Exception;
     }
 }
Example #2
0
        public List <EGuia> ListarGuia(int Comienzo, int Medida, int empresa, int Sucursal, string FechaEmi)
        {
            List <EGuia> oDatos = new List <EGuia>();

            using (var Connection = GetConnection(BaseDeDatos))
            {
                try
                {
                    Connection.Open();
                    SetQuery("FAC_FiltrarGia");
                    CreateHelper(Connection);
                    AddInParameter("@iComienzo", Comienzo);
                    AddInParameter("@iMedida", Medida);
                    AddInParameter("@iSucursal", Sucursal);
                    AddInParameter("@iEmpresa", empresa);
                    AddInParameter("@fechaEmi", FechaEmi);
                    using (var Reader = ExecuteReader())
                    {
                        while (Reader.Read())
                        {
                            EGuia oComprobante = new EGuia();
                            oComprobante.idGuia           = int.Parse(Reader["IdGuia"].ToString());
                            oComprobante.Item             = int.Parse(Reader["Row"].ToString());
                            oComprobante.empresa.RUC      = Reader["sruc"].ToString();
                            oComprobante.Documento.Nombre = Reader["sCodigoTipoDocumento"].ToString();
                            oComprobante.serie            = Reader["serie"].ToString();
                            oComprobante.FechaRegistro    = Reader["dFechaEmision"].ToString();
                            oComprobante.Total            = int.Parse(Reader["Total"].ToString());

                            oDatos.Add(oComprobante);
                        }
                    }
                }
                catch (Exception Exception)
                {
                    throw Exception;
                }
                finally
                {
                    Connection.Close();
                }
                return(oDatos);
            }
        }