hair cut command
This commit is contained in:
parent
b0f81edeac
commit
22701c784e
18 changed files with 2135 additions and 123 deletions
|
|
@ -50,7 +50,7 @@ namespace Yavsc.Controllers
|
|||
}
|
||||
private void SetViewBag(CommandForm commandForm=null) {
|
||||
ViewBag.ActivityCode = new SelectList(_context.Activities, "Code", "Name", commandForm?.ActivityCode);
|
||||
ViewBag.Action = Startup.Forms.Select( c => new SelectListItem { Text = c, Selected = commandForm?.Action == c } );
|
||||
ViewBag.ActionName = Startup.Forms.Select( c => new SelectListItem { Value = c, Text = c, Selected = (commandForm?.ActionName == c) } );
|
||||
}
|
||||
// POST: CommandForms/Create
|
||||
[HttpPost]
|
||||
|
|
|
|||
|
|
@ -10,14 +10,9 @@ using System.Security.Claims;
|
|||
namespace Yavsc.Controllers
|
||||
{
|
||||
using Helpers;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Models;
|
||||
using Newtonsoft.Json;
|
||||
using ViewModels.FrontOffice;
|
||||
using Yavsc.Extensions;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.ViewModels.Haircut;
|
||||
|
||||
public class FrontOfficeController : Controller
|
||||
{
|
||||
|
|
@ -67,28 +62,18 @@ namespace Yavsc.Controllers
|
|||
var result = _context.ListPerformers(id);
|
||||
return View(result);
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
public ActionResult HairCut(string id)
|
||||
{
|
||||
HairPrestation pPrestation=null;
|
||||
var prestaJson = HttpContext.Session.GetString("HairCutPresta") ;
|
||||
if (prestaJson!=null) {
|
||||
pPrestation = JsonConvert.DeserializeObject<HairPrestation>(prestaJson);
|
||||
if (id == null)
|
||||
{
|
||||
throw new NotImplementedException("No Activity code");
|
||||
}
|
||||
else pPrestation = new HairPrestation {};
|
||||
ViewBag.HairTaints = _context.HairTaint.Include(t=>t.Color);
|
||||
ViewBag.HairTechnos = EnumExtensions.GetSelectList(typeof(HairTechnos),_SR);
|
||||
ViewBag.HairLength = EnumExtensions.GetSelectList(typeof(HairLength),_SR);
|
||||
ViewBag.Activity = _context.Activities.First(a => a.Code == id);
|
||||
ViewBag.Gender = EnumExtensions.GetSelectList(typeof(HairCutGenders),_SR);
|
||||
ViewBag.HairDressings = EnumExtensions.GetSelectList(typeof(HairDressings),_SR);
|
||||
var result = new HairCutView {
|
||||
HairBrushers = _context.ListPerformers(id),
|
||||
Topic = pPrestation
|
||||
} ;
|
||||
ViewBag.Activity = _context.Activities.FirstOrDefault(a => a.Code == id);
|
||||
var result = _context.ListPerformers(id);
|
||||
return View(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Produces("text/x-tex"), Authorize, Route("estimate-{id}.tex")]
|
||||
|
|
|
|||
|
|
@ -9,15 +9,20 @@ using Microsoft.Data.Entity;
|
|||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.OptionsModel;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Google.Messaging;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.Models.Relationship;
|
||||
using Yavsc.Services;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Google.Messaging;
|
||||
using Yavsc.Models.Relationship;
|
||||
using Yavsc.Services;
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Yavsc.Extensions;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.ViewModels.Haircut;
|
||||
|
||||
public class HairCutCommandController : CommandController
|
||||
{
|
||||
public HairCutCommandController(ApplicationDbContext context,
|
||||
|
|
@ -111,6 +116,28 @@ namespace Yavsc.Controllers
|
|||
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
public ActionResult HairCut(string performerId, string activityCode)
|
||||
{
|
||||
HairPrestation pPrestation=null;
|
||||
var prestaJson = HttpContext.Session.GetString("HairCutPresta") ;
|
||||
if (prestaJson!=null) {
|
||||
pPrestation = JsonConvert.DeserializeObject<HairPrestation>(prestaJson);
|
||||
}
|
||||
else pPrestation = new HairPrestation {};
|
||||
|
||||
ViewBag.HairTaints = _context.HairTaint.Include(t=>t.Color);
|
||||
ViewBag.HairTechnos = EnumExtensions.GetSelectList(typeof(HairTechnos),_localizer);
|
||||
ViewBag.HairLength = EnumExtensions.GetSelectList(typeof(HairLength),_localizer);
|
||||
ViewBag.Activity = _context.Activities.First(a => a.Code == activityCode);
|
||||
ViewBag.Gender = EnumExtensions.GetSelectList(typeof(HairCutGenders),_localizer);
|
||||
ViewBag.HairDressings = EnumExtensions.GetSelectList(typeof(HairDressings),_localizer);
|
||||
var result = new HairCutView {
|
||||
HairBrusher = _context.Performers.Single(p=>p.PerformerId == performerId),
|
||||
Topic = pPrestation
|
||||
} ;
|
||||
return View(result);
|
||||
}
|
||||
[HttpPost, Authorize]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> CreateHairMultiCutQuery(HairMultiCutQuery command)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue