Example #1
0
 public CHObservableCollection <EComSoft_Plazo> GET_Plazo()
 {
     try
     {
         var instCHSqlClient = new CHSqlClient(ComSoftLocal.CadenaConexion);
         var instCollection  = new CHObservableCollection <EComSoft_Plazo>();
         instCHSqlClient.CommandProcedure("spGET_ComSoft_BusquedaGeneral");
         instCHSqlClient.AddParameter("@Opcion", SqlDbType.VarChar, "GET_Plazo");
         instCHSqlClient.AddParameter("@Filtro", SqlDbType.VarChar, "%");
         instCHSqlClient.AddParameter("@ParametroId", SqlDbType.Int, 0);
         instCHSqlClient.AddParameter("@ParametroIdAux", SqlDbType.Int, 0);
         var dt = instCHSqlClient.ExecuteDataTable();
         for (var x = 0; x < dt.Rows.Count; x++)
         {
             instCollection.Add(new EComSoft_Plazo()
             {
                 IdPlazo   = (dt.Rows[x]["IdPlazo"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdPlazo"]) : 0,
                 Plazo     = (dt.Rows[x]["Plazo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Plazo"]) : string.Empty,
                 DiasPlazo = (dt.Rows[x]["DiasPlazo"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["DiasPlazo"]) : 0,
             });
         }
         return(instCollection);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #2
0
 public CHObservableCollection <EComSoft_Documento> GET_Documento()
 {
     try
     {
         var instCHSqlClient = new CHSqlClient(ComSoftLocal.CadenaConexion);
         var instList        = new CHObservableCollection <EComSoft_Documento>();
         instCHSqlClient.CommandProcedure("spGET_ComSoft_BusquedaGeneral");
         instCHSqlClient.AddParameter("@Opcion", SqlDbType.VarChar, "GET_Documento");
         instCHSqlClient.AddParameter("@Filtro", SqlDbType.VarChar, "%");
         instCHSqlClient.AddParameter("@ParametroId", SqlDbType.Int, 0);
         instCHSqlClient.AddParameter("@ParametroIdAux", SqlDbType.Int, 0);
         var dt = instCHSqlClient.ExecuteDataTable();
         for (int x = 0; x < dt.Rows.Count; x++)
         {
             instList.Add(new EComSoft_Documento()
             {
                 CodDocumento = (dt.Rows[x]["CodDocumento"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodDocumento"]) : string.Empty,
                 Descripcion  = (dt.Rows[x]["Descripcion"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Descripcion"]) : string.Empty,
                 Sunat        = (dt.Rows[x]["Sunat"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Sunat"]) : false,
             });
         }
         return(instList);
     }
     catch (Exception)
     {
         throw;
     }
 }
 private void Method_GET_DocumentoSunat()
 {
     try
     {
         Property_IsIndeterminate = true;
         var CollectionDocumento = new CHObservableCollection <EComSoft_KeyValue>();
         CollectionDocumento.Add(new EComSoft_KeyValue()
         {
             Key = "CTZ", Value = "COTIZACIÓN"
         });
         CollectionDocumento.Add(new EComSoft_KeyValue()
         {
             Key = "ORC", Value = "ORDEN DE COMPRA"
         });
         CollectionDocumento.Add(new EComSoft_KeyValue()
         {
             Key = "ORS", Value = "ORDEN DE SERVICIO"
         });
         Collection_DatosDocumentoSunat.Sources = (Property_IsCheckedDocumentoElectronico) ? new BComSoft_KeyValue().GET_DocumentoSunat() : CollectionDocumento;
         Property_IsIndeterminate = false;
     }
     catch (Exception ex)
     {
         CHMessageBox.Show(ComSoftMensaje.TituloDocumento, ex.Message, CHMessageTypeButton.Acept);
         Property_IsIndeterminate = false;
     }
 }
Example #4
0
 public CHObservableCollection <EComSoft_Empresa> GET_Empresa()
 {
     try
     {
         var instCHSqlClient = new CHSqlClient(ComSoftLocal.CadenaConexion);
         var instList        = new CHObservableCollection <EComSoft_Empresa>();
         instCHSqlClient.CommandProcedure("spGET_ComSoft_BusquedaGeneral");
         instCHSqlClient.AddParameter("@Opcion", SqlDbType.VarChar, "GET_Empresa");
         instCHSqlClient.AddParameter("@Filtro", SqlDbType.VarChar, "%");
         instCHSqlClient.AddParameter("@ParametroId", SqlDbType.Int, 0);
         instCHSqlClient.AddParameter("@ParametroIdAux", SqlDbType.Int, 0);
         var dt = instCHSqlClient.ExecuteDataTable();
         for (int x = 0; x < dt.Rows.Count; x++)
         {
             instList.Add(new EComSoft_Empresa()
             {
                 Condicion          = (dt.Rows[x]["Condicion"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Condicion"]) : string.Empty,
                 DireccionFiscal    = (dt.Rows[x]["DireccionFiscal"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["DireccionFiscal"]) : string.Empty,
                 Estado             = (dt.Rows[x]["Estado"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Estado"]) : string.Empty,
                 IdEmpresa          = (dt.Rows[x]["IdEmpresa"] != DBNull.Value)?Convert.ToInt32(dt.Rows[x]["IdEmpresa"]):0,
                 NombreLegal        = (dt.Rows[x]["NombreLegal"] != DBNull.Value)?Convert.ToString(dt.Rows[x]["NombreLegal"]):string.Empty,
                 RazonSocial        = (dt.Rows[x]["RazonSocial"] != DBNull.Value)?Convert.ToString(dt.Rows[x]["RazonSocial"]):string.Empty,
                 RepresentanteLegal = (dt.Rows[x]["RepresentanteLegal"] != DBNull.Value)?Convert.ToString(dt.Rows[x]["RepresentanteLegal"]):string.Empty,
                 Ruc = (dt.Rows[x]["Ruc"] != DBNull.Value)?Convert.ToString(dt.Rows[x]["Ruc"]):string.Empty,
                 TipoContribuyente = (dt.Rows[x]["TipoContribuyente"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["TipoContribuyente"]) : string.Empty,
             });
         }
         return(instList);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #5
0
 public CHObservableCollection <EComSoft_Moneda> GET_Moneda()
 {
     try
     {
         var instCHSqlClient = new CHSqlClient(ComSoftLocal.CadenaConexion);
         var instCollection  = new CHObservableCollection <EComSoft_Moneda>();
         instCHSqlClient.CommandProcedure("spGET_ComSoft_BusquedaGeneral");
         instCHSqlClient.AddParameter("@Opcion", SqlDbType.VarChar, "GET_Moneda");
         instCHSqlClient.AddParameter("@Filtro", SqlDbType.VarChar, "%");
         instCHSqlClient.AddParameter("@ParametroId", SqlDbType.Int, 0);
         instCHSqlClient.AddParameter("@ParametroIdAux", SqlDbType.Int, 0);
         var dt = instCHSqlClient.ExecuteDataTable();
         for (var x = 0; x < dt.Rows.Count; x++)
         {
             instCollection.Add(new EComSoft_Moneda()
             {
                 CodMoneda = (dt.Rows[x]["CodMoneda"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodMoneda"]) : string.Empty,
                 Moneda    = (dt.Rows[x]["Moneda"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Moneda"]) : string.Empty,
                 Simbolo   = (dt.Rows[x]["Simbolo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Simbolo"]) : string.Empty,
                 Nacional  = (dt.Rows[x]["Nacional"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Nacional"]) : false,
             });
         }
         return(instCollection);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #6
0
 public CHObservableCollection <EComSoft_Ubigeo> GET_Provincia(string Filtro = "%")
 {
     try
     {
         var instCHSqlClient = new CHSqlClient(ComSoftLocal.CadenaConexion);
         var instList        = new CHObservableCollection <EComSoft_Ubigeo>();
         instCHSqlClient.CommandProcedure("spGET_ComSoft_BusquedaGeneral");
         instCHSqlClient.AddParameter("@Opcion", SqlDbType.VarChar, "GET_Provincia");
         instCHSqlClient.AddParameter("@Filtro", SqlDbType.VarChar, Filtro);
         instCHSqlClient.AddParameter("@ParametroId", SqlDbType.Int, 0);
         instCHSqlClient.AddParameter("@ParametroIdAux", SqlDbType.Int, 0);
         var dt = instCHSqlClient.ExecuteDataTable();
         for (int x = 0; x < dt.Rows.Count; x++)
         {
             instList.Add(new EComSoft_Ubigeo()
             {
                 CodUbigeo = (dt.Rows[x]["CodProvincia"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodProvincia"]) : string.Empty,
                 Provincia = (dt.Rows[x]["Provincia"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Provincia"]) : string.Empty,
             });
         }
         return(instList);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #7
0
 public CHObservableCollection <EComSoft_KeyValue> GET_DocumentoSunat()
 {
     try
     {
         var instCollection  = new CHObservableCollection <EComSoft_KeyValue>();
         var instXmlDocument = new XmlDocument();
         instXmlDocument.Load(Path.Combine(Directory.GetCurrentDirectory(), @"File\XML\ComSoftDataSunat_PaymentVoucher.xml"));
         var vrXmlNodeList = instXmlDocument.GetElementsByTagName("PaymentVoucher");
         var XmlNodeList   = ((XmlElement)vrXmlNodeList[0]).GetElementsByTagName("Voucher");
         foreach (XmlElement nodo in XmlNodeList)
         {
             instCollection.Add(new EComSoft_KeyValue()
             {
                 Key   = nodo.GetElementsByTagName("Code")[0].InnerText,
                 Value = nodo.GetElementsByTagName("Decription")[0].InnerText,
             });
         }
         return(instCollection);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #8
0
 public CHObservableCollection <EComSoft_Almacen> GET_Almacen(int IdEmpresaSucursal = 0)
 {
     try
     {
         var instCHSqlClient = new CHSqlClient(ComSoftLocal.CadenaConexion);
         var instCollection  = new CHObservableCollection <EComSoft_Almacen>();
         instCHSqlClient.CommandProcedure("spGET_ComSoft_BusquedaGeneral");
         instCHSqlClient.AddParameter("@Opcion", SqlDbType.VarChar, "GET_Almacen");
         instCHSqlClient.AddParameter("@Filtro", SqlDbType.VarChar, "%");
         instCHSqlClient.AddParameter("@ParametroId", SqlDbType.Int, IdEmpresaSucursal);
         instCHSqlClient.AddParameter("@ParametroIdAux", SqlDbType.Int, 0);
         var dt = instCHSqlClient.ExecuteDataTable();
         for (var x = 0; x < dt.Rows.Count; x++)
         {
             instCollection.Add(new EComSoft_Almacen()
             {
                 IdAlmacen = (dt.Rows[x]["IdAlmacen"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdAlmacen"]) : 0,
                 Almacen   = (dt.Rows[x]["Almacen"] != DBNull.Value)? Convert.ToString(dt.Rows[x]["Almacen"]):string.Empty,
                 Direccion = (dt.Rows[x]["Direccion"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Direccion"]) : string.Empty,
                 EComSoft_EmpresaSucursal = new EComSoft_EmpresaSucursal()
                 {
                     IdEmpresaSucursal = (dt.Rows[x]["IdEmpresaSucursal"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdEmpresaSucursal"]) : 0,
                 },
                 EComSoft_Ubigeo = new EComSoft_Ubigeo()
                 {
                     CodUbigeo = (dt.Rows[x]["CodUbigeo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodUbigeo"]) : string.Empty,
                 }
             });
         }
         return(instCollection);
     }
     catch (Exception)
     {
         throw;
     }
 }