compilation warnings
This commit is contained in:
@ -9,6 +9,7 @@ using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
using System.Threading.Tasks;
|
||||
using Yavsc.Exceptions;
|
||||
public class FSQuotaException : Exception {
|
||||
|
||||
@ -43,16 +44,20 @@ namespace Yavsc.ApiControllers
|
||||
return Ok(files);
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public IEnumerable<IActionResult> Post(string subdir="")
|
||||
{
|
||||
string root = null;
|
||||
|
||||
InvalidPathException pathex = null;
|
||||
try {
|
||||
root = User.InitPostToFileSystem(subdir);
|
||||
} catch (InvalidPathException) {}
|
||||
if (root==null)
|
||||
yield return new BadRequestObjectResult(new { error= "InvalidPathException" });
|
||||
root = User.InitPostToFileSystem(subdir);
|
||||
} catch (InvalidPathException ex) {
|
||||
pathex = ex;
|
||||
}
|
||||
if (pathex!=null)
|
||||
yield return new BadRequestObjectResult(pathex);
|
||||
|
||||
var user = dbContext.Users.Single(
|
||||
u => u.Id == User.GetUserId()
|
||||
);
|
||||
@ -64,5 +69,25 @@ namespace Yavsc.ApiControllers
|
||||
yield return Ok(item);
|
||||
};
|
||||
}
|
||||
|
||||
[HttpDelete]
|
||||
public async Task <IActionResult> Delete (string id)
|
||||
{
|
||||
var user = dbContext.Users.Single(
|
||||
u => u.Id == User.GetUserId()
|
||||
);
|
||||
InvalidPathException pathex = null;
|
||||
string root = null;
|
||||
try {
|
||||
root = User.InitPostToFileSystem(id);
|
||||
} catch (InvalidPathException ex) {
|
||||
pathex = ex;
|
||||
}
|
||||
if (pathex!=null)
|
||||
return new BadRequestObjectResult(pathex);
|
||||
user.DeleteUserFile(id);
|
||||
await dbContext.SaveChangesAsync(User.GetUserId());
|
||||
return Ok(new { deleted=id });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,12 +3,11 @@ using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Exceptions;
|
||||
using Yavsc.Models;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Controllers.Generic
|
||||
{
|
||||
using Exceptions;
|
||||
using Models;
|
||||
[Authorize]
|
||||
public abstract class SettingsController<TSettings> : Controller where TSettings : class, ISpecializationSettings, new()
|
||||
{
|
||||
|
@ -65,7 +65,14 @@ namespace Yavsc.Helpers
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public static void DeleteUserFile(this ApplicationUser user, string fileName)
|
||||
{
|
||||
var root = Path.Combine(Startup.UserFilesDirName, user.UserName);
|
||||
var fi = new FileInfo(Path.Combine(root, fileName));
|
||||
if (!fi.Exists) return ;
|
||||
fi.Delete();
|
||||
user.DiskUsage -= fi.Length;
|
||||
}
|
||||
public static FileRecievedInfo ReceiveUserFile(this ApplicationUser user, string root, IFormFile f)
|
||||
{
|
||||
long usage = user.DiskUsage;
|
||||
|
@ -1,6 +1,4 @@
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Interfaces
|
||||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface ICircleMember: IIdentified<long>
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Data.Entity.Infrastructure;
|
||||
using Microsoft.Data.Entity.Metadata;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
using Yavsc.Models;
|
||||
|
||||
|
@ -9,7 +9,6 @@ namespace Yavsc.Models.Billing
|
||||
{
|
||||
using Models.Workflow;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Workflow;
|
||||
|
||||
public partial class Estimate : IEstimate
|
||||
{
|
||||
|
@ -5,7 +5,6 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Models.Access;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
|
@ -2,7 +2,6 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Models.Workflow;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
|
@ -2,7 +2,6 @@ using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Models.Auth;
|
||||
using Yavsc.Models.Relationship;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Models.Haircut.Views
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Models.IT.Modeling
|
||||
{
|
||||
|
@ -1,6 +1,4 @@
|
||||
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Models.IT.Modeling
|
||||
{
|
||||
public abstract class Letter<T> : ILetter<T>
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Models.Musical.Profiles
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Models.Musical.Profiles
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Workflow;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.Models.Musical.Profiles
|
||||
{
|
||||
|
@ -4,12 +4,11 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Yavsc.Exceptions;
|
||||
using Yavsc.Models;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
using Exceptions;
|
||||
using Models;
|
||||
public partial class Startup
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -28,7 +28,6 @@ namespace Yavsc
|
||||
using System.Net;
|
||||
using Formatters;
|
||||
using Models;
|
||||
using Newtonsoft.Json;
|
||||
using PayPal.Manager;
|
||||
using Services;
|
||||
using ViewModels.Auth.Handlers;
|
||||
|
@ -1,13 +1,12 @@
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.ViewModels.Controls;
|
||||
using Yavsc.ViewModels.Relationship;
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.ViewComponents
|
||||
{
|
||||
using Models;
|
||||
using ViewModels.Controls;
|
||||
using ViewModels.Relationship;
|
||||
public class CirclesControlViewComponent : ViewComponent
|
||||
{
|
||||
ApplicationDbContext dbContext;
|
||||
|
@ -1,5 +1,3 @@
|
||||
using Yavsc;
|
||||
|
||||
namespace Yavsc.ViewModels.Relationship
|
||||
{
|
||||
public class CirclesViewModel
|
||||
|
Reference in New Issue
Block a user