public clsEntitySummaryDocuments cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_SummaryDocuments_Id = valores[0];
                Cs_tag_ID            = valores[1];
                Cs_tag_ReferenceDate = valores[2];
                Cs_tag_IssueDate     = valores[3];
                Cs_tag_AccountingSupplierParty_CustomerAssignedAccountID = valores[4];
                Cs_tag_AccountingSupplierParty_AdditionalAccountID       = valores[5];
                Cs_tag_AccountingSupplierParty_Party_PartyLegalEntity_RegistrationName = valores[6];
                Cs_pr_Ticket                = valores[7];
                Cs_pr_EstadoSCC             = valores[8];
                Cs_pr_EstadoSUNAT           = valores[9];
                Cs_pr_ComentarioSUNAT       = valores[10];
                Cs_pr_XML                   = valores[11];
                Cs_pr_CDR                   = valores[12];
                Cs_pr_ExceptionSUNAT        = valores[13];
                Cs_tag_DocumentCurrencyCode = valores[14];
                Cs_tag_AccountingSupplierParty_Party_PartyName_Name = valores[15];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Metodo para obtener un registro segun id de la linea
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public clsEntidadDocument_Line cs_pxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Document_Line_Id                = valores[0];
                Cs_pr_Document_Id                     = valores[1];
                Cs_tag_InvoiceLine_ID                 = valores[2];
                Cs_tag_InvoicedQuantity_unitCode      = valores[3];
                Cs_tag_invoicedQuantity               = valores[4];
                Cs_tag_LineExtensionAmount_currencyID = valores[5];
                Cs_tag_PricingReference_AlternativeConditionPrice_PriceAmount_currencyID = valores[6];
                Cs_tag_PricingReference_AlternativeConditionPrice_PriceTypeCode          = valores[7];
                Cs_tag_Item_SellersItemIdentification = valores[8];
                Cs_tag_Price_PriceAmount = valores[9];
                Cs_tag_AllowanceCharge_ChargeIndicator     = valores[10];
                Cs_tag_AllowanceCharge_Amount              = valores[11];
                Cs_cr_TransferenciaGratuitaMotivo          = valores[12];
                Cs_cr_TransferenciaGratuitaValorReferencia = valores[13];
                Cs_cr_UnidadMedida = valores[14];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
        public clsEntityPerception_PerceptionLine cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Perception_PerceptionLine_Id = valores[0];
                Cs_pr_Perception_Id                  = valores[1];
                Cs_tag_Id                            = valores[2];
                Cs_tag_Id_SchemeId                   = valores[3];
                Cs_tag_IssueDate                     = valores[4];
                Cs_tag_TotalInvoiceAmount            = valores[5];
                Cs_tag_TotalInvoiceAmount_CurrencyId = valores[6];
                Cs_tag_Payment_PaidDate              = valores[7];
                Cs_tag_Payment_Id                    = valores[8];
                Cs_tag_Payment_PaidAmount            = valores[9];
                Cs_tag_Payment_PaidAmount_CurrencyId = valores[10];
                Cs_tag_SUNATPerceptionInformation_SUNATPerceptionAmount            = valores[11];
                Cs_tag_SUNATPerceptionInformation_SUNATPerceptionAmount_CurrencyId = valores[12];
                Cs_tag_SUNATPerceptionInformation_SUNATPerceptionDate             = valores[13];
                Cs_tag_SUNATPerceptionInformation_SUNATNetTotalCashed             = valores[14];
                Cs_tag_SUNATPerceptionInformation_SUNATNetTotalCashed_CurrencyId  = valores[15];
                Cs_tag_SUNATPerceptionInformation_ExchangeRate_SourceCurrencyCode = valores[16];
                Cs_tag_SUNATPerceptionInformation_ExchangeRate_TargetCurrencyCode = valores[17];
                Cs_tag_SUNATPerceptionInformation_ExchangeRate_CalculationRate    = valores[18];
                Cs_tag_SUNATPerceptionInformation_ExchangeRate_Date = valores[19];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #4
0
        // Metodo para actualizar estado  de la conexion a base de  datos
        private void cs_pxActualizarEstado()
        {
            //Obtener el estado de la conexin a bd
            clsBaseConexion conexion = new clsBaseConexion(entidad_basedatos);

            cs_prConexionEstado = conexion.cs_fxConexionEstado();
        }
