mirror of
https://github.com/farcasclaudiu/myfriendsaround.git
synced 2026-06-29 13:02:05 +03:00
Settings Page (in work)
Fixing Web hosting in Azure
This commit is contained in:
@@ -8,7 +8,7 @@ using MyFriendsAround.Data.BLL;
|
||||
|
||||
namespace MyFriendsAround.Web.Controllers
|
||||
{
|
||||
[HandleError]
|
||||
//[HandleError]
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
|
||||
@@ -52,6 +52,10 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<HintPath>..\Libs\Sql\Microsoft.SqlServer.Types.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.Entity" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Security" />
|
||||
@@ -99,7 +103,9 @@
|
||||
<Content Include="myfriends.svc" />
|
||||
<Content Include="Scripts\GoogleMapping.js" />
|
||||
<Content Include="Scripts\GoogleMapping.min.js" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</Content>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<div id="header">
|
||||
<div id="title">
|
||||
<h1>My Friend Around</h1>
|
||||
<h1>My Friends Around</h1>
|
||||
</div>
|
||||
|
||||
<div id="logindisplay">
|
||||
|
||||
@@ -8,12 +8,14 @@
|
||||
<connectionStrings>
|
||||
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|myfriendsaround.mdf;User Instance=true" providerName="System.Data.SqlClient" />
|
||||
<!--<add name="myfriendsaroundConnectionString" connectionString="Data Source=ewzculop8c.database.windows.net;Initial Catalog=myfriendsaround;User ID=user;Password=password" providerName="System.Data.SqlClient" />-->
|
||||
<add name="MyFriendsModelContainer" connectionString="metadata=res://*/MyFriendsModel.csdl|res://*/MyFriendsModel.ssdl|res://*/MyFriendsModel.msl;provider=System.Data.SqlClient;provider connection string="data source=ewzculop8c.database.windows.net;initial catalog=myfriendsaround;user id=user;password=password;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
|
||||
<add name="MyFriendsModelContainer"
|
||||
connectionString="metadata=res://*/MyFriendsModel.csdl|res://*/MyFriendsModel.ssdl|res://*/MyFriendsModel.msl;provider=System.Data.SqlClient;provider connection string="Server=ewzculop8c.database.windows.net;Database=myfriendsaround;User ID=[USER]@ewzculop8c;Password=[PASSWORD];Trusted_Connection=False;Encrypt=True"" providerName="System.Data.EntityClient" />
|
||||
</connectionStrings>
|
||||
|
||||
<appSettings>
|
||||
<add key="ClientValidationEnabled" value="true" />
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||
<add key="takeTopFriends" value="20" />
|
||||
</appSettings>
|
||||
|
||||
<system.web>
|
||||
@@ -64,6 +66,9 @@
|
||||
<add namespace="System.Web.WebPages" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
|
||||
<!--show detailed error-->
|
||||
<customErrors mode="Off" />
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.Text;
|
||||
using MyFriendsAround.Common.Entities;
|
||||
using MyFriendsAround.Data;
|
||||
using MyFriendsAround.Data.BLL;
|
||||
using System.Web.Configuration;
|
||||
|
||||
namespace MyFriendsAround.Web
|
||||
{
|
||||
@@ -27,6 +28,14 @@ namespace MyFriendsAround.Web
|
||||
return FriendsRepository.GetFriends();
|
||||
}
|
||||
|
||||
[OperationContract]
|
||||
[WebGet(ResponseFormat = WebMessageFormat.Json)]
|
||||
public List<Friend> GetFriends(int skip)
|
||||
{
|
||||
int take = Convert.ToInt32(WebConfigurationManager.AppSettings["takeTopFriends"]);
|
||||
return FriendsRepository.GetFriends(skip, take);
|
||||
}
|
||||
|
||||
|
||||
[OperationContract]
|
||||
[WebInvoke(ResponseFormat = WebMessageFormat.Json, Method = "POST")]
|
||||
@@ -34,6 +43,13 @@ namespace MyFriendsAround.Web
|
||||
{
|
||||
return FriendsRepository.PublishLocation(friend);
|
||||
}
|
||||
|
||||
[OperationContract]
|
||||
[WebInvoke(ResponseFormat = WebMessageFormat.Json, Method = "POST")]
|
||||
public bool UpdatePicture(string userId, byte[] userPicture)
|
||||
{
|
||||
return FriendsRepository.UpdatePicture(userId, userPicture);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user