Beispiel #1
0
        public clsDatosEmpresa CargarDatosEmpresa()
        {
            clsDatosEmpresa DatosEmpresa = new clsDatosEmpresa();
            DataSet         Datos        = new DataSet();

            FG.MakeRecordSet(Datos, "SELECT * FROM DatosEmpresa", "");
            if (Datos.Tables[0].Rows.Count != 0)
            {
                DatosEmpresa.NombreEmpresa = Datos.Tables[0].Rows[0]["NombreEmpresa"].ToString();
                DatosEmpresa.Direccion     = Datos.Tables[0].Rows[0]["Direccion"].ToString();
                DatosEmpresa.Telefono      = Datos.Tables[0].Rows[0]["Telefono"].ToString();
                DatosEmpresa.Email         = Datos.Tables[0].Rows[0]["Email"].ToString();
                DatosEmpresa.Ruc           = Datos.Tables[0].Rows[0]["Ruc"].ToString();
                if (Datos.Tables[0].Rows[0]["Logo"] != System.DBNull.Value)
                {
                    DatosEmpresa.Logo = (byte[])Datos.Tables[0].Rows[0]["Logo"];
                }
            }
            else
            {
                DatosEmpresa.NombreEmpresa = "Empty";
            }

            return(DatosEmpresa);
        }
Beispiel #2
0
        public void AgregarActualizarDatosEmpresa(clsDatosEmpresa DatosEmpresa, string IdentityUser)
        {
            if (HttpContext.Current.User == null)
            {
                return;
            }
            string UUA = HttpContext.Current.User.Identity.Name;

            FG.IniciarProcedimiento("SP_DatosEmpresaCrearActualizar");
            FG.AgregarParametroProcedimiento("@NombreEmpresa", SqlDbType.NVarChar, DatosEmpresa.NombreEmpresa);
            FG.AgregarParametroProcedimiento("@Direccion", SqlDbType.NVarChar, DatosEmpresa.Direccion);
            FG.AgregarParametroProcedimiento("@Telefono", SqlDbType.NVarChar, DatosEmpresa.Telefono);
            FG.AgregarParametroProcedimiento("@Email", SqlDbType.NVarChar, DatosEmpresa.Email);
            FG.AgregarParametroProcedimiento("@Ruc", SqlDbType.NVarChar, DatosEmpresa.Ruc);
            if (DatosEmpresa.Logo != null)
            {
                FG.AgregarParametroProcedimiento("@Logo", SqlDbType.Image, DatosEmpresa.Logo);
            }
            else
            {
                FG.AgregarParametroProcedimiento("@Logo", SqlDbType.Image, DBNull.Value);
            }

            FG.AgregarParametroProcedimiento("@UUA", SqlDbType.NVarChar, UUA);
            FG.AgregarParametroProcedimiento("@IdentityUser", SqlDbType.NVarChar, IdentityUser);
            FG.EjecutarProcedimiento();
        }
Beispiel #3
0
        public void CargarDatosEmpresa(XtraReport Reporte)
        {
            /*Cargamos los datos de la empresa*/
            clsDatosEmpresa DatosEmpresa = new clsDatosEmpresa();

            DatosEmpresa = Neg.CargarDatosEmpresa();
            Reporte.FindControl("lblNombreEmpresa", true).Text = DatosEmpresa.NombreEmpresa;
            Reporte.FindControl("lblDireccion", true).Text     = DatosEmpresa.Direccion;
            Reporte.FindControl("lblTelefono", true).Text      = DatosEmpresa.Telefono;
            if (DatosEmpresa.Logo != null)
            {
                ((XRPictureBox)Reporte.FindControl("picLogo", true)).Image = Image.FromStream(new MemoryStream(DatosEmpresa.Logo));
            }
            /**********************************/
        }