Beispiel #5
0
        private void btnGenerarUnico_Click(object sender, RoutedEventArgs e)
        {
            clsEntityDatabaseLocal localDB = new clsEntityDatabaseLocal().cs_fxObtenerUnoPorDeclaranteId(declarante.Cs_pr_Declarant_Id);

            if (txtRutaUnico.Text.Trim().Length > 0)
            {
                bool procesar = false;
                bool password = false;
                if (chkPasswordUnico.IsChecked == true)
                {
                    if (txtPasswordUnico.Text.Trim().Length >= 3)
                    {
                        procesar = true;
                        password = true;
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show("Debe ingresar el password, minimo 3 caracteres.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        procesar = false;
                    }
                }
                else
                {
                    procesar = true;
                }

                if (procesar)
                {
                    clsBaseConexion cn           = new clsBaseConexion(localDB);
                    string          resultado    = string.Empty;
                    string          baseLocation = txtRutaUnico.Text;
                    // string nameBack = "FEICONTBACKUP_" + declarante.Cs_pr_Ruc + "_" + DateTime.Now.ToString("yyyy") + DateTime.Now.ToString("MM") + DateTime.Now.ToString("dd") + "_" + DateTime.Now.Hour.ToString() + "_" + DateTime.Now.Minute.ToString();
                    string nameBack = "FEICONTBACKUP_" + declarante.Cs_pr_Ruc;

                    string fullName             = baseLocation + "\\" + nameBack + ".BAK";
                    string targetDirectory      = baseLocation + "\\" + nameBack + ".zip";
                    string txtPasswordString    = txtPasswordUnico.Text;
                    ProgressDialogResult result = ProgressWindow.Execute(VentanaPrincipal, "Procesando...", () => {
                        resultado = procesarBackupUnico(localDB.cs_prConexioncadenabasedatos(), password, baseLocation, nameBack, fullName, targetDirectory, txtPasswordString);
                    });
                    if (resultado == "1")
                    {
                        System.Windows.Forms.MessageBox.Show("Se ha generado correctamente el backup.\n", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show("Se ha producido un error al procesar el backup.\n" + resultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                ///////
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Seleccione una ruta para generar el archivo backup", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        public clsEntityRetention cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Retention_id                                           = valores[0];
                Cs_tag_Id                                                    = valores[1];
                Cs_tag_IssueDate                                             = valores[2];
                Cs_tag_PartyIdentification_Id                                = valores[3];
                Cs_tag_PartyIdentificacion_SchemeId                          = valores[4];
                Cs_tag_PartyName                                             = valores[5];
                Cs_tag_PostalAddress_Id                                      = valores[6];
                Cs_tag_PostalAddress_StreetName                              = valores[7];
                Cs_tag_PostalAddress_CitySubdivisionName                     = valores[8];
                Cs_tag_PostalAddress_CityName                                = valores[9];
                Cs_tag_PostalAddress_CountrySubEntity                        = valores[10];
                Cs_tag_PostalAddress_District                                = valores[11];
                Cs_tag_PostalAddress_Country_IdentificationCode              = valores[12];
                Cs_tag_PartyLegalEntity_RegistrationName                     = valores[13];
                Cs_tag_ReceiveParty_PartyIdentification_Id                   = valores[14];
                Cs_tag_ReceiveParty_PartyIdentification_SchemeId             = valores[15];
                Cs_tag_ReceiveParty_PartyName_Name                           = valores[16];
                Cs_tag_ReceiveParty_PostalAddress_Id                         = valores[17];
                Cs_tag_ReceiveParty_PostalAddress_StreetName                 = valores[18];
                Cs_tag_ReceiveParty_PostalAddress_CitySubdivisionName        = valores[19];
                Cs_tag_ReceiveParty_PostalAddress_CityName                   = valores[20];
                Cs_tag_ReceiveParty_PostalAddress_CountrySubentity           = valores[21];
                Cs_tag_ReceiveParty_PostalAddress_District                   = valores[22];
                Cs_tag_ReceiveParty_PostalAddress_Country_IdentificationCode = valores[23];
                Cs_tag_ReceiveParty_PartyLegalEntity_RegistrationName        = valores[24];
                Cs_tag_SUNATRetentionSystemCode                              = valores[25];
                Cs_tag_SUNATRetentionPercent                                 = valores[26];
                Cs_tag_Note                                                  = valores[27];
                Cs_tag_TotalInvoiceAmount                                    = valores[28];
                Cs_tag_TotalInvoiceAmount_CurrencyId                         = valores[29];
                Cs_tag_TotalPaid                                             = valores[30];
                Cs_tag_TotalPaid_CurrencyId                                  = valores[31];
                Cs_pr_EstadoSCC                                              = valores[32];
                Cs_pr_EstadoSUNAT                                            = valores[33];
                Cs_pr_ComentarioSUNAT                                        = valores[34];
                Cs_pr_XML                                                    = valores[35];
                Cs_pr_CDR                                                    = valores[36];
                Cs_pr_Reversion                                              = valores[37];
                Cs_pr_Reversion_Anterior                                     = valores[38];
                Cs_pr_FechaEnvio                                             = valores[39];
                Cs_pr_FechaRecepcion                                         = valores[40];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #7
0
        //private clsEntityDatabaseLocal localDB;
        public clsEntityDocument_UBLExtension_ExtensionContent_AdditionalInformation cs_pxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Document_UBLExtension_ExtensionContent_AdditionalInformation_Id = valores[0];
                Cs_pr_Document_Id = valores[1];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #8
0
        public clsEntityDespatch cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Despatch_ID     = valores[0];
                Cs_tag_ID             = valores[1];
                Cs_tag_IssueDate      = valores[2];
                Cs_tag_IssueTime      = valores[3];
                Cs_tag_AdviceTypeCode = valores[4];
                Cs_tag_Note           = valores[5];
                Cs_tag_AdditionalDocumentReference_ID                = valores[6];
                Cs_tag_AdditionalDocumentReference_DocumentType      = valores[7];
                Cs_tag_AdditionalDocumentReference_DocumentTypeCode  = valores[8];
                Cs_tag_DespatchSupParty_CustAssigAccountID           = valores[9];
                Cs_tag_DespatchSupParty_CustAssigAccountID_SchemeID  = valores[10];
                Cs_tag_DespatchSupParty_PartyLegalEntity             = valores[11];
                Cs_tag_DeliveryCustParty_CustAssigAccountID          = valores[12];
                Cs_tag_DeliveryCustParty_CustAssigAccountID_SchemeID = valores[13];
                Cs_tag_DeliveryCustParty_PartyLegalEntity            = valores[14];
                Cs_tag_SellerSupParty_CustAssigAccountID             = valores[15];
                Cs_tag_SellerSupParty_CustAssigAccountID_SchemeID    = valores[16];
                Cs_tag_SellerSupParty_PartyLegalEntity               = valores[17];
                Cs_tag_Ship_HandlingCode = valores[18];
                Cs_tag_Ship_Information  = valores[19];
                Cs_tag_Ship_SplitConsignmentIndicador          = valores[20];
                Cs_tag_Ship_GrossWeightMeasure                 = valores[21];
                Cs_tag_Ship_GrossWeightMeasure_UnitCode        = valores[22];
                Cs_tag_Ship_TotalTransportHandlingUnitQuantity = valores[23];
                Cs_tag_Ship_DeliveryAddress_ID                 = valores[24];
                Cs_tag_Ship_DeliveryAddress_StreetName         = valores[25];
                Cs_tag_Ship_TransHandUnit_ID         = valores[26];
                Cs_tag_Ship_TransHandUnit_Equip_ID   = valores[27];
                Cs_tag_Ship_OriginAddress_ID         = valores[28];
                Cs_tag_Ship_OriginAddress_StreetName = valores[29];
                Cs_pr_EstadoSUNAT     = valores[30];
                Cs_pr_EstadoSCC       = valores[31];
                Cs_pr_XML             = valores[32];
                Cs_pr_CDR             = valores[33];
                Cs_pr_ComentarioSUNAT = valores[34];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #9
0
        //private clsEntityDatabaseLocal localDB;
        public clsEntityDocument_Line_Description cs_pxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Document_Line_Description_Id = valores[0];
                Cs_pr_Document_Line_Id             = valores[1];
                Cs_tag_Description = valores[2];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #10
0
        public clsEntityRange cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Range_Id     = valores[0];
                Cs_pr_Periodo      = valores[1];
                Cs_pr_Declarant_Id = valores[2];
                return(this);
            }
            else
            {
                return(null);
            }
        }
        public clsEntitySummaryDocuments_Notes cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_SummaryDocuments_Notes_Id = valores[0];
                Cs_pr_SummaryDocuments_Id       = valores[1];
                Cs_tag_Note = valores[2];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #12
0
        public clsEntityDespatch_PortLocation cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Despatch_PortLocation_ID = valores[0];
                Cs_pr_Despatch_ID = valores[1];
                Cs_tag_ID         = valores[2];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #13
0
        public clsEntitySummaryDocuments_SummaryDocumentsLine_AllowanceCharge cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_SummaryDocuments_SummaryDocumentsLine_AllowanceCharge_Id = valores[0];
                Cs_pr_SummaryDocuments_SummaryDocumentsLine_Id = valores[1];
                Cs_tag_ChargeIndicator = valores[2];
                Cs_tag_Amount          = valores[3];
                return(this);
            }
            else
            {
                return(null);
            }
        }
        public clsEntitySummaryDocuments_SummaryDocumentsLine_BillingPayment cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_SummaryDocuments_SummaryDocumentsLine_BillingPayment_Id = valores[0];
                Cs_pr_SummaryDocuments_SummaryDocumentsLine_Id = valores[1];
                Cs_tag_PaidAmount    = valores[2];
                Cs_tag_InstructionID = valores[3];
                return(this);
            }
            else
            {
                return(null);
            }
        }
        public clsEntityDespatch_ShipmentStage_Driver cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Despatch_ShipStage_Driver_ID = valores[0];
                Cs_pr_Despatch_ShipStage_ID        = valores[1];
                Cs_tag_Driver_ID       = valores[2];
                Cs_tag_Driver_SchemaID = valores[3];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #16
0
        //private clsEntityDatabaseLocal localDB;
        /// <summary>
        /// Metodo para obtner un registro segun id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public clsEntidadDocument_AdditionalDocumentReference cs_pxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Document_AdditionalDocumentReference_Id = valores[1];
                Cs_pr_Document_Id = valores[1];
                Cs_tag_AdditionalDocumentReference_ID = valores[2];
                Cs_tag_DocumentTypeCode = valores[3];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #17
0
        //private clsEntityDatabaseLocal localDB;
        public clsEntityDocument_Line_PricingReference cs_pxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Document_Line_PricingReference_Id = valores[0];
                Cs_pr_Document_Line_Id        = valores[1];
                Cs_tag_PriceAmount_currencyID = valores[2];
                Cs_tag_PriceTypeCode          = valores[3];
                return(this);
            }
            else
            {
                return(null);
            }
        }
        public clsEntityDespatch_OrderReference cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Despatch_OrderReference_ID = valores[0];
                Cs_pr_Despatch_ID         = valores[1];
                Cs_tag_ID                 = valores[2];
                Cs_tag_OrderTypeCode      = valores[3];
                Cs_tag_OrderTypeCode_Name = valores[4];
                return(this);
            }
            else
            {
                return(null);
            }
        }
        public clsEntityDocument_Line_AdditionalComments cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Document_Line_AdditionalComments_Id = valores[0];
                Cs_pr_Document_Id = valores[1];
                Cs_pr_Document_Line_AdditionalComments_Reference_Id = valores[2];
                Cs_pr_TagNombre = valores[3];
                Cs_pr_TagValor  = valores[4];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #20
