EF7 npgsql => ko aux clients => inutile en lib [obsdnx]
This commit is contained in:
@ -1,13 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace Yavsc.Models.Relationship
|
|
||||||
{
|
|
||||||
public class LocationType
|
|
||||||
{
|
|
||||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
public string Name { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -18,10 +18,6 @@
|
|||||||
<tags>yavsc</tags>
|
<tags>yavsc</tags>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="Yavsc.Abstract" version="$version$" />
|
<dependency id="Yavsc.Abstract" version="$version$" />
|
||||||
<dependency id="Microsoft.Extensions.Logging" version="1.0.0-rc1-final" />
|
|
||||||
<dependency id="Microsoft.Extensions.Logging.Console" version="1.0.0-rc1-final" />
|
|
||||||
<dependency id="Microsoft.Extensions.Logging.Debug" version="1.0.0-rc1-final" />
|
|
||||||
<dependency id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.0.0-rc1-final" />
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNet.Hosting.Server;
|
|
||||||
using Microsoft.AspNet.Http.Features;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Yavsc.Models;
|
|
||||||
|
|
||||||
namespace Yavsc.Server
|
|
||||||
{
|
|
||||||
public class YavscServerFactory : IServerFactory
|
|
||||||
{
|
|
||||||
public IFeatureCollection Initialize(IConfiguration configuration)
|
|
||||||
{
|
|
||||||
FeatureCollection featureCollection = new FeatureCollection();
|
|
||||||
return featureCollection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IDisposable Start(IFeatureCollection serverFeatures, Func<IFeatureCollection, Task> application)
|
|
||||||
{
|
|
||||||
var task = application(serverFeatures);
|
|
||||||
return task;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -45,25 +45,12 @@
|
|||||||
"defaultNamespace": "Yavsc"
|
"defaultNamespace": "Yavsc"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Authentication.Facebook": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.Authentication.OAuth": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.Hosting": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.Http.Extensions": "1.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.Identity": "3.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
|
|
||||||
"Newtonsoft.Json": "9.0.1",
|
"Newtonsoft.Json": "9.0.1",
|
||||||
"Gapi.net45": "1.0.0",
|
"Gapi.net45": "1.0.0",
|
||||||
"PayPalMerchant-net451": "2.7.109",
|
"PayPalMerchant-net451": "2.7.109",
|
||||||
"MailKit": "1.12.0",
|
"MailKit": "1.12.0",
|
||||||
"EntityFramework.Commands": "7.0.0-rc1-final",
|
|
||||||
"Microsoft.AspNet.Localization": "1.0.0-rc1-final",
|
|
||||||
"EntityFramework7.Npgsql": "3.1.0-rc1-3",
|
|
||||||
"EntityFramework7.Npgsql.Design": "3.1.0-rc1-5",
|
|
||||||
"Microsoft.CodeAnalysis.CSharp": "1.1.0-rc1-20151109-01",
|
"Microsoft.CodeAnalysis.CSharp": "1.1.0-rc1-20151109-01",
|
||||||
"Yavsc.Abstract": { "version": "1.0.5-rc18-alpha1", "target": "package" }
|
"Yavsc.Abstract": {}
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"dnx451": {
|
"dnx451": {
|
||||||
|
File diff suppressed because it is too large
Load Diff
36
Yavsc/ApiControllers/accounting/ProfileApiController.cs
Normal file
36
Yavsc/ApiControllers/accounting/ProfileApiController.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using Microsoft.AspNet.Identity;
|
||||||
|
using Microsoft.AspNet.Authorization;
|
||||||
|
using Microsoft.AspNet.Mvc;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yavsc.Models;
|
||||||
|
using Yavsc.Models.Auth;
|
||||||
|
using Yavsc.Helpers;
|
||||||
|
using System.Linq;
|
||||||
|
using Microsoft.Data.Entity;
|
||||||
|
using Microsoft.AspNet.Identity.EntityFramework;
|
||||||
|
|
||||||
|
namespace Yavsc.ApiControllers.accounting
|
||||||
|
{
|
||||||
|
[Route("~/api/profile")]
|
||||||
|
public class ProfileApiController: Controller
|
||||||
|
{
|
||||||
|
UserManager<ApplicationUser> _userManager;
|
||||||
|
ApplicationDbContext _dbContext;
|
||||||
|
public ProfileApiController(ApplicationDbContext dbContext, UserManager<ApplicationUser> userManager)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
_userManager = userManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("memail/{allow}")]
|
||||||
|
public async Task<object> SetMonthlyEmail(bool allow)
|
||||||
|
{
|
||||||
|
var user = await _userManager.FindByIdAsync(User.GetUserId());
|
||||||
|
user.AllowMonthlyEmail = allow;
|
||||||
|
_dbContext.SaveChanges(User.GetUserId());
|
||||||
|
return Ok(new { monthlyEmailPrefSaved = allow });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -120,7 +120,8 @@ namespace Yavsc.Controllers
|
|||||||
DiskQuota = user.DiskQuota,
|
DiskQuota = user.DiskQuota,
|
||||||
DedicatedCalendarId = user.DedicatedGoogleCalendar,
|
DedicatedCalendarId = user.DedicatedGoogleCalendar,
|
||||||
EMail = user.Email,
|
EMail = user.Email,
|
||||||
EmailConfirmed = await _userManager.IsEmailConfirmedAsync(user)
|
EmailConfirmed = await _userManager.IsEmailConfirmedAsync(user),
|
||||||
|
AllowMonthlyEmail = user.AllowMonthlyEmail
|
||||||
};
|
};
|
||||||
model.HaveProfessionalSettings = _dbContext.Performers.Any(x => x.PerformerId == user.Id);
|
model.HaveProfessionalSettings = _dbContext.Performers.Any(x => x.PerformerId == user.Id);
|
||||||
var usrActs = _dbContext.UserActivities.Include(a=>a.Does).Where(a=> a.UserId == user.Id).ToArray();
|
var usrActs = _dbContext.UserActivities.Include(a=>a.Does).Where(a=> a.UserId == user.Id).ToArray();
|
||||||
@ -128,9 +129,31 @@ namespace Yavsc.Controllers
|
|||||||
var usrActToSet = usrActs.Where( a => ( a.Settings == null && a.Does.SettingsClassName != null )).ToArray();
|
var usrActToSet = usrActs.Where( a => ( a.Settings == null && a.Does.SettingsClassName != null )).ToArray();
|
||||||
model.HaveActivityToConfigure = usrActToSet .Count()>0;
|
model.HaveActivityToConfigure = usrActToSet .Count()>0;
|
||||||
model.Activity = _dbContext.UserActivities.Include(a=>a.Does).Where(u=>u.UserId == user.Id).ToList();
|
model.Activity = _dbContext.UserActivities.Include(a=>a.Does).Where(u=>u.UserId == user.Id).ToList();
|
||||||
|
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<IActionResult> ProfileEMailUsage ()
|
||||||
|
{
|
||||||
|
var user = await GetCurrentUserAsync();
|
||||||
|
return View("ProfileEMailUsage", new ProfileEMailUsageViewModel(user));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IActionResult> ProfileEMailUsage (ProfileEMailUsageViewModel model)
|
||||||
|
{
|
||||||
|
if (!ModelState.IsValid)
|
||||||
|
{
|
||||||
|
return View(model);
|
||||||
|
}
|
||||||
|
// Generate the token and send it
|
||||||
|
var user = await GetCurrentUserAsync();
|
||||||
|
user.AllowMonthlyEmail = model.Allow;
|
||||||
|
await this._dbContext.SaveChangesAsync(User.GetUserId());
|
||||||
|
|
||||||
|
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.SetMonthlyEmailSuccess });
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// POST: /Manage/RemoveLogin
|
// POST: /Manage/RemoveLogin
|
||||||
@ -581,10 +604,10 @@ namespace Yavsc.Controllers
|
|||||||
{
|
{
|
||||||
if (uid == model.PerformerId)
|
if (uid == model.PerformerId)
|
||||||
{
|
{
|
||||||
bool addrexists = _dbContext.Map.Any(x => model.OrganizationAddress.Id == x.Id);
|
bool addrexists = _dbContext.Locations.Any(x => model.OrganizationAddress.Id == x.Id);
|
||||||
if (!addrexists)
|
if (!addrexists)
|
||||||
{
|
{
|
||||||
_dbContext.Map.Add(model.OrganizationAddress);
|
_dbContext.Locations.Add(model.OrganizationAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_dbContext.Performers.Any(p=>p.PerformerId == uid))
|
if (_dbContext.Performers.Any(p=>p.PerformerId == uid))
|
||||||
|
@ -44,7 +44,7 @@ namespace Yavsc.Controllers
|
|||||||
// GET: Users/Create
|
// GET: Users/Create
|
||||||
public IActionResult Create()
|
public IActionResult Create()
|
||||||
{
|
{
|
||||||
ViewData["PostalAddressId"] = new SelectList(_context.Map, "Id", "PostalAddress");
|
ViewData["PostalAddressId"] = new SelectList(_context.Locations, "Id", "PostalAddress");
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ namespace Yavsc.Controllers
|
|||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return RedirectToAction("Index");
|
return RedirectToAction("Index");
|
||||||
}
|
}
|
||||||
ViewData["PostalAddressId"] = new SelectList(_context.Map, "Id", "PostalAddress", applicationUser.PostalAddressId);
|
ViewData["PostalAddressId"] = new SelectList(_context.Locations, "Id", "PostalAddress", applicationUser.PostalAddressId);
|
||||||
return View(applicationUser);
|
return View(applicationUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ namespace Yavsc.Controllers
|
|||||||
{
|
{
|
||||||
return HttpNotFound();
|
return HttpNotFound();
|
||||||
}
|
}
|
||||||
ViewData["PostalAddressId"] = new SelectList(_context.Map, "Id", "PostalAddress", applicationUser.PostalAddressId);
|
ViewData["PostalAddressId"] = new SelectList(_context.Locations, "Id", "PostalAddress", applicationUser.PostalAddressId);
|
||||||
return View(applicationUser);
|
return View(applicationUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ namespace Yavsc.Controllers
|
|||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return RedirectToAction("Index");
|
return RedirectToAction("Index");
|
||||||
}
|
}
|
||||||
ViewData["PostalAddressId"] = new SelectList(_context.Map, "Id", "PostalAddress", applicationUser.PostalAddressId);
|
ViewData["PostalAddressId"] = new SelectList(_context.Locations, "Id", "PostalAddress", applicationUser.PostalAddressId);
|
||||||
return View(applicationUser);
|
return View(applicationUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,120 +0,0 @@
|
|||||||
using System.Linq;
|
|
||||||
using Microsoft.AspNet.Mvc;
|
|
||||||
|
|
||||||
namespace Yavsc.Controllers
|
|
||||||
{
|
|
||||||
using System.Security.Claims;
|
|
||||||
using Models;
|
|
||||||
using Models.Relationship;
|
|
||||||
public class LocationTypesController : Controller
|
|
||||||
{
|
|
||||||
private ApplicationDbContext _context;
|
|
||||||
|
|
||||||
public LocationTypesController(ApplicationDbContext context)
|
|
||||||
{
|
|
||||||
_context = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: LocationTypes
|
|
||||||
public IActionResult Index()
|
|
||||||
{
|
|
||||||
return View(_context.LocationType.ToList());
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: LocationTypes/Details/5
|
|
||||||
public IActionResult Details(long? id)
|
|
||||||
{
|
|
||||||
if (id == null)
|
|
||||||
{
|
|
||||||
return HttpNotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
LocationType locationType = _context.LocationType.Single(m => m.Id == id);
|
|
||||||
if (locationType == null)
|
|
||||||
{
|
|
||||||
return HttpNotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
return View(locationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: LocationTypes/Create
|
|
||||||
public IActionResult Create()
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST: LocationTypes/Create
|
|
||||||
[HttpPost]
|
|
||||||
[ValidateAntiForgeryToken]
|
|
||||||
public IActionResult Create(LocationType locationType)
|
|
||||||
{
|
|
||||||
if (ModelState.IsValid)
|
|
||||||
{
|
|
||||||
_context.LocationType.Add(locationType);
|
|
||||||
_context.SaveChanges(User.GetUserId());
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
return View(locationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: LocationTypes/Edit/5
|
|
||||||
public IActionResult Edit(long? id)
|
|
||||||
{
|
|
||||||
if (id == null)
|
|
||||||
{
|
|
||||||
return HttpNotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
LocationType locationType = _context.LocationType.Single(m => m.Id == id);
|
|
||||||
if (locationType == null)
|
|
||||||
{
|
|
||||||
return HttpNotFound();
|
|
||||||
}
|
|
||||||
return View(locationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST: LocationTypes/Edit/5
|
|
||||||
[HttpPost]
|
|
||||||
[ValidateAntiForgeryToken]
|
|
||||||
public IActionResult Edit(LocationType locationType)
|
|
||||||
{
|
|
||||||
if (ModelState.IsValid)
|
|
||||||
{
|
|
||||||
_context.Update(locationType);
|
|
||||||
_context.SaveChanges(User.GetUserId());
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
return View(locationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: LocationTypes/Delete/5
|
|
||||||
[ActionName("Delete")]
|
|
||||||
public IActionResult Delete(long? id)
|
|
||||||
{
|
|
||||||
if (id == null)
|
|
||||||
{
|
|
||||||
return HttpNotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
LocationType locationType = _context.LocationType.Single(m => m.Id == id);
|
|
||||||
if (locationType == null)
|
|
||||||
{
|
|
||||||
return HttpNotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
return View(locationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST: LocationTypes/Delete/5
|
|
||||||
[HttpPost, ActionName("Delete")]
|
|
||||||
[ValidateAntiForgeryToken]
|
|
||||||
public IActionResult DeleteConfirmed(long id)
|
|
||||||
{
|
|
||||||
LocationType locationType = _context.LocationType.Single(m => m.Id == id);
|
|
||||||
_context.LocationType.Remove(locationType);
|
|
||||||
_context.SaveChanges(User.GetUserId());
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user