Пример #1
0
    protected void rptEmpresaServicio_OnItemCommand(object sender, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "Votar")
        {
            HiddenField hdnIdEmpresaServicio = new HiddenField();
            hdnIdEmpresaServicio = (HiddenField)e.Item.FindControl("hdnIdEmpresaServicio");

            RadioButtonList rdblNotas = new RadioButtonList();
            rdblNotas = (RadioButtonList)e.Item.FindControl("rdblNotas");

            bool retorno = false;

            YouCom.DTO.Servicio.RankingServicioDTO theRankingServicioDTO = new YouCom.DTO.Servicio.RankingServicioDTO();

            YouCom.DTO.Servicio.EmpresaServicioDTO myEmpresaServicioDTO = new YouCom.DTO.Servicio.EmpresaServicioDTO();
            myEmpresaServicioDTO.IdEmpresaServicio      = decimal.Parse(hdnIdEmpresaServicio.Value);
            theRankingServicioDTO.TheEmpresaServicioDTO = myEmpresaServicioDTO;

            theRankingServicioDTO.Nota         = int.Parse(rdblNotas.SelectedValue);
            theRankingServicioDTO.FechaRanking = DateTime.Now;

            theRankingServicioDTO.TheComunidadDTO  = myUsuario.TheComunidadSeleccionDTO;
            theRankingServicioDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO;

            YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO();

            myFamiliaDTO = YouCom.bll.FamiliaBLL.detalleFamiliabyRut(myUsuario.Rut);
            theRankingServicioDTO.TheFamiliaDTO = myFamiliaDTO;

            theRankingServicioDTO.UsuarioIngreso = myUsuario.Rut;

            retorno = YouCom.bll.RankingServicioBLL.Insert(theRankingServicioDTO);

            if (retorno)
            {
                if (!Page.ClientScript.IsClientScriptBlockRegistered("SET"))
                {
                    string script = "alert('Estimado Cliente, hemos recibido su votación, en breve nos contactaremos con usted.');";
                    script += "parent.location = '" + YouCom.Service.Configuracion.Config.getPageName(true) + "';";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "SET", script, true);
                }
            }
        }
    }
Пример #2
0
    protected bool setEnviaServicio()
    {
        bool retorno = false;
        bool salida  = false;

        ServiciosDTO theServiciosDTO = new ServiciosDTO();

        theServiciosDTO.NombreServicio      = this.txtServicioNombre.Text.ToUpper();
        theServiciosDTO.DescripcionServicio = this.txtServicioDescripcion.Text.ToUpper();

        theServiciosDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO;
        theServiciosDTO.TheComunidadDTO  = myUsuario.TheComunidadSeleccionDTO;

        YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO();
        myCategoriaDTO.IdCategoria      = decimal.Parse(ddlCategoria.SelectedValue);
        theServiciosDTO.TheCategoriaDTO = myCategoriaDTO;

        theServiciosDTO.FechaInicio  = DateTime.ParseExact(this.FechaInicio.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
        theServiciosDTO.FechaTermino = DateTime.ParseExact(this.FechaTermino.Text + " " + DateTime.Now.ToString("HH:mm"), "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

        theServiciosDTO.UsuarioIngreso = myUsuario.Rut;

        retorno = YouCom.bll.ServiciosBLL.Insert(theServiciosDTO);

        if (retorno)
        {
            YouCom.DTO.Servicio.EmpresaServicioDTO theEmpresaServicioDTO = new YouCom.DTO.Servicio.EmpresaServicioDTO();
            theEmpresaServicioDTO.RutEmpresaServicio         = this.txtRutEmpresa.Text.ToUpper();
            theEmpresaServicioDTO.RazonSocialEmpresaServicio = this.txtNombreEmpresa.Text.ToUpper();
            theEmpresaServicioDTO.TelefonoEmpresaServicio    = this.txtTelefono.Text;
            theEmpresaServicioDTO.UrlEmpresaServicio         = this.txtURL.Text;
            theEmpresaServicioDTO.CelularEmpresaServicio     = this.txtCelular.Text;
            theEmpresaServicioDTO.DireccionEmpresaServicio   = this.txtDireccion.Text;
            theEmpresaServicioDTO.EmailEmpresaServicio       = this.txtEmail.Text;

            YouCom.DTO.ComunaDTO myComunaDTO = new YouCom.DTO.ComunaDTO();
            myComunaDTO.IdComuna = decimal.Parse(ddlComuna.SelectedValue);
            theEmpresaServicioDTO.TheComunaDTO = myComunaDTO;

            YouCom.DTO.CiudadDTO myCiudadDTO = new YouCom.DTO.CiudadDTO();
            myCiudadDTO.IdCiudad = decimal.Parse(ddlCiudad.SelectedValue);
            theEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO = myCiudadDTO;

            YouCom.DTO.RegionDTO myRegionDTO = new YouCom.DTO.RegionDTO();
            myRegionDTO.IdRegion = decimal.Parse(ddlRegion.SelectedValue);
            theEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO.TheRegionDTO = myRegionDTO;

            YouCom.DTO.PaisDTO myPaisDTO = new YouCom.DTO.PaisDTO();
            myPaisDTO.IdPais = decimal.Parse(ddlPais.SelectedValue);
            theEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO.TheRegionDTO.ThePaisDTO = myPaisDTO;

            theEmpresaServicioDTO.TheCondominioDTO = myUsuario.TheCondominioSeleccionDTO;
            theEmpresaServicioDTO.TheComunidadDTO  = myUsuario.TheComunidadSeleccionDTO;

            theEmpresaServicioDTO.TheServiciosDTO = theServiciosDTO;

            if (this.FileImagenServicio.HasFile)
            {
                theEmpresaServicioDTO.LogoEmpresaServicio = this.ProcessOtherFile(FileImagenServicio, null, YouCom.Service.Generales.General.GetPropiedad("UploadsPathServiciosPub"));
            }

            salida = YouCom.bll.EmpresaServicioBLL.Insert(theEmpresaServicioDTO);

            salida = true;
        }

        return(salida);
    }