diff --git a/BookAStar/BookAStar/BookAStar.csproj b/BookAStar/BookAStar/BookAStar.csproj index a18bdd2d..146909fd 100644 --- a/BookAStar/BookAStar/BookAStar.csproj +++ b/BookAStar/BookAStar/BookAStar.csproj @@ -1,5 +1,5 @@  - + 10.0 @@ -25,7 +25,8 @@ TRACE;DEBUG;DEV prompt 4 - + + pdbonly @@ -34,7 +35,8 @@ TRACE prompt 4 - + + @@ -46,7 +48,6 @@ - @@ -232,6 +233,7 @@ UserListView.xaml + @@ -501,12 +503,6 @@ Designer - - - {67f9d3a8-f71e-4428-913f-c37ae82cdb24} - YavscLib - - diff --git a/BookAStar/BookAStar/BookAStar.sln b/BookAStar/BookAStar/BookAStar.sln new file mode 100644 index 00000000..58e4e3c3 --- /dev/null +++ b/BookAStar/BookAStar/BookAStar.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookAStar", "BookAStar.csproj", "{A0815650-0A0A-47B0-8826-771F0E1AD137}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A0815650-0A0A-47B0-8826-771F0E1AD137}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0815650-0A0A-47B0-8826-771F0E1AD137}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0815650-0A0A-47B0-8826-771F0E1AD137}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0815650-0A0A-47B0-8826-771F0E1AD137}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Yavsc/ApiControllers/AccountController.cs b/Yavsc/ApiControllers/AccountController.cs index bbc82cb8..5e06548f 100644 --- a/Yavsc/ApiControllers/AccountController.cs +++ b/Yavsc/ApiControllers/AccountController.cs @@ -12,8 +12,9 @@ namespace Yavsc.WebApi.Controllers using ViewModels.Account; using Models.Auth; using Yavsc.Helpers; + using System; - [Authorize,Route("~/api/account")] + [Authorize,Route("~/api/account"),Obsolete] public class ApiAccountController : Controller { diff --git a/Yavsc/ApiControllers/BookQueryApiController.cs b/Yavsc/ApiControllers/BookQueryApiController.cs index 073b8fe6..efb52b01 100644 --- a/Yavsc/ApiControllers/BookQueryApiController.cs +++ b/Yavsc/ApiControllers/BookQueryApiController.cs @@ -10,7 +10,6 @@ using Microsoft.Extensions.Logging; namespace Yavsc.Controllers { using System; - using Yavsc.Model; using Yavsc.Models.Messaging; using Yavsc.Models; using Yavsc.Models.Booking; diff --git a/Yavsc/ApiControllers/CircleApiController.cs b/Yavsc/ApiControllers/CircleApiController.cs new file mode 100644 index 00000000..a5fbe226 --- /dev/null +++ b/Yavsc/ApiControllers/CircleApiController.cs @@ -0,0 +1,148 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Http; +using Microsoft.AspNet.Mvc; +using Microsoft.Data.Entity; +using Yavsc.Models; +using Yavsc.Models.Relationship; + +namespace Yavsc.Controllers +{ + [Produces("application/json")] + [Route("api/cirle")] + public class CircleApiController : Controller + { + private ApplicationDbContext _context; + + public CircleApiController(ApplicationDbContext context) + { + _context = context; + } + + // GET: api/CircleApi + [HttpGet] + public IEnumerable GetCircle() + { + return _context.Circle; + } + + // GET: api/CircleApi/5 + [HttpGet("{id}", Name = "GetCircle")] + public async Task GetCircle([FromRoute] long id) + { + if (!ModelState.IsValid) + { + return HttpBadRequest(ModelState); + } + + Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); + + if (circle == null) + { + return HttpNotFound(); + } + + return Ok(circle); + } + + // PUT: api/CircleApi/5 + [HttpPut("{id}")] + public async Task PutCircle([FromRoute] long id, [FromBody] Circle circle) + { + if (!ModelState.IsValid) + { + return HttpBadRequest(ModelState); + } + + if (id != circle.Id) + { + return HttpBadRequest(); + } + + _context.Entry(circle).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateConcurrencyException) + { + if (!CircleExists(id)) + { + return HttpNotFound(); + } + else + { + throw; + } + } + + return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + } + + // POST: api/CircleApi + [HttpPost] + public async Task PostCircle([FromBody] Circle circle) + { + if (!ModelState.IsValid) + { + return HttpBadRequest(ModelState); + } + + _context.Circle.Add(circle); + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateException) + { + if (CircleExists(circle.Id)) + { + return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + } + else + { + throw; + } + } + + return CreatedAtRoute("GetCircle", new { id = circle.Id }, circle); + } + + // DELETE: api/CircleApi/5 + [HttpDelete("{id}")] + public async Task DeleteCircle([FromRoute] long id) + { + if (!ModelState.IsValid) + { + return HttpBadRequest(ModelState); + } + + Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); + if (circle == null) + { + return HttpNotFound(); + } + + _context.Circle.Remove(circle); + await _context.SaveChangesAsync(); + + return Ok(circle); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + _context.Dispose(); + } + base.Dispose(disposing); + } + + private bool CircleExists(long id) + { + return _context.Circle.Count(e => e.Id == id) > 0; + } + } +} \ No newline at end of file diff --git a/Yavsc/ApiControllers/CircleMemberApiController.cs b/Yavsc/ApiControllers/CircleMemberApiController.cs new file mode 100644 index 00000000..2b64a07e --- /dev/null +++ b/Yavsc/ApiControllers/CircleMemberApiController.cs @@ -0,0 +1,148 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Http; +using Microsoft.AspNet.Mvc; +using Microsoft.Data.Entity; +using Yavsc.Models; +using Yavsc.Models.Relationship; + +namespace Yavsc.Controllers +{ + [Produces("application/json")] + [Route("api/circlemember")] + public class CircleMemberApiController : Controller + { + private ApplicationDbContext _context; + + public CircleMemberApiController(ApplicationDbContext context) + { + _context = context; + } + + // GET: api/CircleMemberApi + [HttpGet] + public IEnumerable GetCircleMembers() + { + return _context.CircleMembers; + } + + // GET: api/CircleMemberApi/5 + [HttpGet("{id}", Name = "GetCircleMember")] + public async Task GetCircleMember([FromRoute] long id) + { + if (!ModelState.IsValid) + { + return HttpBadRequest(ModelState); + } + + CircleMember circleMember = await _context.CircleMembers.SingleAsync(m => m.Id == id); + + if (circleMember == null) + { + return HttpNotFound(); + } + + return Ok(circleMember); + } + + // PUT: api/CircleMemberApi/5 + [HttpPut("{id}")] + public async Task PutCircleMember([FromRoute] long id, [FromBody] CircleMember circleMember) + { + if (!ModelState.IsValid) + { + return HttpBadRequest(ModelState); + } + + if (id != circleMember.Id) + { + return HttpBadRequest(); + } + + _context.Entry(circleMember).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateConcurrencyException) + { + if (!CircleMemberExists(id)) + { + return HttpNotFound(); + } + else + { + throw; + } + } + + return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + } + + // POST: api/CircleMemberApi + [HttpPost] + public async Task PostCircleMember([FromBody] CircleMember circleMember) + { + if (!ModelState.IsValid) + { + return HttpBadRequest(ModelState); + } + + _context.CircleMembers.Add(circleMember); + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateException) + { + if (CircleMemberExists(circleMember.Id)) + { + return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + } + else + { + throw; + } + } + + return CreatedAtRoute("GetCircleMember", new { id = circleMember.Id }, circleMember); + } + + // DELETE: api/CircleMemberApi/5 + [HttpDelete("{id}")] + public async Task DeleteCircleMember([FromRoute] long id) + { + if (!ModelState.IsValid) + { + return HttpBadRequest(ModelState); + } + + CircleMember circleMember = await _context.CircleMembers.SingleAsync(m => m.Id == id); + if (circleMember == null) + { + return HttpNotFound(); + } + + _context.CircleMembers.Remove(circleMember); + await _context.SaveChangesAsync(); + + return Ok(circleMember); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + _context.Dispose(); + } + base.Dispose(disposing); + } + + private bool CircleMemberExists(long id) + { + return _context.CircleMembers.Count(e => e.Id == id) > 0; + } + } +} \ No newline at end of file diff --git a/Yavsc/ApiControllers/PdfEstimateController.cs b/Yavsc/ApiControllers/PdfEstimateController.cs index d16fc18e..cf0a8bee 100644 --- a/Yavsc/ApiControllers/PdfEstimateController.cs +++ b/Yavsc/ApiControllers/PdfEstimateController.cs @@ -16,6 +16,7 @@ namespace Yavsc.ApiControllers using Microsoft.Extensions.Localization; using Yavsc.Services; using Yavsc.Models.Messaging; + using Yavsc.ViewModels; [Route("api/pdfestimate"), Authorize] public class PdfEstimateController : Controller diff --git a/Yavsc/ApiControllers/PostTagsApiController.cs b/Yavsc/ApiControllers/PostTagsApiController.cs index b3eb9290..a2e268e7 100644 --- a/Yavsc/ApiControllers/PostTagsApiController.cs +++ b/Yavsc/ApiControllers/PostTagsApiController.cs @@ -3,10 +3,12 @@ using System.Linq; using Microsoft.AspNet.Http; using Microsoft.AspNet.Mvc; using Microsoft.Data.Entity; -using Yavsc.Models; namespace Yavsc.Controllers { + using Models; + using Models.Relationship; + [Produces("application/json")] [Route("~/api/PostTagsApi")] public class PostTagsApiController : Controller diff --git a/Yavsc/ApiControllers/TagsApiController.cs b/Yavsc/ApiControllers/TagsApiController.cs index 088a22cd..8f24f0e9 100644 --- a/Yavsc/ApiControllers/TagsApiController.cs +++ b/Yavsc/ApiControllers/TagsApiController.cs @@ -7,6 +7,7 @@ using Yavsc.Models; namespace Yavsc.Controllers { + using Models.Relationship; [Produces("application/json")] [Route("api/TagsApi")] public class TagsApiController : Controller diff --git a/Yavsc/Controllers/CircleController.cs b/Yavsc/Controllers/CircleController.cs index a6f78d88..b1bc133d 100644 --- a/Yavsc/Controllers/CircleController.cs +++ b/Yavsc/Controllers/CircleController.cs @@ -1,40 +1,43 @@ using System.Linq; +using System.Threading.Tasks; using Microsoft.AspNet.Mvc; +using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.Data.Entity; using Yavsc.Models; +using Yavsc.Models.Relationship; namespace Yavsc.Controllers { - [ServiceFilter(typeof(LanguageActionFilter))] public class CircleController : Controller { private ApplicationDbContext _context; public CircleController(ApplicationDbContext context) { - _context = context; + _context = context; } // GET: Circle - public IActionResult Index() + public async Task Index() { - return View(_context.CircleMembers.ToList()); + return View(await _context.Circle.ToListAsync()); } // GET: Circle/Details/5 - public IActionResult Details(long? id) + public async Task Details(long? id) { if (id == null) { return HttpNotFound(); } - CircleMember circleMember = _context.CircleMembers.Single(m => m.Id == id); - if (circleMember == null) + Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); + if (circle == null) { return HttpNotFound(); } - return View(circleMember); + return View(circle); } // GET: Circle/Create @@ -46,73 +49,73 @@ namespace Yavsc.Controllers // POST: Circle/Create [HttpPost] [ValidateAntiForgeryToken] - public IActionResult Create(CircleMember circleMember) + public async Task Create(Circle circle) { if (ModelState.IsValid) { - _context.CircleMembers.Add(circleMember); - _context.SaveChanges(); + _context.Circle.Add(circle); + await _context.SaveChangesAsync(); return RedirectToAction("Index"); } - return View(circleMember); + return View(circle); } // GET: Circle/Edit/5 - public IActionResult Edit(long? id) + public async Task Edit(long? id) { if (id == null) { return HttpNotFound(); } - CircleMember circleMember = _context.CircleMembers.Single(m => m.Id == id); - if (circleMember == null) + Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); + if (circle == null) { return HttpNotFound(); } - return View(circleMember); + return View(circle); } // POST: Circle/Edit/5 [HttpPost] [ValidateAntiForgeryToken] - public IActionResult Edit(CircleMember circleMember) + public async Task Edit(Circle circle) { if (ModelState.IsValid) { - _context.Update(circleMember); - _context.SaveChanges(); + _context.Update(circle); + await _context.SaveChangesAsync(); return RedirectToAction("Index"); } - return View(circleMember); + return View(circle); } // GET: Circle/Delete/5 [ActionName("Delete")] - public IActionResult Delete(long? id) + public async Task Delete(long? id) { if (id == null) { return HttpNotFound(); } - CircleMember circleMember = _context.CircleMembers.Single(m => m.Id == id); - if (circleMember == null) + Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); + if (circle == null) { return HttpNotFound(); } - return View(circleMember); + return View(circle); } // POST: Circle/Delete/5 [HttpPost, ActionName("Delete")] [ValidateAntiForgeryToken] - public IActionResult DeleteConfirmed(long id) + public async Task DeleteConfirmed(long id) { - CircleMember circleMember = _context.CircleMembers.Single(m => m.Id == id); - _context.CircleMembers.Remove(circleMember); - _context.SaveChanges(); + Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); + _context.Circle.Remove(circle); + await _context.SaveChangesAsync(); return RedirectToAction("Index"); } } diff --git a/Yavsc/Controllers/CircleMemberController.cs b/Yavsc/Controllers/CircleMemberController.cs new file mode 100644 index 00000000..de14f13a --- /dev/null +++ b/Yavsc/Controllers/CircleMemberController.cs @@ -0,0 +1,122 @@ +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; +using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.Data.Entity; +using Yavsc.Models; +using Yavsc.Models.Relationship; + +namespace Yavsc.Controllers +{ + public class CircleMemberController : Controller + { + private ApplicationDbContext _context; + + public CircleMemberController(ApplicationDbContext context) + { + _context = context; + } + + // GET: CircleMember + public async Task Index() + { + return View(await _context.CircleMembers.ToListAsync()); + } + + // GET: CircleMember/Details/5 + public async Task Details(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + CircleMember circleMember = await _context.CircleMembers.SingleAsync(m => m.Id == id); + if (circleMember == null) + { + return HttpNotFound(); + } + + return View(circleMember); + } + + // GET: CircleMember/Create + public IActionResult Create() + { + return View(); + } + + // POST: CircleMember/Create + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Create(CircleMember circleMember) + { + if (ModelState.IsValid) + { + _context.CircleMembers.Add(circleMember); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + return View(circleMember); + } + + // GET: CircleMember/Edit/5 + public async Task Edit(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + CircleMember circleMember = await _context.CircleMembers.SingleAsync(m => m.Id == id); + if (circleMember == null) + { + return HttpNotFound(); + } + return View(circleMember); + } + + // POST: CircleMember/Edit/5 + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit(CircleMember circleMember) + { + if (ModelState.IsValid) + { + _context.Update(circleMember); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + return View(circleMember); + } + + // GET: CircleMember/Delete/5 + [ActionName("Delete")] + public async Task Delete(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + CircleMember circleMember = await _context.CircleMembers.SingleAsync(m => m.Id == id); + if (circleMember == null) + { + return HttpNotFound(); + } + + return View(circleMember); + } + + // POST: CircleMember/Delete/5 + [HttpPost, ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(long id) + { + CircleMember circleMember = await _context.CircleMembers.SingleAsync(m => m.Id == id); + _context.CircleMembers.Remove(circleMember); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + } +} diff --git a/Yavsc/Controllers/CommandController.cs b/Yavsc/Controllers/CommandController.cs index 62c82b9b..84fc5980 100644 --- a/Yavsc/Controllers/CommandController.cs +++ b/Yavsc/Controllers/CommandController.cs @@ -17,6 +17,8 @@ using Yavsc.Services; namespace Yavsc.Controllers { + using Models.Relationship; + [ServiceFilter(typeof(LanguageActionFilter))] public class CommandController : Controller { diff --git a/Yavsc/Controllers/EstimateController.cs b/Yavsc/Controllers/EstimateController.cs index 594508bf..0a45422a 100644 --- a/Yavsc/Controllers/EstimateController.cs +++ b/Yavsc/Controllers/EstimateController.cs @@ -13,6 +13,7 @@ using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Billing; using Yavsc.Models.Booking; +using Yavsc.ViewModels; namespace Yavsc.Controllers { diff --git a/Yavsc/Controllers/ManageController.cs b/Yavsc/Controllers/ManageController.cs index e078c7cb..b533399b 100644 --- a/Yavsc/Controllers/ManageController.cs +++ b/Yavsc/Controllers/ManageController.cs @@ -23,6 +23,8 @@ using Yavsc.Models.Identity; namespace Yavsc.Controllers { + using Models.Relationship; + [Authorize, ServiceFilter(typeof(LanguageActionFilter))] public class ManageController : Controller { diff --git a/Yavsc/Helpers/CompanyInfoHelpers.cs b/Yavsc/Helpers/CompanyInfoHelpers.cs index f37b53f5..148a7207 100644 --- a/Yavsc/Helpers/CompanyInfoHelpers.cs +++ b/Yavsc/Helpers/CompanyInfoHelpers.cs @@ -1,10 +1,10 @@ using System.Net.Http; using System.Threading.Tasks; using Newtonsoft.Json.Linq; -using Yavsc.Model.societe.com; namespace Yavsc.Helpers { + using Models.societe.com; public static class ComapnyInfoHelpers {  public static async Task CheckSiren(this HttpClient web, string siren, CompanyInfoSettings api) diff --git a/Yavsc/Interfaces/IBookQueryData.cs b/Yavsc/Interfaces/IBookQueryData.cs index 49f8aa03..17874334 100644 --- a/Yavsc/Interfaces/IBookQueryData.cs +++ b/Yavsc/Interfaces/IBookQueryData.cs @@ -2,7 +2,8 @@ namespace Yavsc.Interfaces { - using Yavsc.Models.Messaging; + using Models.Relationship; + using Models.Messaging; public interface IBookQueryData { ClientProviderInfo Client { get; set; } diff --git a/Yavsc/Models/ApplicationDbContext.cs b/Yavsc/Models/ApplicationDbContext.cs index 72ae394c..567877a6 100644 --- a/Yavsc/Models/ApplicationDbContext.cs +++ b/Yavsc/Models/ApplicationDbContext.cs @@ -1,4 +1,4 @@ - + using System; using System.Linq; using System.Threading.Tasks; @@ -243,5 +243,7 @@ namespace Yavsc.Models AddTimestamps(); return await base.SaveChangesAsync(); } + + public DbSet Circle { get; set; } } } diff --git a/Yavsc/Models/Booking/RendezVous.cs b/Yavsc/Models/Booking/RendezVous.cs index 3a0dfe0f..0ca7ad88 100644 --- a/Yavsc/Models/Booking/RendezVous.cs +++ b/Yavsc/Models/Booking/RendezVous.cs @@ -5,10 +5,10 @@ using Yavsc.Models.Market; namespace Yavsc.Models.Booking { + using Models.Relationship; /// /// A date, between two persons /// - public class RendezVous: Service { // Haut les mains. diff --git a/Yavsc/Models/Calendar/PositionAndKeyphrase.cs b/Yavsc/Models/Calendar/PositionAndKeyphrase.cs index 650679a7..094e40bf 100644 --- a/Yavsc/Models/Calendar/PositionAndKeyphrase.cs +++ b/Yavsc/Models/Calendar/PositionAndKeyphrase.cs @@ -23,6 +23,7 @@ namespace Yavsc.Models.Calendar { + using Models.Relationship; /// /// Position and keyphrase. /// diff --git a/Yavsc/Models/Forms/Form.cs b/Yavsc/Models/Forms/Form.cs index 4e615e20..fea5f470 100644 --- a/Yavsc/Models/Forms/Form.cs +++ b/Yavsc/Models/Forms/Form.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace Yavsc.Model.Forms +namespace Yavsc.Models.Forms { using Interfaces; diff --git a/Yavsc/Models/Identity/ApplicationUser.cs b/Yavsc/Models/Identity/ApplicationUser.cs index 944a3d23..a10e69f5 100644 --- a/Yavsc/Models/Identity/ApplicationUser.cs +++ b/Yavsc/Models/Identity/ApplicationUser.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; using Microsoft.AspNet.Identity.EntityFramework; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using Yavsc.Models.Identity; -using Yavsc.Models.Chat; -using Yavsc.Models.Bank; -using Yavsc.Models.Access; namespace Yavsc.Models { + using Models.Relationship; + using Models.Identity; + using Models.Chat; + using Models.Bank; + using Models.Access; public class ApplicationUser : IdentityUser { /// diff --git a/Yavsc/Models/Messaging/BookQueryEvent.cs b/Yavsc/Models/Messaging/BookQueryEvent.cs index 05a80b95..d7544aa3 100644 --- a/Yavsc/Models/Messaging/BookQueryEvent.cs +++ b/Yavsc/Models/Messaging/BookQueryEvent.cs @@ -1,7 +1,6 @@ namespace Yavsc.Models.Messaging { -using Yavsc.Model; // // BookQueryEvent.cs diff --git a/Yavsc/Models/Messaging/BookQueryProviderInfo.cs b/Yavsc/Models/Messaging/BookQueryProviderInfo.cs index 9290c894..72859999 100644 --- a/Yavsc/Models/Messaging/BookQueryProviderInfo.cs +++ b/Yavsc/Models/Messaging/BookQueryProviderInfo.cs @@ -1,8 +1,9 @@ using System; -namespace Yavsc.Model +namespace Yavsc.Models { using Models.Messaging; + using Models.Relationship; public class BookQueryProviderInfo { diff --git a/Yavsc/Models/Messaging/CircleEvent.cs b/Yavsc/Models/Messaging/CircleEvent.cs index ad9de407..c85b90cd 100644 --- a/Yavsc/Models/Messaging/CircleEvent.cs +++ b/Yavsc/Models/Messaging/CircleEvent.cs @@ -24,6 +24,7 @@ using System.ComponentModel.DataAnnotations; namespace Yavsc.Models.Messaging { + using Models.Relationship; /// /// Event pub. /// diff --git a/Yavsc/Models/Messaging/ClientProviderInfo.cs b/Yavsc/Models/Messaging/ClientProviderInfo.cs index 3f9aebec..19b206a6 100644 --- a/Yavsc/Models/Messaging/ClientProviderInfo.cs +++ b/Yavsc/Models/Messaging/ClientProviderInfo.cs @@ -2,6 +2,7 @@ using System.ComponentModel.DataAnnotations; namespace Yavsc.Models.Messaging { + using Models.Relationship; public class ClientProviderInfo { public string UserName { get; set; } diff --git a/Yavsc/Models/Relationship/Circle.cs b/Yavsc/Models/Relationship/Circle.cs index fbdb1ebf..563976ab 100644 --- a/Yavsc/Models/Relationship/Circle.cs +++ b/Yavsc/Models/Relationship/Circle.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; -namespace Yavsc.Models +namespace Yavsc.Models.Relationship { public partial class Circle { [Key, DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] diff --git a/Yavsc/Models/Relationship/CircleMember.cs b/Yavsc/Models/Relationship/CircleMember.cs index f77241ad..8644c66c 100644 --- a/Yavsc/Models/Relationship/CircleMember.cs +++ b/Yavsc/Models/Relationship/CircleMember.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Yavsc.Models +namespace Yavsc.Models.Relationship { public partial class CircleMember diff --git a/Yavsc/Models/Relationship/Contact.cs b/Yavsc/Models/Relationship/Contact.cs index 0dea2092..50b9154a 100644 --- a/Yavsc/Models/Relationship/Contact.cs +++ b/Yavsc/Models/Relationship/Contact.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; -namespace Yavsc.Models +namespace Yavsc.Models.Relationship { public class Contact { diff --git a/Yavsc/Models/Relationship/Location.cs b/Yavsc/Models/Relationship/Location.cs index 42e4f72d..19005cb2 100644 --- a/Yavsc/Models/Relationship/Location.cs +++ b/Yavsc/Models/Relationship/Location.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Yavsc +namespace Yavsc.Models.Relationship { /// diff --git a/Yavsc/Models/Relationship/PostTag.cs b/Yavsc/Models/Relationship/PostTag.cs index a0774598..56695020 100644 --- a/Yavsc/Models/Relationship/PostTag.cs +++ b/Yavsc/Models/Relationship/PostTag.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations.Schema; -namespace Yavsc.Models +namespace Yavsc.Models.Relationship { public partial class PostTag { diff --git a/Yavsc/Models/Relationship/Tag.cs b/Yavsc/Models/Relationship/Tag.cs index ceffce21..ae5dd097 100644 --- a/Yavsc/Models/Relationship/Tag.cs +++ b/Yavsc/Models/Relationship/Tag.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Yavsc.Models +namespace Yavsc.Models.Relationship { public partial class Tag { diff --git a/Yavsc/Models/Workflow/PerformerProfile.cs b/Yavsc/Models/Workflow/PerformerProfile.cs index 14f731f5..9c2b0bd8 100644 --- a/Yavsc/Models/Workflow/PerformerProfile.cs +++ b/Yavsc/Models/Workflow/PerformerProfile.cs @@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Yavsc.Models.Workflow { + using Models.Relationship; public class PerformerProfile { diff --git a/Yavsc/Models/societe.com/CompanyInfo.cs b/Yavsc/Models/societe.com/CompanyInfo.cs index b4b160f3..c39221f2 100644 --- a/Yavsc/Models/societe.com/CompanyInfo.cs +++ b/Yavsc/Models/societe.com/CompanyInfo.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; -namespace Yavsc.Model.societe.com +namespace Yavsc.Models.societe.com { public class CompanyInfoMessage diff --git a/Yavsc/Services/SIRENCheker.cs b/Yavsc/Services/SIRENCheker.cs index b1065afc..83a096e9 100644 --- a/Yavsc/Services/SIRENCheker.cs +++ b/Yavsc/Services/SIRENCheker.cs @@ -1,10 +1,10 @@ using System.Net.Http; using System.Threading.Tasks; using Yavsc.Helpers; -using Yavsc.Model.societe.com; namespace Yavsc.Services { + using Models.societe.com; public class SIRENChecker { private CompanyInfoSettings _settings; diff --git a/Yavsc/Startup/Startup.FileServer.cs b/Yavsc/Startup/Startup.FileServer.cs index 3a6ac9f6..58c2dac8 100644 --- a/Yavsc/Startup/Startup.FileServer.cs +++ b/Yavsc/Startup/Startup.FileServer.cs @@ -6,6 +6,7 @@ using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; +using Yavsc.ViewModels; using Yavsc.ViewModels.Auth; namespace Yavsc diff --git a/Yavsc/Startup/Startup.cs b/Yavsc/Startup/Startup.cs index 59415743..a33ada06 100755 --- a/Yavsc/Startup/Startup.cs +++ b/Yavsc/Startup/Startup.cs @@ -26,7 +26,7 @@ using Microsoft.Net.Http.Headers; using Yavsc.Formatters; using Yavsc.Models; using Yavsc.Services; -using Yavsc.ViewModels.Auth; +using Yavsc.ViewModels.Auth.Handlers; namespace Yavsc { diff --git a/Yavsc/ViewModels/Auth/AuthorisationHandlers.cs b/Yavsc/ViewModels/Auth/AuthorisationHandlers.cs deleted file mode 100644 index 96ddecb4..00000000 --- a/Yavsc/ViewModels/Auth/AuthorisationHandlers.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using System.IO; -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Yavsc.Models; -using Yavsc.Models.Booking; -using Yavsc.ViewModels.Auth; - -namespace Yavsc { - - public class FileSpotInfo : IAuthorizationRequirement - { - public DirectoryInfo PathInfo { get; private set; } - public FileSpotInfo(string path, Blog b) { - PathInfo = new DirectoryInfo(path); - AuthorId = b.AuthorId; - BlogEntryId = b.Id; - } - public string AuthorId { get; private set; } - public long BlogEntryId { get; private set; } - - } - public class ViewRequirement : IAuthorizationRequirement - { - public ViewRequirement() - { - } - } - public class BlogEditHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, EditRequirement requirement, Blog resource) - { - if (context.User.IsInRole(Constants.BlogModeratorGroupName)) - context.Succeed(requirement); - else if (context.User.Identity.IsAuthenticated) - if (resource.AuthorId == context.User.GetUserId()) - context.Succeed(requirement); - } - - } - public class PostUserFileHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, EditRequirement requirement, FileSpotInfo resource) - { - if (context.User.IsInRole(Constants.BlogModeratorGroupName) - || context.User.IsInRole(Constants.AdminGroupName)) - context.Succeed(requirement); - if (!context.User.Identity.IsAuthenticated) - context.Fail(); - if (resource.AuthorId == context.User.GetUserId()) - context.Succeed(requirement); - else context.Fail(); - } - - } - - public class ViewFileHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, ViewRequirement requirement, ViewFileContext fileContext) - { - // TODO file access rules - if (fileContext.Path.StartsWith("/pub/")) - context.Succeed(requirement); - else { - context.Succeed(requirement); - } - } - } - - public class CommandViewHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, ViewRequirement requirement, BookQuery resource) - { - if (context.User.IsInRole("FrontOffice")) - context.Succeed(requirement); - else if (context.User.Identity.IsAuthenticated) - if (resource.ClientId == context.User.GetUserId()) - context.Succeed(requirement); - else if (resource.PerformerId == context.User.GetUserId()) - context.Succeed(requirement); - } - - } - public class CommandEditHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, EditRequirement requirement, BookQuery resource) - { - if (context.User.IsInRole("FrontOffice")) - context.Succeed(requirement); - else if (context.User.Identity.IsAuthenticated) - if (resource.ClientId == context.User.GetUserId()) - context.Succeed(requirement); - } - - } - public class HasTemporaryPassHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, PrivateChatEntryRequirement requirement) - { - if (!context.User.HasClaim(c => c.Type == "TemporaryBadgeExpiry" && - c.Issuer == Startup.Authority)) - { - return; - } - - var temporaryBadgeExpiry = - Convert.ToDateTime(context.User.FindFirst( - c => c.Type == "TemporaryBadgeExpiry" && - c.Issuer == Startup.Authority).Value); - - if (temporaryBadgeExpiry > DateTime.Now) - { - context.Succeed(requirement); - } - } - } - - public class HasBadgeHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, PrivateChatEntryRequirement requirement) - { - if (!context.User.HasClaim(c => c.Type == "BadgeNumber" && - c.Issuer == Startup.Authority)) - { - return; - } - context.Succeed(requirement); - } - } - - - -} \ No newline at end of file diff --git a/Yavsc/ViewModels/Auth/FileSpotInfo.cs b/Yavsc/ViewModels/Auth/FileSpotInfo.cs new file mode 100644 index 00000000..78c079ca --- /dev/null +++ b/Yavsc/ViewModels/Auth/FileSpotInfo.cs @@ -0,0 +1,24 @@ + +using System.IO; +using Microsoft.AspNet.Authorization; +using Yavsc.Models; + +namespace Yavsc { + + public class FileSpotInfo : IAuthorizationRequirement + { + public DirectoryInfo PathInfo { get; private set; } + public FileSpotInfo(string path, Blog b) { + PathInfo = new DirectoryInfo(path); + AuthorId = b.AuthorId; + BlogEntryId = b.Id; + } + public string AuthorId { get; private set; } + public long BlogEntryId { get; private set; } + + } + + + + +} \ No newline at end of file diff --git a/Yavsc/ViewModels/Auth/BlogEditHandler.cs b/Yavsc/ViewModels/Auth/Handlers/BlogEditHandler.cs similarity index 85% rename from Yavsc/ViewModels/Auth/BlogEditHandler.cs rename to Yavsc/ViewModels/Auth/Handlers/BlogEditHandler.cs index 599d2afa..d16621a8 100644 --- a/Yavsc/ViewModels/Auth/BlogEditHandler.cs +++ b/Yavsc/ViewModels/Auth/Handlers/BlogEditHandler.cs @@ -1,9 +1,9 @@ -using System.Security.Claims; using Microsoft.AspNet.Authorization; -using Yavsc.Models; -namespace Yavsc.ViewModels.Auth +namespace Yavsc.ViewModels.Auth.Handlers { + using System.Security.Claims; + using Models; public class BlogEditHandler : AuthorizationHandler { protected override void Handle(AuthorizationContext context, EditRequirement requirement, Blog resource) diff --git a/Yavsc/ViewModels/Auth/BlogViewHandler.cs b/Yavsc/ViewModels/Auth/Handlers/BlogViewHandler.cs similarity index 95% rename from Yavsc/ViewModels/Auth/BlogViewHandler.cs rename to Yavsc/ViewModels/Auth/Handlers/BlogViewHandler.cs index 7a3c1dbc..cb8fb0ec 100644 --- a/Yavsc/ViewModels/Auth/BlogViewHandler.cs +++ b/Yavsc/ViewModels/Auth/Handlers/BlogViewHandler.cs @@ -2,7 +2,7 @@ using System.Security.Claims; using Microsoft.AspNet.Authorization; using Yavsc.Models; -namespace Yavsc.ViewModels.Auth +namespace Yavsc.ViewModels.Auth.Handlers { public class BlogViewHandler : AuthorizationHandler { diff --git a/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs b/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs new file mode 100644 index 00000000..9cc7228e --- /dev/null +++ b/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs @@ -0,0 +1,19 @@ +using System.Security.Claims; +using Microsoft.AspNet.Authorization; + +namespace Yavsc.ViewModels.Auth.Handlers +{ + using Models.Booking; + public class CommandEditHandler : AuthorizationHandler + { + protected override void Handle(AuthorizationContext context, EditRequirement requirement, BookQuery resource) + { + if (context.User.IsInRole("FrontOffice")) + context.Succeed(requirement); + else if (context.User.Identity.IsAuthenticated) + if (resource.ClientId == context.User.GetUserId()) + context.Succeed(requirement); + } + + } +} \ No newline at end of file diff --git a/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs b/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs new file mode 100644 index 00000000..7ab2a6b4 --- /dev/null +++ b/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs @@ -0,0 +1,21 @@ +using System.Security.Claims; +using Microsoft.AspNet.Authorization; + +namespace Yavsc.ViewModels.Auth.Handlers +{ + using Models.Booking; + public class CommandViewHandler : AuthorizationHandler + { + protected override void Handle(AuthorizationContext context, ViewRequirement requirement, BookQuery resource) + { + if (context.User.IsInRole("FrontOffice")) + context.Succeed(requirement); + else if (context.User.Identity.IsAuthenticated) + if (resource.ClientId == context.User.GetUserId()) + context.Succeed(requirement); + else if (resource.PerformerId == context.User.GetUserId()) + context.Succeed(requirement); + } + + } +} \ No newline at end of file diff --git a/Yavsc/ViewModels/Auth/EstimateViewHandler.cs b/Yavsc/ViewModels/Auth/Handlers/EstimateViewHandler.cs similarity index 95% rename from Yavsc/ViewModels/Auth/EstimateViewHandler.cs rename to Yavsc/ViewModels/Auth/Handlers/EstimateViewHandler.cs index 04eecdd9..553a0d4e 100644 --- a/Yavsc/ViewModels/Auth/EstimateViewHandler.cs +++ b/Yavsc/ViewModels/Auth/Handlers/EstimateViewHandler.cs @@ -2,7 +2,7 @@ using System.Security.Claims; using Microsoft.AspNet.Authorization; using Yavsc.Models.Billing; -namespace Yavsc.ViewModels.Auth +namespace Yavsc.ViewModels.Auth.Handlers { public class EstimateViewHandler : AuthorizationHandler { diff --git a/Yavsc/ViewModels/Auth/Handlers/HasBadgeHandler.cs b/Yavsc/ViewModels/Auth/Handlers/HasBadgeHandler.cs new file mode 100644 index 00000000..8e5f4736 --- /dev/null +++ b/Yavsc/ViewModels/Auth/Handlers/HasBadgeHandler.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNet.Authorization; + +namespace Yavsc.ViewModels.Auth.Handlers +{ + public class HasBadgeHandler : AuthorizationHandler + { + protected override void Handle(AuthorizationContext context, PrivateChatEntryRequirement requirement) + { + if (!context.User.HasClaim(c => c.Type == "BadgeNumber" && + c.Issuer == Startup.Authority)) + { + return; + } + context.Succeed(requirement); + } + } +} \ No newline at end of file diff --git a/Yavsc/ViewModels/Auth/Handlers/HasTemporaryPassHandler.cs b/Yavsc/ViewModels/Auth/Handlers/HasTemporaryPassHandler.cs new file mode 100644 index 00000000..f68aa831 --- /dev/null +++ b/Yavsc/ViewModels/Auth/Handlers/HasTemporaryPassHandler.cs @@ -0,0 +1,27 @@ +using System; +using Microsoft.AspNet.Authorization; + +namespace Yavsc.ViewModels.Auth.Handlers +{ + public class HasTemporaryPassHandler : AuthorizationHandler + { + protected override void Handle(AuthorizationContext context, PrivateChatEntryRequirement requirement) + { + if (!context.User.HasClaim(c => c.Type == "TemporaryBadgeExpiry" && + c.Issuer == Startup.Authority)) + { + return; + } + + var temporaryBadgeExpiry = + Convert.ToDateTime(context.User.FindFirst( + c => c.Type == "TemporaryBadgeExpiry" && + c.Issuer == Startup.Authority).Value); + + if (temporaryBadgeExpiry > DateTime.Now) + { + context.Succeed(requirement); + } + } + } +} \ No newline at end of file diff --git a/Yavsc/ViewModels/Auth/Handlers/PostUserFileHandler.cs b/Yavsc/ViewModels/Auth/Handlers/PostUserFileHandler.cs new file mode 100644 index 00000000..e72a3461 --- /dev/null +++ b/Yavsc/ViewModels/Auth/Handlers/PostUserFileHandler.cs @@ -0,0 +1,21 @@ +using System.Security.Claims; +using Microsoft.AspNet.Authorization; + +namespace Yavsc.ViewModels.Auth.Handlers +{ + public class PostUserFileHandler : AuthorizationHandler + { + protected override void Handle(AuthorizationContext context, EditRequirement requirement, FileSpotInfo resource) + { + if (context.User.IsInRole(Constants.BlogModeratorGroupName) + || context.User.IsInRole(Constants.AdminGroupName)) + context.Succeed(requirement); + if (!context.User.Identity.IsAuthenticated) + context.Fail(); + if (resource.AuthorId == context.User.GetUserId()) + context.Succeed(requirement); + else context.Fail(); + } + + } +} \ No newline at end of file diff --git a/Yavsc/ViewModels/Auth/Handlers/ViewFileHandler.cs b/Yavsc/ViewModels/Auth/Handlers/ViewFileHandler.cs new file mode 100644 index 00000000..e615f944 --- /dev/null +++ b/Yavsc/ViewModels/Auth/Handlers/ViewFileHandler.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNet.Authorization; + +namespace Yavsc.ViewModels.Auth.Handlers +{ + public class ViewFileHandler : AuthorizationHandler + { + protected override void Handle(AuthorizationContext context, ViewRequirement requirement, ViewFileContext fileContext) + { + // TODO file access rules + if (fileContext.Path.StartsWith("/pub/")) + context.Succeed(requirement); + else { + context.Succeed(requirement); + } + } + } +} \ No newline at end of file diff --git a/Yavsc/ViewModels/ViewRequirement.cs b/Yavsc/ViewModels/ViewRequirement.cs new file mode 100644 index 00000000..ce1d2772 --- /dev/null +++ b/Yavsc/ViewModels/ViewRequirement.cs @@ -0,0 +1,11 @@ +using Microsoft.AspNet.Authorization; + +namespace Yavsc.ViewModels +{ + public class ViewRequirement : IAuthorizationRequirement + { + public ViewRequirement() + { + } + } +} \ No newline at end of file diff --git a/Yavsc/Views/Circle/Create.cshtml b/Yavsc/Views/Circle/Create.cshtml index 788beab2..b7879500 100644 --- a/Yavsc/Views/Circle/Create.cshtml +++ b/Yavsc/Views/Circle/Create.cshtml @@ -1,4 +1,4 @@ -@model Yavsc.Models.CircleMember +@model Yavsc.Models.Relationship.Circle @{ ViewData["Title"] = "Create"; @@ -8,9 +8,23 @@
-

CircleMember

+

Circle


+
+ +
+ + +
+
+
+ +
+ + +
+
diff --git a/Yavsc/Views/Circle/Delete.cshtml b/Yavsc/Views/Circle/Delete.cshtml index e3bb93da..f1f408f9 100644 --- a/Yavsc/Views/Circle/Delete.cshtml +++ b/Yavsc/Views/Circle/Delete.cshtml @@ -1,4 +1,4 @@ -@model Yavsc.Models.CircleMember +@model Yavsc.Models.Relationship.Circle @{ ViewData["Title"] = "Delete"; @@ -8,9 +8,21 @@

Are you sure you want to delete this?

-

CircleMember

+

Circle


+
+ @Html.DisplayNameFor(model => model.Name) +
+
+ @Html.DisplayFor(model => model.Name) +
+
+ @Html.DisplayNameFor(model => model.OwnerId) +
+
+ @Html.DisplayFor(model => model.OwnerId) +
diff --git a/Yavsc/Views/Circle/Details.cshtml b/Yavsc/Views/Circle/Details.cshtml index 80a9d8b5..3952986d 100644 --- a/Yavsc/Views/Circle/Details.cshtml +++ b/Yavsc/Views/Circle/Details.cshtml @@ -1,4 +1,4 @@ -@model Yavsc.Models.CircleMember +@model Yavsc.Models.Relationship.Circle @{ ViewData["Title"] = "Details"; @@ -7,9 +7,21 @@

Details

-

CircleMember

+

Circle


+
+ @Html.DisplayNameFor(model => model.Name) +
+
+ @Html.DisplayFor(model => model.Name) +
+
+ @Html.DisplayNameFor(model => model.OwnerId) +
+
+ @Html.DisplayFor(model => model.OwnerId) +

diff --git a/Yavsc/Views/Circle/Edit.cshtml b/Yavsc/Views/Circle/Edit.cshtml index a5983696..d40f18b7 100644 --- a/Yavsc/Views/Circle/Edit.cshtml +++ b/Yavsc/Views/Circle/Edit.cshtml @@ -1,4 +1,4 @@ -@model Yavsc.Models.CircleMember +@model Yavsc.Models.Relationship.Circle @{ ViewData["Title"] = "Edit"; @@ -8,10 +8,24 @@

-

CircleMember

+

Circle


+
+ +
+ + +
+
+
+ +
+ + +
+
diff --git a/Yavsc/Views/Circle/Index.cshtml b/Yavsc/Views/Circle/Index.cshtml index 0a98598c..b7c03810 100644 --- a/Yavsc/Views/Circle/Index.cshtml +++ b/Yavsc/Views/Circle/Index.cshtml @@ -1,4 +1,4 @@ -@model IEnumerable +@model IEnumerable @{ ViewData["Title"] = "Index"; @@ -11,11 +11,23 @@

+ + @foreach (var item in Model) { + +
+ @Html.DisplayNameFor(model => model.Name) + + @Html.DisplayNameFor(model => model.OwnerId) +
+ @Html.DisplayFor(modelItem => item.Name) + + @Html.DisplayFor(modelItem => item.OwnerId) + Edit | Details | diff --git a/Yavsc/Views/CircleMember/Create.cshtml b/Yavsc/Views/CircleMember/Create.cshtml new file mode 100644 index 00000000..e2310812 --- /dev/null +++ b/Yavsc/Views/CircleMember/Create.cshtml @@ -0,0 +1,25 @@ +@model Yavsc.Models.Relationship.CircleMember + +@{ + ViewData["Title"] = "Create"; +} + +

Create

+ + +
+

CircleMember

+
+
+
+
+ +
+
+
+ + + + diff --git a/Yavsc/Views/CircleMember/Delete.cshtml b/Yavsc/Views/CircleMember/Delete.cshtml new file mode 100644 index 00000000..400e7fb0 --- /dev/null +++ b/Yavsc/Views/CircleMember/Delete.cshtml @@ -0,0 +1,22 @@ +@model Yavsc.Models.Relationship.CircleMember + +@{ + ViewData["Title"] = "Delete"; +} + +

Delete

+ +

Are you sure you want to delete this?

+
+

CircleMember

+
+
+
+ +
+
+ | + Back to List +
+
+
diff --git a/Yavsc/Views/CircleMember/Details.cshtml b/Yavsc/Views/CircleMember/Details.cshtml new file mode 100644 index 00000000..53146522 --- /dev/null +++ b/Yavsc/Views/CircleMember/Details.cshtml @@ -0,0 +1,18 @@ +@model Yavsc.Models.Relationship.CircleMember + +@{ + ViewData["Title"] = "Details"; +} + +

Details

+ +
+

CircleMember

+
+
+
+
+

+ Edit | + Back to List +

diff --git a/Yavsc/Views/CircleMember/Edit.cshtml b/Yavsc/Views/CircleMember/Edit.cshtml new file mode 100644 index 00000000..f0430501 --- /dev/null +++ b/Yavsc/Views/CircleMember/Edit.cshtml @@ -0,0 +1,26 @@ +@model Yavsc.Models.Relationship.CircleMember + +@{ + ViewData["Title"] = "Edit"; +} + +

Edit

+ +
+
+

CircleMember

+
+
+ +
+
+ +
+
+
+
+ + + diff --git a/Yavsc/Views/CircleMember/Index.cshtml b/Yavsc/Views/CircleMember/Index.cshtml new file mode 100644 index 00000000..64516311 --- /dev/null +++ b/Yavsc/Views/CircleMember/Index.cshtml @@ -0,0 +1,26 @@ +@model IEnumerable + +@{ + ViewData["Title"] = "Index"; +} + +

Index

+ +

+ Create New +

+ + + + + +@foreach (var item in Model) { + + + +} +
+ Edit | + Details | + Delete +
diff --git a/Yavsc/contrib/genApiController.sh b/Yavsc/contrib/genApiController.sh index ac938ab3..f5f80e3e 100755 --- a/Yavsc/contrib/genApiController.sh +++ b/Yavsc/contrib/genApiController.sh @@ -1,6 +1,6 @@ #!/bin/sh -dnx gen controller -outDir ApiControllers -api -dc ApplicationDbContext -m "$1" -name "$2ApiController" +dnx gen controller -async -outDir ApiControllers -api -dc ApplicationDbContext -m "$1" -name "$2ApiController" # dnx gen controller -outDir Controllers -dc ApplicationDbContext -udl -m {model} -name {name}Controller diff --git a/Yavsc/contrib/genController.sh b/Yavsc/contrib/genController.sh new file mode 100755 index 00000000..4db37db9 --- /dev/null +++ b/Yavsc/contrib/genController.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +dnx gen controller -async -udl -outDir Controllers -dc ApplicationDbContext -m "$1" -name "$2Controller" + +# dnx gen controller -outDir Controllers -dc ApplicationDbContext -udl -m {model} -name {name}Controller + + +# dnx gen controller -outDir Controllers -dc ApplicationDbContext -udl -m Yavsc.Models.Booking.MusicianSettings -name InstrumentationController -async -scripts