コード例 #1
0
        public EscritorioController()
        {
            ImageHelper = new UploadImages();
            List <ConfiguracionesModel> config = new ConfigurationsController().GetListConfiguraciones();

            usuario_imagen_path       = config.Find(parametro => parametro.Parametro_Descripcion == "RUTA DE IMAGENES DE PERFILES DE USUARIOS").Parametro_Varchar_1;
            publicaciones_imagen_path = config.Find(parametro => parametro.Parametro_Descripcion == "RUTA DE IMAGENES DE PUBLICACIONES").Parametro_Varchar_1;
        }
コード例 #2
0
        public bool UpdateUsuarioEmpresaPerfil(string empresa_id, string miembro_id, string territorio_id, string nombre, string correo, string web, string puesto, byte[] logo)
        {
            try
            {
                string fotoNombre = null;
                if (logo != null && logo.Length != 0)
                {
                    fotoNombre = Guid.NewGuid().ToString() + ".png";
                    string empresa_imagen_path = new ConfigurationsController().GetListConfiguraciones().Find(parametro => parametro.Parametro_Descripcion == "RUTA DE IMAGENES DE PERFILES DE EMPRESAS").Parametro_Varchar_1;
                    var    result = new UploadImages().UploadBitmapAsync(fotoNombre, logo, empresa_imagen_path);
                    if (!result)
                    {
                        return(false);
                    }
                }
                conn.Open();
                //transaction = conn.BeginTransaction();
                command             = CreateCommand();
                command.Connection  = conn;
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = "sp_cat_Usuarios_Empresas_Perfil";
                command.Parameters.AddWithValue("@Empresa_Miembro_Id", empresa_id);
                command.Parameters.AddWithValue("@Miembro_Id", miembro_id);
                command.Parameters.AddWithValue("@Territorio_Id", territorio_id);
                command.Parameters.AddWithValue("@Empresa_Miembro_Nombre", nombre);
                command.Parameters.AddWithValue("@Empresa_Miembro_Correo_Electronico", correo);
                command.Parameters.AddWithValue("@Empresa_Miembro_Pagina_Web", web);
                command.Parameters.AddWithValue("@Empresa_Miembro_Logotipo", fotoNombre);
                command.Parameters.AddWithValue("@Miembro_Puesto", puesto);

                //command.Transaction = transaction;
                command.ExecuteNonQuery();
                //transaction.Commit();
            }
            catch (Exception e)
            {
                SlackLogs.SendMessage(e.Message, GetType().Name, "UpdateUsuarioEmpresaPerfil");
                //transaction.Rollback();
                return(false);
            }
            finally { conn.Close(); }
            return(true);
        }