Skip to content

Commit

Permalink
add receivable
Browse files Browse the repository at this point in the history
  • Loading branch information
lyndonkieljerymiah committed Jan 5, 2017
1 parent 433c9ad commit 8e67a11
Show file tree
Hide file tree
Showing 72 changed files with 1,790 additions and 768 deletions.
5 changes: 3 additions & 2 deletions Sunrise.Client/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ public static void RegisterBundles(BundleCollection bundles)
"~/Scripts/libs/angularjs/angular-animate.js"));

bundles.Add(new ScriptBundle("~/bundles/app").Include(
"~/Scripts/app/app-bootstrap.js"));
"~/Scripts/app/app-bootstrap.js"
));

bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/font-awesome.css",
"~/Content/bootstrap.css",
"~/Content/bootstrap-slate.css",
"~/Content/default.css"));

bundles.Add(new StyleBundle("~/Content/login").Include(
Expand Down
2 changes: 1 addition & 1 deletion Sunrise.Client/App_Start/NinjectWebCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private static void RegisterServices(IKernel kernel)
kernel.Bind<Sunrise.TransactionManagement.Abstract.IUnitOfWork>().To<Sunrise.TransactionManagement.Persistence.Repository.UnitOfWork>();


kernel.Bind<SalesDataManager>().To<SalesDataManager>();
kernel.Bind<ContractDataManager>().To<ContractDataManager>();
kernel.Bind<VillaDataManager>().To<VillaDataManager>();
kernel.Bind<SelectionDataManager>().To<SelectionDataManager>();
kernel.Bind<TenantDataManager>().To<TenantDataManager>();
Expand Down
4 changes: 1 addition & 3 deletions Sunrise.Client/App_Start/RouteConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ public static void RegisterRoutes(RouteCollection routes)

routes.MapMvcAttributeRoutes();



routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Sales", action = "Index", id = UrlParameter.Optional }
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
Expand Down
51 changes: 45 additions & 6 deletions Sunrise.Client/Content/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
html {
height: 100%;
}
button,
.btn {
outline: 0;
}
body {
font-family: 'Open Sans', sans-serif;
padding-top: 50px;
padding-top: 90px;
background: #F1F1F1 url('imgs/noise_lines.png') top repeat;
height: 100%;
}
.body-content {
padding: 15px;
}
.box-content {
padding-top: 10px ;
padding-top: 10px;
padding-bottom: 15px;
}
/*spinner*/
Expand Down Expand Up @@ -43,12 +47,49 @@ body {
left: 50%;
}
/*error*/
span[ng-show] {
span[ng-show],
span[ng-hide] {
font-size: 12px;
font-weight: bold;
color: #ff0000;
}
/* content */
/*menu*/
.nb-nav-menu {
width: 100%;
background-color: #e6e6e6;
}
.nb-nav-menu .nb-module {
width: 60%;
margin: 0 auto;
}
.nb-nav-menu .nb-module ul {
list-style: none;
display: block;
width: 100%;
margin: 0 auto;
padding: 0;
}
.nb-nav-menu .nb-module ul li {
float: left;
width: 28%;
}
.nb-nav-menu .nb-module ul li a {
display: block;
padding: 15px 10px;
text-decoration: none;
margin-right: 2%;
text-align: center;
width: 98%;
}
.nb-nav-menu .nb-module ul li a:hover {
background: rgba(0, 0, 0, 0.4);
}
.nb-nav-menu .nb-module ul:after {
clear: both;
display: table;
content: "";
}
.nb-card {
font-family: 'Open Sans', sans-serif;
position: relative;
Expand Down Expand Up @@ -143,7 +184,7 @@ span[ng-show] {
content: "";
}
.nb-slide {
width: 513px;
width: 497px;
height: 342px;
position: relative;
overflow: hidden;
Expand All @@ -154,8 +195,6 @@ span[ng-show] {
left: 0;
z-index: 1;
overflow: hidden;
width: 513px;
height: 342px;
}
.nb-slide .nb-image-container img {
height: 100%;
Expand Down
63 changes: 55 additions & 8 deletions Sunrise.Client/Content/default.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ html {
height: 100%;
}


button,
.btn {
outline:0;
}

body {
font-family: 'Open Sans', sans-serif;
padding-top: 50px;
padding-top: 90px;
background: #F1F1F1 url('imgs/noise_lines.png') top repeat;
height: 100%;
}
Expand All @@ -19,7 +25,7 @@ body {
}

.box-content {
padding-top: 10px ;
padding-top: 10px;
padding-bottom: 15px;
}

Expand All @@ -29,11 +35,12 @@ body {
height: 100%;
position: fixed;
overflow: hidden;
top:0;
left:0;
top: 0;
left: 0;
background: rgba(0,0,0,0.8);
text-align: center;
z-index: 1000;

.overlay {
position: absolute;
top: 100%;
Expand All @@ -48,26 +55,66 @@ body {
height: 120px;
position: absolute;
top: 40%;
left: 50%
left: 50%;
}
}

/*error*/
span[ng-show] {
span[ng-show], span[ng-hide] {
font-size: 12px;
font-weight: bold;
color: #ff0000;
}

/* content */
.box-container {

}


/*menu*/
.nb-nav-menu {
width: 100%;
background-color: #e6e6e6;

.nb-module {
width: 60%;
margin: 0 auto;
ul {
list-style: none;
display: block;
width: 100%;
margin: 0 auto;
padding: 0;

li {
float: left;
width: 28%;

a {
display: block;
padding: 15px 10px;
text-decoration: none;
margin-right: 2%;
text-align:center;
width: 98%;
&:hover {
background: rgba(0,0,0,0.4);
}
}
}

&:after {
clear: both;
display: table;
content: "";
}
}
}
}

@import url("parts/box.less");

@import url("parts/slider.less");


/*override*/
/*override*/
2 changes: 1 addition & 1 deletion Sunrise.Client/Content/default.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions Sunrise.Client/Content/parts/slider.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import url("mixin.less");

.nb-slide {
width: 513px;
width: 497px;
height: 342px;
position: relative;
overflow: hidden;
Expand All @@ -13,9 +13,6 @@
left: 0;
z-index: 1;
overflow: hidden;
width: 513px;
height: 342px;

img {
height: 100%;
width: 100%;
Expand Down
6 changes: 3 additions & 3 deletions Sunrise.Client/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public async Task<ActionResult> Register(RegisterViewModel model)
// var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
// await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");

return RedirectToAction("Index", "Sales");
return RedirectToAction("Index", "Home");
}
AddErrors(result);
}
Expand Down Expand Up @@ -394,7 +394,7 @@ public async Task<ActionResult> ExternalLoginConfirmation(ExternalLoginConfirmat
public ActionResult LogOff()
{
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
return RedirectToAction("Index", "Sales");
return RedirectToAction("Index", "Home");
}

//
Expand Down Expand Up @@ -451,7 +451,7 @@ private ActionResult RedirectToLocal(string returnUrl)
{
return Redirect(returnUrl);
}
return RedirectToAction("Index", "Sales");
return RedirectToAction("Index", "Home");
}

internal class ChallengeResult : HttpUnauthorizedResult
Expand Down
95 changes: 95 additions & 0 deletions Sunrise.Client/Controllers/Api/BillingController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
using Sunrise.Client.Domains.ViewModels;
using Sunrise.Client.Persistence.Manager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using Utilities.Enum;

namespace Sunrise.Client.Controllers.Api
{
[RoutePrefix("api/billing")]
public class BillingController : ApiController
{
private ContractDataManager _contractDataManager;
private SelectionDataManager _selectionDataManager;
private VillaDataManager _villaDataManager;

public BillingController(
ContractDataManager contractDataManager,
SelectionDataManager selectionDataManager,
VillaDataManager villaDataManager)
{
_contractDataManager = contractDataManager;
_selectionDataManager = selectionDataManager;
_villaDataManager = villaDataManager;
}


/// <summary>
/// TODO: Show bill
/// </summary>
/// <param name="transactionId"></param>
/// <returns></returns>
[HttpGet]
[Route("{transactionId?}")]
public async Task<IHttpActionResult> Billing(string transactionId)
{
var transaction = await _contractDataManager.GetContractById(transactionId);
return Ok(transaction);
}


/// <summary>
/// TODO: Show Payment
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("payment")]
public async Task<IHttpActionResult> Payment()
{
var payment = new PaymentViewModel();
var selections = await _selectionDataManager
.GetLookup(new[] { "Bank", "PaymentTerm", "PaymentMode" });

payment.SetTerms(selections);
payment.SetMode(selections);
payment.SetBank(selections);

return Ok(payment);
}

/// <summary>
/// TODO: Save Payment
/// </summary>
/// <param name="vm"></param>
/// <returns></returns>
[HttpPost]
[Route("payment")]
public async Task<IHttpActionResult> Payment(PaymentViewModel vm)
{
if (!ModelState.IsValid)
return BadRequest(ModelState);

var result = await _contractDataManager.AddPayment(vm);
if (!result.Success)
{
AddResult(result, "periodError");
return BadRequest(ModelState);
}
return Ok(result);
}


#region Private Method
private void AddResult(CustomResult result, string key = "")
{
foreach (var error in result.Errors)
ModelState.AddModelError(key, error);
}
#endregion
}
}
Loading

0 comments on commit 8e67a11

Please sign in to comment.