Exemplo n.º 1
0
 private void GenerarInfoExportacion(FeaEntidades.InterFacturas.comprobante comp, FeaEntidades.InterFacturas.informacion_comprobante infcomprob)
 {
     FeaEntidades.InterFacturas.informacion_exportacion ie = new FeaEntidades.InterFacturas.informacion_exportacion();
     bool exportacion = false;
     if (IdNaturalezaComprobanteTextBox.Text != "Compra")
     {
         int auxPV = Convert.ToInt32(((DropDownList)PuntoVtaDropDownList).SelectedValue);
         try
         {
             if (Funciones.SessionTimeOut(Session))
             {
                 Response.Redirect("~/SessionTimeout.aspx");
             }
             else
             {
                 string idtipo = ((Entidades.Sesion)Session["Sesion"]).UN.PuntosVta.Find(delegate(Entidades.PuntoVta pv)
                 {
                     return pv.Nro == auxPV;
                 }).IdTipoPuntoVta;
                 string tipoComp = Tipo_De_ComprobanteDropDownList.SelectedValue;
                 string tipoExp = TipoExpDropDownList.SelectedValue;
                 if (idtipo.Equals("Exportacion"))
                 {
                     if (tipoComp.Equals("19"))
                     {
                         if (PaisDestinoExpDropDownList.SelectedValue.Equals("0"))
                         {
                             throw new Exception("El país destino de exportación es obligatorio");
                         }
                         if (IncotermsDropDownList.SelectedValue.Equals(string.Empty))
                         {
                             throw new Exception("Incoterms es obligatorio");
                         }
                         if (tipoExp.Equals("0"))
                         {
                             throw new Exception("El tipo de exportación es obligatorio");
                         }
                         if (IdiomaDropDownList.SelectedValue.Equals("0"))
                         {
                             throw new Exception("El idioma es obligatorio");
                         }
                     }
                     else //NC y ND
                     {
                         if (PaisDestinoExpDropDownList.SelectedValue.Equals("0"))
                         {
                             throw new Exception("El país destino de exportación es obligatorio");
                         }
                         if (tipoExp.Equals("0"))
                         {
                             throw new Exception("El tipo de exportación es obligatorio");
                         }
                         if (IdiomaDropDownList.SelectedValue.Equals("0"))
                         {
                             throw new Exception("El idioma es obligatorio");
                         }
                     }
                 }
             }
         }
         catch (System.NullReferenceException)
         {
         }
         if (!PaisDestinoExpDropDownList.SelectedValue.Equals("0"))
         {
             ie.destino_comprobante = Convert.ToInt32(PaisDestinoExpDropDownList.SelectedValue);
             exportacion = true;
         }
         if (!IncotermsDropDownList.SelectedValue.Equals(string.Empty))
         {
             ie.incoterms = IncotermsDropDownList.SelectedValue;
             exportacion = true;
         }
         if (!TipoExpDropDownList.SelectedValue.Equals("0"))
         {
             ie.tipo_exportacion = Convert.ToInt32(TipoExpDropDownList.SelectedValue);
             exportacion = true;
         }
         if (!IdiomaDropDownList.SelectedValue.Equals("0"))
         {
             comp.extensionesSpecified = true;
             comp.extensiones = new FeaEntidades.InterFacturas.extensiones();
             comp.extensiones.extensiones_camara_facturasSpecified = true;
             comp.extensiones.extensiones_camara_facturas = new FeaEntidades.InterFacturas.extensionesExtensiones_camara_facturas();
             comp.extensiones.extensiones_camara_facturas.id_idioma = IdiomaDropDownList.SelectedValue;
             exportacion = true;
         }
     }
     if (exportacion)
     {
         GenerarInfoPermisosExportacion(ie, infcomprob);
         infcomprob.informacion_exportacion = ie;
     }
 }
Exemplo n.º 2
0
		private void GenerarInfoExportacion(FeaEntidades.InterFacturas.comprobante comp, FeaEntidades.InterFacturas.informacion_comprobante infcomprob)
		{
			FeaEntidades.InterFacturas.informacion_exportacion ie = new FeaEntidades.InterFacturas.informacion_exportacion();
			bool exportacion = false;
			if (CedWebRN.Fun.EstaLogueadoUnUsuarioPremium((CedWebEntidades.Sesion)Session["Sesion"]))
			{
				int auxPV = Convert.ToInt32(((TextBox)Punto_VentaTextBox).Text);
				try
				{
					string idtipo = ((CedWebEntidades.Sesion)Session["Sesion"]).Cuenta.Vendedor.PuntosDeVenta.Find(delegate(CedWebEntidades.PuntoDeVenta pv)
					{
						return pv.Id == auxPV;
					}).IdTipo;
					string tipoComp = Tipo_De_ComprobanteDropDownList.SelectedValue;
					string tipoExp = TipoExpDropDownList.SelectedValue;
					if (idtipo.Equals("Export"))
					{
						if (tipoComp.Equals("19"))
						{
							if (PaisDestinoExpDropDownList.SelectedValue.Equals("0"))
							{
								throw new Exception("El país destino de exportación es obligatorio");
							}
							if (IncotermsDropDownList.SelectedValue.Equals(string.Empty))
							{
								throw new Exception("Incoterms es obligatorio");
							}
							if (tipoExp.Equals("0"))
							{
								throw new Exception("El tipo de exportación es obligatorio");
							}
							if (IdiomaDropDownList.SelectedValue.Equals("0"))
							{
								throw new Exception("El idioma es obligatorio");
							}
						}
						else //NC y ND
						{
							if (PaisDestinoExpDropDownList.SelectedValue.Equals("0"))
							{
								throw new Exception("El país destino de exportación es obligatorio");
							}
							if (tipoExp.Equals("0"))
							{
								throw new Exception("El tipo de exportación es obligatorio");
							}
							if (IdiomaDropDownList.SelectedValue.Equals("0"))
							{
								throw new Exception("El idioma es obligatorio");
							}
						}
					}
				}
				catch (System.NullReferenceException)
				{
				}
			}

			if (!PaisDestinoExpDropDownList.SelectedValue.Equals("0"))
			{
				ie.destino_comprobante = Convert.ToInt32(PaisDestinoExpDropDownList.SelectedValue);
				exportacion = true;
			}
			if (!IncotermsDropDownList.SelectedValue.Equals(string.Empty))
			{
				ie.incoterms = IncotermsDropDownList.SelectedValue;
				exportacion = true;
			}
			if (!TipoExpDropDownList.SelectedValue.Equals("0"))
			{
				ie.tipo_exportacion = Convert.ToInt32(TipoExpDropDownList.SelectedValue);
				exportacion = true;
			}
			if (!IdiomaDropDownList.SelectedValue.Equals("0"))
			{
				comp.extensionesSpecified = true;
				comp.extensiones = new FeaEntidades.InterFacturas.extensiones();
				comp.extensiones.extensiones_camara_facturasSpecified = true;
				comp.extensiones.extensiones_camara_facturas = new FeaEntidades.InterFacturas.extensionesExtensiones_camara_facturas();
				comp.extensiones.extensiones_camara_facturas.id_idioma = IdiomaDropDownList.SelectedValue;
				exportacion = true;
			}

			GenerarInfoPermisosExportacion(ie, infcomprob);

			if (exportacion)
			{
				infcomprob.informacion_exportacion = ie;
			}
		}