protected void btnAgegar_Click(object sender, EventArgs e)
        {
            if (ValidarUsuario())
            {
                CreaturDatos.Datos.tblUsuario agreUser = new CreaturDatos.Datos.tblUsuario();
                agreUser.Nombre      = txtNombre.Text;
                agreUser.Correo      = txtCorreo.Text;
                agreUser.Contra      = txtContra.Text;
                agreUser.TipoUsuario = cmbTipoUsuario.SelectedValue;

                using (CreaturDatos.Datos.ModelCreaturHotelesContainer con = new Datos.ModelCreaturHotelesContainer())
                {
                    con.tblUsuarios.Add(agreUser);
                    con.SaveChanges();
                    Response.Write(@"<script language='javascript'>alert('Los datos se guardaron con exito');</script>");
                    txtNombre.Text = "";
                    txtCorreo.Text = "";
                    txtContra.Text = "";
                }
            }
        }
        protected void btnAgegar_Click(object sender, EventArgs e)
        {
            if (ValidarUsuario())
            {
                CreaturDatos.Datos.tblUsuario agreUser = new CreaturDatos.Datos.tblUsuario();
                agreUser.Nombre = txtNombre.Text;
                agreUser.Correo = txtCorreo.Text;
                agreUser.Contra = txtContra.Text;
                agreUser.TipoUsuario = cmbTipoUsuario.SelectedValue;

                using (CreaturDatos.Datos.ModelCreaturHotelesContainer con = new Datos.ModelCreaturHotelesContainer())
                {
                    con.tblUsuarios.Add(agreUser);
                    con.SaveChanges();
                    Response.Write(@"<script language='javascript'>alert('Los datos se guardaron con exito');</script>");
                    txtNombre.Text = "";
                    txtCorreo.Text = "";
                    txtContra.Text = "";
                }
            }
        }