0
        //private clsEntityDatabaseLocal localDB;
        public clsEntityDocument_TaxTotal cs_pxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Document_TaxTotal_Id   = valores[0];
                Cs_pr_Document_Id            = valores[1];
                Cs_tag_TaxAmount             = valores[2];
                Cs_tag_TaxSubtotal_TaxAmount = valores[3];
                Cs_tag_TaxSubtotal_TaxCategory_TaxScheme_ID          = valores[4];
                Cs_tag_TaxSubtotal_TaxCategory_TaxScheme_Name        = valores[5];
                Cs_tag_TaxSubtotal_TaxCategory_TaxScheme_TaxTypeCode = valores[6];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #21
0
        public clsEntityDespatch_Line cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Despatch_Line_ID            = valores[0];
                Cs_pr_Despatch_ID                 = valores[1];
                Cs_tag_OrderLineReference         = valores[2];
                Cs_tag_DeliveredQuantity          = valores[3];
                Cs_tag_DeliveredQuantity_UnitCode = valores[4];
                Cs_tag_ItemName = valores[5];
                Cs_tag_Item_SellersItemIdentification_ID = valores[6];
                return(this);
            }
            else
            {
                return(null);
            }
        }
 //private clsEntityDatabaseLocal localDB;
 public clsEntityDocument_UBLExtension_ExtensionContent_AdditionalInformation_AdditionalMonetaryTotal cs_pxObtenerUnoPorId(string id)
 {
     List<string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);
     if (valores.Count > 0)
     {
         Cs_pr_Document_UBLExtension_ExtensionContent_AdditionalInformation_AdditionalMonetaryTotal_Id = valores[0];
         Cs_pr_Document_UBLExtension_ExtensionContent_AdditionalInformation_Id = valores[1];
         Cs_tag_Id = valores[2];
         Cs_tag_Name = valores[3];
         Cs_tag_ReferenceAmount = valores[4];
         Cs_tag_PayableAmount = valores[5];
         Cs_tag_Percent = valores[6];
         Cs_tag_TotalAmount = valores[7];
         Cs_tag_SchemeID = valores[8];
         return this;
     }
     else
     {
         return null;
     }
 }
        public clsEntityDespatch_ShipmentStage cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Despatch_Shipment_ID                          = valores[0];
                Cs_pr_Despatch_ID                                   = valores[1];
                Cs_tag_ship_ShipStage_TraModeCode                   = valores[2];
                Cs_tag_ship_ShipStage_TransitPeriod_StartDate       = valores[3];
                Cs_tag_ship_ShipStage_CarrierParty_PartyID_ID       = valores[4];
                Cs_tag_ship_ShipStage_CarrierParty_PartyID_SchemeID = valores[5];
                Cs_tag_ship_ShipStage_CarrierParty_PartyName        = valores[6];
                Cs_tag_ship_ShipStage_TransportMeans_LicencePlateID = valores[7];
                return(this);
            }
            else
            {
                return(null);
            }
        }
        }                                                       //ID de cabecera de COMPROBANTES (Factura, boleta)
        //private clsEntityDatabaseLocal localDB;
        public clsEntityVoidedDocuments_VoidedDocumentsLine cs_fxObtenerUnoPorId(string Id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, Id, false);

            if (valores.Count > 0)
            {
                Cs_pr_VoidedDocuments_VoidedDocumentsLine_Id = valores[0];
                Cs_pr_VoidedDocuments_Id     = valores[1];
                Cs_tag_LineID                = valores[2];
                Cs_tag_DocumentTypeCode      = valores[3];
                Cs_tag_DocumentSerialID      = valores[4];
                Cs_tag_DocumentNumberID      = valores[5];
                Cs_tag_VoidReasonDescription = valores[6];
                Cs_pr_IDDocumentoRelacionado = valores[7];
                return(this);
            }
            else
            {
                return(null);
            }
        }
        public clsEntityDocument_Advance cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_Document_Advance_Id = valores[0];
                Cs_pr_Document_Id         = valores[1];
                Cs_pr_TagId                 = valores[2];
                Cs_pr_TagPaidAmount         = valores[3];
                Cs_pr_InstructionID         = valores[4];
                Cs_pr_TagPrepaidAmount      = valores[5];
                Cs_pr_Schema_ID             = valores[6];
                Cs_pr_Currency_ID           = valores[7];
                Cs_pr_Instruction_Schema_ID = valores[8];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #26