Esempio n. 3
0
        protected void btnEnviar_Click1(object sender, EventArgs e)
        {
            CreaturDatos.Datos.tblDatos agreDatos = new Datos.tblDatos();
            {
                DateTime d1 = Convert.ToDateTime(tbFechaCheIn.Text);
                DateTime d2 = Convert.ToDateTime(tbFechaCheOut.Text);
                TimeSpan ds = (d2 - d1);
                tbNoche.Text = Convert.ToString(ds.Days);

                double valor2 = Convert.ToDouble(tbTariBasImpuesInclud.Text);
                double res = (Convert.ToDouble(tbNoche.Text) * valor2);
                tbTotConImpInclud.Text = Convert.ToString(res);
                double valorPorcenGanancia = Convert.ToDouble(tbPorcenGanSobTotalImpuInclud.Text);
                double resPorImporteGanancia = (res * valorPorcenGanancia) / 100;
                tbImporteGanancia.Text = Convert.ToString(resPorImporteGanancia);

                double imporServiAd = Convert.ToDouble(tbImporteServAdicionales.Text);
                double porGaSerAd = Convert.ToDouble(tbPorGananSerAdici.Text);
                double totImportPorcenSerAd = (imporServiAd * porGaSerAd) / 100;
                tbImporGanan.Text = Convert.ToString(totImportPorcenSerAd);

                double cargoServicio = Convert.ToDouble(tbCargoServicio.Text);

                double totFacHospedaje = res + resPorImporteGanancia + cargoServicio + imporServiAd + totImportPorcenSerAd;
                tbTotFactuHospedaje.Text = Convert.ToString(totFacHospedaje);

                /*Empieza datos Agentes*/
                agreDatos.Agente = tbNomAgentes.Text;
                agreDatos.FechaCreacion = tbFechaCreacion.Text;
                agreDatos.Refacturacion = cmbRefac.SelectedValue;
                agreDatos.HK = tbHk.Text;
                agreDatos.GK = tbGk.Text;
                agreDatos.Huesped = tbHuesped.Text;
                agreDatos.Hotel = tbHotel.Text;
                agreDatos.Empresa = tbEmpresa.Text;
                agreDatos.CiudadUbicacionHotel = tbCdHotel.Text;
                agreDatos.Confirmacion = tbConfir.Text;
                agreDatos.FechaCheckIn = Convert.ToDateTime(tbFechaCheIn.Text);
                agreDatos.FechaCheckOut = Convert.ToDateTime(tbFechaCheOut.Text);
                agreDatos.NumeroNoches = Convert.ToInt32(tbNoche.Text);
                agreDatos.TarifaBaseConImpIncluidos = Convert.ToDouble(tbTariBasImpuesInclud.Text);
                agreDatos.TotalConImpIncluidos = Convert.ToDouble(tbTotConImpInclud.Text);
                agreDatos.TotalTarifaBaseHotel = Convert.ToDouble(tbTotTarifHotel.Text);
                agreDatos.ISH = cmbISH.SelectedValue;
                agreDatos.TipoMoneda = tbTipoMoneda.Text;
                agreDatos.PorcenGananSobreTotalImpuestosInclud = Convert.ToDouble(tbPorcenGanSobTotalImpuInclud.Text);
                agreDatos.ServiciosAdicionales = cmbServiAdicionales.SelectedValue;
                agreDatos.CargoServicio = Convert.ToDouble(tbCargoServicio.Text);
                agreDatos.ImporteServicioAdicional = Convert.ToDouble(tbImporteServAdicionales.Text);
                agreDatos.PorcenGananciaSobreServAdicional = Convert.ToDouble(tbPorGananSerAdici.Text);
                agreDatos.ImporteGananciaSobreServicioAdicional = Convert.ToDouble(tbImporGanan.Text);
                agreDatos.ImporteGanancia = Convert.ToDouble(tbImporteGanancia.Text);
                agreDatos.TotalFacHospedaje = Convert.ToDouble(tbTotFactuHospedaje.Text);
                agreDatos.FormaPago = tbForPagoTarje.Text;
                agreDatos.TipoTarifa = tbTipoTarifa.Text;

                using (CreaturDatos.Datos.ModelCreaturHotelesContainer contDat = new Datos.ModelCreaturHotelesContainer())
                {

                    contDat.tblDatos.Add(agreDatos);
                    contDat.SaveChanges();
                    Response.Write(@"<script language='javascript'>alert('Los datos se guardaron con exito');</script>");

                    tbHk.Text = "";
                    tbGk.Text = "";
                    tbHuesped.Text = "";
                    tbHotel.Text = "";
                    tbEmpresa.Text = "";
                    tbCdHotel.Text = "";
                    tbConfir.Text = "";
                    tbFechaCheIn.Text = "";
                    tbFechaCheOut.Text = "";
                    tbNoche.Text = "";
                    tbTariBasImpuesInclud.Text = "";
                    tbTotConImpInclud.Text = "";
                    tbTotFactuHospedaje.Text = "";
                    tbTotTarifHotel.Text = "";
                    tbTipoMoneda.Text = "";
                    tbPorcenGanSobTotalImpuInclud.Text = "";
                    tbPorGananSerAdici.Text = "";
                    tbCargoServicio.Text = "";
                    tbImporteServAdicionales.Text = "";
                    tbImporteServAdicionales.Text = "";
                    tbImporteGanancia.Text = "";
                    tbForPagoTarje.Text = "";

                }
            }
        }
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            CreaturDatos.Datos.tblDatos agreDatos = new Datos.tblDatos();
            {
                DateTime d1 = Convert.ToDateTime(tbFechaCheIn.Text);
                DateTime d2 = Convert.ToDateTime(tbFechaCheOut.Text);
                TimeSpan ds = (d2 - d1);
                tbNoche.Text = Convert.ToString(ds.Days);

                double valor2 = Convert.ToDouble(tbTariBasImpuesInclud.Text);
                double res    = (Convert.ToDouble(tbNoche.Text) * valor2);
                tbTotConImpInclud.Text = Convert.ToString(res);
                double valorPorcenGanancia   = Convert.ToDouble(tbPorcenGanSobTotalImpuInclud.Text);
                double resPorImporteGanancia = (res * valorPorcenGanancia) / 100;
                tbImporteGanancia.Text = Convert.ToString(resPorImporteGanancia);

                double imporServiAd         = Convert.ToDouble(tbImporteServAdicionales.Text);
                double porGaSerAd           = Convert.ToDouble(tbPorGananSerAdici.Text);
                double totImportPorcenSerAd = (imporServiAd * porGaSerAd) / 100;
                tbImporGanan.Text = Convert.ToString(totImportPorcenSerAd);

                double cargoServicio = Convert.ToDouble(tbCargoServicio.Text);

                double totFacHospedaje = res + resPorImporteGanancia + cargoServicio + imporServiAd + totImportPorcenSerAd;
                tbTotFactuHospedaje.Text = Convert.ToString(totFacHospedaje);

                agreDatos.FacturaProveedor            = tbFactProveedor.Text;
                agreDatos.ObservacionesAdministracion = tbObserAdministracion.Text;
                /*Empieza los datos exclsuivos de ingresos*/
                agreDatos.NumFacturaCreatur  = tbFacCreatur.Text;
                agreDatos.ObservacionIngreso = tbObserIngresos.Text;
                /*Empieza datos Admin*/
                agreDatos.FacturaEfectiva = cmbFacEfectivo.SelectedValue;
                /*Empieza datos Agentes*/
                agreDatos.Agente                                = cmbNombreAgente.SelectedValue;
                agreDatos.FechaCreacion                         = tbFechaCreacion.Text;
                agreDatos.Refacturacion                         = cmbRefac.SelectedValue;
                agreDatos.HK                                    = tbHk.Text;
                agreDatos.GK                                    = tbGk.Text;
                agreDatos.Huesped                               = tbHuesped.Text;
                agreDatos.Hotel                                 = tbHotel.Text;
                agreDatos.Empresa                               = tbEmpresa.Text;
                agreDatos.CiudadUbicacionHotel                  = tbCdHotel.Text;
                agreDatos.Confirmacion                          = tbConfir.Text;
                agreDatos.FechaCheckIn                          = Convert.ToDateTime(tbFechaCheIn.Text);
                agreDatos.FechaCheckOut                         = Convert.ToDateTime(tbFechaCheOut.Text);
                agreDatos.NumeroNoches                          = Convert.ToInt32(tbNoche.Text);
                agreDatos.TarifaBaseConImpIncluidos             = Convert.ToDouble(tbTariBasImpuesInclud.Text);
                agreDatos.TotalConImpIncluidos                  = Convert.ToDouble(tbTotConImpInclud.Text);
                agreDatos.TotalTarifaBaseHotel                  = Convert.ToDouble(tbTotTarifHotel.Text);
                agreDatos.ISH                                   = cmbISH.SelectedValue;
                agreDatos.TipoMoneda                            = tbTipoMoneda.Text;
                agreDatos.PorcenGananSobreTotalImpuestosInclud  = Convert.ToDouble(tbPorcenGanSobTotalImpuInclud.Text);
                agreDatos.ServiciosAdicionales                  = cmbServiAdicionales.SelectedValue;
                agreDatos.CargoServicio                         = Convert.ToDouble(tbCargoServicio.Text);
                agreDatos.ImporteServicioAdicional              = Convert.ToDouble(tbImporteServAdicionales.Text);
                agreDatos.PorcenGananciaSobreServAdicional      = Convert.ToDouble(tbPorGananSerAdici.Text);
                agreDatos.ImporteGananciaSobreServicioAdicional = Convert.ToDouble(tbImporGanan.Text);
                agreDatos.ImporteGanancia                       = Convert.ToDouble(tbImporteGanancia.Text);
                agreDatos.TotalFacHospedaje                     = Convert.ToDouble(tbTotFactuHospedaje.Text);
                agreDatos.FormaPago                             = tbForPagoTarje.Text;
                agreDatos.TipoTarifa                            = tbTipoTarifa.Text;
                /*Empieza Calidad*/
                agreDatos.NumRechazadosDeTarjetas = tbNumTarRech.Text;
                /*Empieza Direccion*/
                agreDatos.ReservaEfectiva      = tbResEfectiva.Text;
                agreDatos.ImporteCobrarHtl     = tbImpoCobrarHtl.Text;
                agreDatos.FOPFinal             = tbFopFinal.Text;
                agreDatos.ObservacionDireccion = tbObserAdministracion.Text;



                using (CreaturDatos.Datos.ModelCreaturHotelesContainer contDat = new Datos.ModelCreaturHotelesContainer())
                {
                    contDat.tblDatos.Add(agreDatos);
                    contDat.SaveChanges();
                    Response.Write(@"<script language='javascript'>alert('Los datos se guardaron con exito');</script>");
                    tbObserAdministracion.Text = "";
                    tbResEfectiva.Text         = "";
                    tbImpoCobrarHtl.Text       = "";
                    tbFactProveedor.Text       = "";
                    tbObserIngresos.Text       = "";
                    tbObserDirec.Text          = "";
                    tbNumTarRech.Text          = "";
                    tbFacCreatur.Text          = "";
                    tbHk.Text                          = "";
                    tbGk.Text                          = "";
                    tbHuesped.Text                     = "";
                    tbHotel.Text                       = "";
                    tbEmpresa.Text                     = "";
                    tbCdHotel.Text                     = "";
                    tbConfir.Text                      = "";
                    tbFechaCheIn.Text                  = "";
                    tbFechaCheOut.Text                 = "";
                    tbNoche.Text                       = "";
                    tbTariBasImpuesInclud.Text         = "";
                    tbTotConImpInclud.Text             = "";
                    tbTotFactuHospedaje.Text           = "";
                    tbTotTarifHotel.Text               = "";
                    tbTipoMoneda.Text                  = "";
                    tbPorcenGanSobTotalImpuInclud.Text = "";
                    tbPorGananSerAdici.Text            = "";
                    tbCargoServicio.Text               = "";
                    tbImporteServAdicionales.Text      = "";
                    tbImporteServAdicionales.Text      = "";
                    tbImporteGanancia.Text             = "";
                    tbForPagoTarje.Text                = "";
                    tbFopFinal.Text                    = "";
                }
            }
        }