0
        public clsEntitySummaryDocuments_SummaryDocumentsLine cs_fxObtenerUnoPorId(string id)
        {
            List <string> valores = new clsBaseConexion(localDB).cs_fxObtenerUnoPorId(cs_cmTabla, cs_cmCampos, id, false);

            if (valores.Count > 0)
            {
                Cs_pr_SummaryDocuments_SummaryDocumentsLine_Id = valores[0];
                Cs_pr_SummaryDocuments_Id    = valores[1];
                Cs_tag_LineID                = valores[2];
                Cs_tag_DocumentTypeCode      = valores[3];
                Cs_tag_DocumentSerialID      = valores[4];
                Cs_tag_StartDocumentNumberID = valores[5];
                Cs_tag_EndDocumentNumberID   = valores[6];
                Cs_tag_TotalAmount           = valores[7];
                Cs_tag_ConditionCode         = valores[8];
                return(this);
            }
            else
            {
                return(null);
            }
        }
Beispiel #27
0
        private void cs_pxActualizarEstado()
        {
            clsBaseConexion conexion = new clsBaseConexion();

            cs_prConexionEstado = conexion.cs_fxConexionEstado();
        }
Beispiel #28
0
        private void btnIniciar_Click(object sender, EventArgs e)
        {
            bool regla_login = false, regla_account = false;

            string userid = new clsEntityUsers().cs_pxLogin(this.txtUsuario.Text, this.txtContrasenia.Text);

            if (userid.Length > 0)
            {
                regla_login = true;
            }

            string seleccion_empresa;

            if (cboEmpresa.Enabled == false)
            {
                seleccion_empresa = "";
            }
            else
            {
                seleccion_empresa = cboEmpresa.SelectedValue.ToString();
                clsEntityDatabaseLocal bd            = new clsEntityDatabaseLocal().cs_fxObtenerUnoPorDeclaranteId(seleccion_empresa);
                clsBaseConfiguracion   configuracion = new clsBaseConfiguracion();
                configuracion.cs_prDbms               = bd.Cs_pr_DBMS;
                configuracion.cs_prDbmsdriver         = bd.Cs_pr_DBMSDriver;
                configuracion.cs_prDbmsservidor       = bd.Cs_pr_DBMSServername;
                configuracion.cs_prDbmsservidorpuerto = bd.Cs_pr_DBMSServerport;
                configuracion.cs_prDbnombre           = bd.Cs_pr_DBName;
                configuracion.cs_prDbusuario          = bd.Cs_pr_DBUser;
                configuracion.cs_prDbclave            = bd.Cs_pr_DBPassword;
                configuracion.Cs_pr_Declarant_Id      = seleccion_empresa;
                configuracion.cs_pxActualizar(false);
            }

            clsEntityAccount Profile    = new clsEntityAccount();
            string           Profile_Id = Profile.dgvVerificarCuenta(userid, seleccion_empresa);

            if (Profile_Id != "")
            {
                regla_account = true;
            }

            if (regla_login == true && regla_account == true)
            {
                // this.Close();
                Hide();
                clsBaseConexion con    = new clsBaseConexion();
                bool            estado = con.cs_fxConexionEstadoServidor();
                if (estado == true)
                {
                    bool actualizar = new clsEntityDatabaseLocal().cs_pxSeDebeActualizarBD();
                    if (actualizar)
                    {
                        if (MessageBox.Show("Es necesario actualizar la estructura de la base de datos.Si escoge continuar se realizara ahora, caso contrario puede hacerlo despues utilizando la opcion verificar estructura.\n ¿Desea continuar?", "Verificar estructura - Base de Datos", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                        {
                            new frmLoading().ShowDialog();
                        }
                    }
                }
                new frmSistema(new clsEntityAccount().cs_fxObtenerUnoPorId(Profile_Id)).Show();
            }
            else
            {
                clsBaseMensaje.cs_pxMsgEr("ERR12", "Error de inicio de sesión.");
            }
        }
Beispiel #29
0
        /// <summary>
        /// Evento Ingresar al sistema.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnIngresar_Click(object sender, RoutedEventArgs e)
        {
            //System.Windows.Forms.MessageBox.Show("Todos los comprobantes se agregaron a su respectiva comunicacion de baja","Mensaje",MessageBoxButtons.OK,MessageBoxIcon.Information);
            try
            {
                //txtUsuario.IsKeyboardFocused
                //btnIngresar.IsEnabled = false;          
                regla_login = false; 
                regla_account = false;
                //Obtener si usuario esta registrado.
                userid = new clsEntityUsers().cs_pxLogin(txtUsuario.Text.Trim(), txtPassword.Password.Trim());
                if (userid.Length > 0)
                    regla_login = true;

                //Obtener valor empresa seleccionado.
               
                if (cboEmpresa.IsEnabled == false)
                    seleccion_empresa = "";
                else
                {
                    //En caso no exista una empresa seleccionado
                    if (cboEmpresa.SelectedValue != null)
                    {
                        seleccion_empresa = cboEmpresa.SelectedValue.ToString();
                        //Obtener la configuracion de base de datos para la empresa seleccionada.
                        clsEntityDatabaseLocal bd = new clsEntityDatabaseLocal().cs_fxObtenerUnoPorDeclaranteId(seleccion_empresa);
                        clsBaseConfiguracion configuracion = new clsBaseConfiguracion();
                        configuracion.cs_prDbms = bd.Cs_pr_DBMS;
                        configuracion.cs_prDbmsdriver = bd.Cs_pr_DBMSDriver;
                        configuracion.cs_prDbmsservidor = bd.Cs_pr_DBMSServername;
                        configuracion.cs_prDbmsservidorpuerto = bd.Cs_pr_DBMSServerport;
                        configuracion.cs_prDbnombre = bd.Cs_pr_DBName;
                        configuracion.cs_prDbusuario = bd.Cs_pr_DBUser;
                        configuracion.cs_prDbclave = bd.Cs_pr_DBPassword;
                        configuracion.Cs_pr_Declarant_Id = seleccion_empresa;
                        configuracion.cs_pxActualizar(false);
                    }
                    // seleccion_empresa = cboEmpresa.SelectedValue.ToString();
                }
                //Iniciar instancia del perfil
                Profile = new clsEntityAccount();
                Profile_Id = Profile.dgvVerificarCuenta(userid, seleccion_empresa);
                if (Profile_Id != "")
                    regla_account = true;

                if (regla_login == true && regla_account == true)
                {
                    //Si el login es correcto y pertenece al perfil  
                    clsEntityDatabaseLocal local = new clsEntityDatabaseLocal().cs_fxObtenerUnoPorDeclaranteId(seleccion_empresa);
                    clsEntityDeclarant declarante = new clsEntityDeclarant().cs_pxObtenerUnoPorId(seleccion_empresa);

                    clsBaseConexion con = new clsBaseConexion(local);

                    bool estado = con.cs_fxConexionEstadoServidor();
                    //Si la conexion al servidor de base de datos es correcta
                    Hide();
                    if (estado == true)
                    { // verifica el estado de la base de datos
                        bool actualizar = new clsEntityDatabaseLocal(declarante).cs_pxSeDebeActualizarBD();
                        //Determinar si se debe actualizar, versión antigua
                        if (actualizar)
                        {
                            //Mostrar mensaje para pedir confirmacion de actualizacion de base de datos.
                            if (System.Windows.Forms.MessageBox.Show("Es necesario actualizar la estructura de la base de datos.Si escoge continuar se realizara ahora, caso contrario puede hacerlo despues utilizando la opcion verificar estructura.\n ¿Desea continuar?", "Verificar estructura - Base de Datos", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes)
                            {
                                new Loading(declarante).ShowDialog();
                            }
                        }
                        //Nuevo cambio para actualizar la estructura de la base de datos

                    }
                    // Verificar sí se esta haciendo pruebas

                    //if(DoTest == true)
                    //    new pages.FormPruebas().Show();
                    //else //Cargar la ventana principal
                    //    new MainWindow(new clsEntityAccount().cs_fxObtenerUnoPorId(Profile_Id)).Show();
                }
                else
                {
                    //Mensaje de error en inicio de sesion.                 
                    clsBaseMensaje.cs_pxMsgEr("ERR12", "Error de inicio de sesión.");
                }
            }
            catch (Exception ex)
            {
                clsBaseLog.cs_pxRegistarAdd("btnIngresar " + ex.ToString());
            }
        }