Update: Support Ajax and Form Post for Finance

This commit is contained in:
Gary Sharp
2013-03-26 14:42:58 +11:00
parent e422bf163d
commit 9eaae3193f
27 changed files with 495 additions and 368 deletions
@@ -121,6 +121,17 @@ namespace Disco.BI.Extensions
{ {
return d.ToBinary(); return d.ToBinary();
} }
public static string ToJavascriptDateTime(this DateTime d)
{
return d.ToString("yyyy/MM/dd hh:mm tt");
}
public static string ToJavascriptDateTime(this DateTime? d)
{
if (d.HasValue)
return d.Value.ToString("yyyy/MM/dd hh:mm tt");
else
return null;
}
#endregion #endregion
#region Image Extensions #region Image Extensions
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0319.1534")] [assembly: AssemblyVersion("1.2.0326.1428")]
[assembly: AssemblyFileVersion("1.2.0319.1534")] [assembly: AssemblyFileVersion("1.2.0326.1428")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0319.1533")] [assembly: AssemblyVersion("1.2.0326.1427")]
[assembly: AssemblyFileVersion("1.2.0319.1533")] [assembly: AssemblyFileVersion("1.2.0326.1427")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0319.1533")] [assembly: AssemblyVersion("1.2.0326.1427")]
[assembly: AssemblyFileVersion("1.2.0319.1533")] [assembly: AssemblyFileVersion("1.2.0326.1427")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0319.1534")] [assembly: AssemblyVersion("1.2.0326.1428")]
[assembly: AssemblyFileVersion("1.2.0319.1534")] [assembly: AssemblyFileVersion("1.2.0326.1428")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0319.1534")] [assembly: AssemblyVersion("1.2.0326.1428")]
[assembly: AssemblyFileVersion("1.2.0319.1534")] [assembly: AssemblyFileVersion("1.2.0326.1428")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0319.1534")] [assembly: AssemblyVersion("1.2.0326.1428")]
[assembly: AssemblyFileVersion("1.2.0319.1534")] [assembly: AssemblyFileVersion("1.2.0326.1428")]
@@ -133,7 +133,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>
<UserProperties BuildVersion_BuildAction="ReBuild" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" BuildVersion_StartDate="2001/1/1" /> <UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="ReBuild" />
</VisualStudio> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0319.1534")] [assembly: AssemblyVersion("1.2.0326.1428")]
[assembly: AssemblyFileVersion("1.2.0319.1534")] [assembly: AssemblyFileVersion("1.2.0326.1428")]
+4 -4
View File
@@ -5,13 +5,13 @@
@using System.Web.Mvc @using System.Web.Mvc
@using System.Web.Mvc.Html; @using System.Web.Mvc.Html;
@using Disco.Web.Extensions; @using Disco.Web.Extensions;
@helper FriendlyDate(DateTime d) @helper FriendlyDate(DateTime d, string ElementId = null)
{ {
<span title="@d.ToFullDateTime()" data-discodatetime="@d.ToSortableDateTime()" class="date nowrap">@d.ToFuzzy()</span> <span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime()" data-discodatetime="@d.ToSortableDateTime()" data-datetimeformatted="@d.ToJavascriptDateTime()" class="date nowrap">@d.ToFuzzy()</span>
} }
@helper FriendlyDate(DateTime? d, string NullValue = "N/A") @helper FriendlyDate(DateTime? d, string NullValue = "N/A", string ElementId = null)
{ {
<span title="@d.ToFullDateTime(NullValue)" data-discodatetime="@d.ToSortableDateTime()" class="date nowrap">@d.ToFuzzy(NullValue)</span> <span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime(NullValue)" data-discodatetime="@d.ToSortableDateTime()" data-datetimeformatted="@d.ToJavascriptDateTime()" class="date nowrap">@d.ToFuzzy(NullValue)</span>
} }
@helper RadioButtonList(string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1) @helper RadioButtonList(string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1)
{ {
+51 -11
View File
@@ -60,11 +60,11 @@ namespace Disco.Web
#line default #line default
#line hidden #line hidden
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.4.0")]
public class CommonHelpers : System.Web.WebPages.HelperPage public class CommonHelpers : System.Web.WebPages.HelperPage
{ {
public static System.Web.WebPages.HelperResult FriendlyDate(DateTime d) public static System.Web.WebPages.HelperResult FriendlyDate(DateTime d, string ElementId = null)
{ {
return new System.Web.WebPages.HelperResult(__razor_helper_writer => { return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
@@ -76,12 +76,22 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
#line default #line default
#line hidden #line hidden
WriteLiteralTo(@__razor_helper_writer, " <span title=\""); WriteLiteralTo(@__razor_helper_writer, " <span ");
#line 10 "..\..\App_Code\CommonHelpers.cshtml" #line 10 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToFullDateTime()); WriteTo(@__razor_helper_writer, ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)));
#line default
#line hidden
WriteLiteralTo(@__razor_helper_writer, "title=\"");
#line 10 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToFullDateTime());
#line default #line default
#line hidden #line hidden
@@ -91,7 +101,17 @@ WriteLiteralTo(@__razor_helper_writer, "\" data-discodatetime=\"");
#line 10 "..\..\App_Code\CommonHelpers.cshtml" #line 10 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToSortableDateTime()); WriteTo(@__razor_helper_writer, d.ToSortableDateTime());
#line default
#line hidden
WriteLiteralTo(@__razor_helper_writer, "\" data-datetimeformatted=\"");
#line 10 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToJavascriptDateTime());
#line default #line default
#line hidden #line hidden
@@ -101,7 +121,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" class=\"date nowrap\">");
#line 10 "..\..\App_Code\CommonHelpers.cshtml" #line 10 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToFuzzy()); WriteTo(@__razor_helper_writer, d.ToFuzzy());
#line default #line default
#line hidden #line hidden
@@ -120,7 +140,7 @@ WriteLiteralTo(@__razor_helper_writer, "</span>\r\n");
} }
public static System.Web.WebPages.HelperResult FriendlyDate(DateTime? d, string NullValue = "N/A") public static System.Web.WebPages.HelperResult FriendlyDate(DateTime? d, string NullValue = "N/A", string ElementId = null)
{ {
return new System.Web.WebPages.HelperResult(__razor_helper_writer => { return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
@@ -132,12 +152,22 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
#line default #line default
#line hidden #line hidden
WriteLiteralTo(@__razor_helper_writer, " <span title=\""); WriteLiteralTo(@__razor_helper_writer, " <span ");
#line 14 "..\..\App_Code\CommonHelpers.cshtml" #line 14 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToFullDateTime(NullValue)); WriteTo(@__razor_helper_writer, ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)));
#line default
#line hidden
WriteLiteralTo(@__razor_helper_writer, "title=\"");
#line 14 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToFullDateTime(NullValue));
#line default #line default
#line hidden #line hidden
@@ -147,7 +177,17 @@ WriteLiteralTo(@__razor_helper_writer, "\" data-discodatetime=\"");
#line 14 "..\..\App_Code\CommonHelpers.cshtml" #line 14 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToSortableDateTime()); WriteTo(@__razor_helper_writer, d.ToSortableDateTime());
#line default
#line hidden
WriteLiteralTo(@__razor_helper_writer, "\" data-datetimeformatted=\"");
#line 14 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToJavascriptDateTime());
#line default #line default
#line hidden #line hidden
@@ -157,7 +197,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" class=\"date nowrap\">");
#line 14 "..\..\App_Code\CommonHelpers.cshtml" #line 14 "..\..\App_Code\CommonHelpers.cshtml"
WriteTo(@__razor_helper_writer, d.ToFuzzy(NullValue)); WriteTo(@__razor_helper_writer, d.ToFuzzy(NullValue));
#line default #line default
#line hidden #line hidden
@@ -56,6 +56,14 @@ namespace Disco.Web.Areas.API.Controllers
const string pWarrantyExternalReference = "warrantyexternalreference"; const string pWarrantyExternalReference = "warrantyexternalreference";
const string pWarrantyExternalCompletedDate = "warrantyexternalcompleteddate"; const string pWarrantyExternalCompletedDate = "warrantyexternalcompleteddate";
const string pJobDetailsTabResources = "jobDetailTab-Resources";
const string pJobDetailsTabComponents = "jobDetailTab-Components";
const string pJobDetailsTabNonWarrantyFinance = "jobDetailTab-NonWarrantyFinance";
const string pJobDetailsTabNonWarrantyRepairs = "jobDetailTab-NonWarrantyRepairs";
const string pJobDetailsTabNonWarrantyInsurance = "jobDetailTab-NonWarrantyInsurance";
const string pJobDetailsTabWarranty = "jobDetailTab-Warranty";
const string pJobDetailsTabFlags = "jobDetailTab-Flags";
#endregion #endregion
public virtual ActionResult Update(int id, string key, string value = null, Nullable<bool> redirect = null) public virtual ActionResult Update(int id, string key, string value = null, Nullable<bool> redirect = null)
@@ -71,6 +79,7 @@ namespace Disco.Web.Areas.API.Controllers
var job = dbContext.Jobs.Find(id); var job = dbContext.Jobs.Find(id);
object resultData = null; object resultData = null;
string resultUrlFragment = null;
if (job != null) if (job != null)
{ {
@@ -84,105 +93,139 @@ namespace Disco.Web.Areas.API.Controllers
break; break;
case pFlags: case pFlags:
UpdateFlags(job, value); UpdateFlags(job, value);
resultUrlFragment = pJobDetailsTabFlags;
break; break;
case pNonWarrantyAccountingChargeRequired: case pNonWarrantyAccountingChargeRequired:
resultData = UpdateNonWarrantyAccountingChargeRequired(job, value); resultData = UpdateNonWarrantyAccountingChargeRequired(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
break; break;
case pNonWarrantyAccountingChargeAdded: case pNonWarrantyAccountingChargeAdded:
resultData = UpdateNonWarrantyAccountingChargeAdded(job, value); resultData = UpdateNonWarrantyAccountingChargeAdded(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
break; break;
case pNonWarrantyAccountingChargePaid: case pNonWarrantyAccountingChargePaid:
resultData = UpdateNonWarrantyAccountingChargePaid(job, value); resultData = UpdateNonWarrantyAccountingChargePaid(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
break; break;
case pNonWarrantyPurchaseOrderRaised: case pNonWarrantyPurchaseOrderRaised:
resultData = UpdateNonWarrantyPurchaseOrderRaised(job, value); resultData = UpdateNonWarrantyPurchaseOrderRaised(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
break; break;
case pNonWarrantyPurchaseOrderReference: case pNonWarrantyPurchaseOrderReference:
UpdateNonWarrantyPurchaseOrderReference(job, value); UpdateNonWarrantyPurchaseOrderReference(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
break; break;
case pNonWarrantyPurchaseOrderSent: case pNonWarrantyPurchaseOrderSent:
resultData = UpdateNonWarrantyPurchaseOrderSent(job, value); resultData = UpdateNonWarrantyPurchaseOrderSent(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
break; break;
case pNonWarrantyInvoiceReceived: case pNonWarrantyInvoiceReceived:
resultData = UpdateNonWarrantyInvoiceReceived(job, value); resultData = UpdateNonWarrantyInvoiceReceived(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
break; break;
case pNonWarrantyRepairerName: case pNonWarrantyRepairerName:
UpdateNonWarrantyRepairerName(job, value); UpdateNonWarrantyRepairerName(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyRepairs;
break; break;
case pNonWarrantyRepairerLoggedDate: case pNonWarrantyRepairerLoggedDate:
UpdateNonWarrantyRepairerLoggedDate(job, value); UpdateNonWarrantyRepairerLoggedDate(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyRepairs;
break; break;
case pNonWarrantyRepairerReference: case pNonWarrantyRepairerReference:
UpdateNonWarrantyRepairerReference(job, value); UpdateNonWarrantyRepairerReference(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyRepairs;
break; break;
case pNonWarrantyRepairerCompletedDate: case pNonWarrantyRepairerCompletedDate:
UpdateNonWarrantyRepairerCompletedDate(job, value); UpdateNonWarrantyRepairerCompletedDate(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyRepairs;
break; break;
case pNonWarrantyIsInsuranceClaim: case pNonWarrantyIsInsuranceClaim:
UpdateNonWarrantyIsInsuranceClaim(job, value); UpdateNonWarrantyIsInsuranceClaim(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceLossOrDamageDate: case pInsuranceLossOrDamageDate:
UpdateInsuranceLossOrDamageDate(job, value); UpdateInsuranceLossOrDamageDate(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceEventLocation: case pInsuranceEventLocation:
UpdateInsuranceEventLocation(job, value); UpdateInsuranceEventLocation(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceDescription: case pInsuranceDescription:
UpdateInsuranceDescription(job, value); UpdateInsuranceDescription(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceThirdPartyCaused: case pInsuranceThirdPartyCaused:
UpdateInsuranceThirdPartyCaused(job, value); UpdateInsuranceThirdPartyCaused(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceThirdPartyCausedName: case pInsuranceThirdPartyCausedName:
UpdateInsuranceThirdPartyCausedName(job, value); UpdateInsuranceThirdPartyCausedName(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceThirdPartyCausedWhy: case pInsuranceThirdPartyCausedWhy:
UpdateInsuranceThirdPartyCausedWhy(job, value); UpdateInsuranceThirdPartyCausedWhy(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceWitnessesNamesAddresses: case pInsuranceWitnessesNamesAddresses:
UpdateInsuranceWitnessesNamesAddresses(job, value); UpdateInsuranceWitnessesNamesAddresses(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceBurglaryTheftMethodOfEntry: case pInsuranceBurglaryTheftMethodOfEntry:
UpdateInsuranceBurglaryTheftMethodOfEntry(job, value); UpdateInsuranceBurglaryTheftMethodOfEntry(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsurancePropertyLastSeenDate: case pInsurancePropertyLastSeenDate:
UpdateInsurancePropertyLastSeenDate(job, value); UpdateInsurancePropertyLastSeenDate(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsurancePoliceNotified: case pInsurancePoliceNotified:
UpdateInsurancePoliceNotified(job, value); UpdateInsurancePoliceNotified(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsurancePoliceNotifiedStation: case pInsurancePoliceNotifiedStation:
UpdateInsurancePoliceNotifiedStation(job, value); UpdateInsurancePoliceNotifiedStation(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsurancePoliceNotifiedDate: case pInsurancePoliceNotifiedDate:
UpdateInsurancePoliceNotifiedDate(job, value); UpdateInsurancePoliceNotifiedDate(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsurancePoliceNotifiedCrimeReportNo: case pInsurancePoliceNotifiedCrimeReportNo:
UpdateInsurancePoliceNotifiedCrimeReportNo(job, value); UpdateInsurancePoliceNotifiedCrimeReportNo(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceRecoverReduceAction: case pInsuranceRecoverReduceAction:
UpdateInsuranceRecoverReduceAction(job, value); UpdateInsuranceRecoverReduceAction(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceOtherInterestedParties: case pInsuranceOtherInterestedParties:
UpdateInsuranceOtherInterestedParties(job, value); UpdateInsuranceOtherInterestedParties(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceDateOfPurchase: case pInsuranceDateOfPurchase:
UpdateInsuranceDateOfPurchase(job, value); UpdateInsuranceDateOfPurchase(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pInsuranceClaimFormSentDate: case pInsuranceClaimFormSentDate:
resultData = UpdateInsuranceClaimFormSentDate(job, value); resultData = UpdateInsuranceClaimFormSentDate(job, value);
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
break; break;
case pWarrantyExternalName: case pWarrantyExternalName:
UpdateWarrantyExternalName(job, value); UpdateWarrantyExternalName(job, value);
resultUrlFragment = pJobDetailsTabWarranty;
break; break;
case pWarrantyExternalLoggedDate: case pWarrantyExternalLoggedDate:
UpdateWarrantyExternalLoggedDate(job, value); UpdateWarrantyExternalLoggedDate(job, value);
resultUrlFragment = pJobDetailsTabWarranty;
break; break;
case pWarrantyExternalReference: case pWarrantyExternalReference:
UpdateWarrantyExternalReference(job, value); UpdateWarrantyExternalReference(job, value);
resultUrlFragment = pJobDetailsTabWarranty;
break; break;
case pWarrantyExternalCompletedDate: case pWarrantyExternalCompletedDate:
UpdateWarrantyExternalCompletedDate(job, value); UpdateWarrantyExternalCompletedDate(job, value);
resultUrlFragment = pJobDetailsTabWarranty;
break; break;
default: default:
throw new Exception("Invalid Update Key"); throw new Exception("Invalid Update Key");
@@ -193,7 +236,8 @@ namespace Disco.Web.Areas.API.Controllers
throw new Exception("Invalid Job Id"); throw new Exception("Invalid Job Id");
} }
if (redirect.HasValue && redirect.Value) if (redirect.HasValue && redirect.Value)
return RedirectToAction(MVC.Job.Show(job.Id)); return this.RedirectToAction(MVC.Job.Show(job.Id), resultUrlFragment);
//return RedirectToAction(MVC.Job.Show(job.Id));
else else
{ {
if (resultData != null) if (resultData != null)
@@ -539,7 +583,7 @@ namespace Disco.Web.Areas.API.Controllers
Id = job.Id, Id = job.Id,
Result = "OK", Result = "OK",
UserDescription = DiscoApplication.CurrentUser.ToString() UserDescription = DiscoApplication.CurrentUser.ToString()
}; }.SetDateTime(job.JobMetaNonWarranty.AccountingChargeRequiredDate);
} }
private Models.Job._DateChangeModel UpdateNonWarrantyAccountingChargeAdded(Job job, string AccountingChargeAddedDate) private Models.Job._DateChangeModel UpdateNonWarrantyAccountingChargeAdded(Job job, string AccountingChargeAddedDate)
{ {
@@ -574,7 +618,7 @@ namespace Disco.Web.Areas.API.Controllers
Id = job.Id, Id = job.Id,
Result = "OK", Result = "OK",
UserDescription = DiscoApplication.CurrentUser.ToString() UserDescription = DiscoApplication.CurrentUser.ToString()
}; }.SetDateTime(job.JobMetaNonWarranty.AccountingChargeAddedDate);
} }
private Models.Job._DateChangeModel UpdateNonWarrantyAccountingChargePaid(Job job, string AccountingChargePaidDate) private Models.Job._DateChangeModel UpdateNonWarrantyAccountingChargePaid(Job job, string AccountingChargePaidDate)
{ {
@@ -609,7 +653,7 @@ namespace Disco.Web.Areas.API.Controllers
Id = job.Id, Id = job.Id,
Result = "OK", Result = "OK",
UserDescription = DiscoApplication.CurrentUser.ToString() UserDescription = DiscoApplication.CurrentUser.ToString()
}; }.SetDateTime(job.JobMetaNonWarranty.AccountingChargePaidDate);
} }
private Models.Job._DateChangeModel UpdateNonWarrantyPurchaseOrderRaised(Job job, string PurchaseOrderRaisedDate) private Models.Job._DateChangeModel UpdateNonWarrantyPurchaseOrderRaised(Job job, string PurchaseOrderRaisedDate)
{ {
@@ -643,7 +687,7 @@ namespace Disco.Web.Areas.API.Controllers
Id = job.Id, Id = job.Id,
Result = "OK", Result = "OK",
UserDescription = DiscoApplication.CurrentUser.ToString() UserDescription = DiscoApplication.CurrentUser.ToString()
}; }.SetDateTime(job.JobMetaNonWarranty.PurchaseOrderRaisedDate);
} }
private void UpdateNonWarrantyPurchaseOrderReference(Job job, string PurchaseOrderReference) private void UpdateNonWarrantyPurchaseOrderReference(Job job, string PurchaseOrderReference)
{ {
@@ -686,7 +730,7 @@ namespace Disco.Web.Areas.API.Controllers
Id = job.Id, Id = job.Id,
Result = "OK", Result = "OK",
UserDescription = DiscoApplication.CurrentUser.ToString() UserDescription = DiscoApplication.CurrentUser.ToString()
}; }.SetDateTime(job.JobMetaNonWarranty.PurchaseOrderSentDate);
} }
private Models.Job._DateChangeModel UpdateNonWarrantyInvoiceReceived(Job job, string InvoiceReceivedDate) private Models.Job._DateChangeModel UpdateNonWarrantyInvoiceReceived(Job job, string InvoiceReceivedDate)
{ {
@@ -720,7 +764,7 @@ namespace Disco.Web.Areas.API.Controllers
Id = job.Id, Id = job.Id,
Result = "OK", Result = "OK",
UserDescription = DiscoApplication.CurrentUser.ToString() UserDescription = DiscoApplication.CurrentUser.ToString()
}; }.SetDateTime(job.JobMetaNonWarranty.InvoiceReceivedDate);
} }
private void UpdateNonWarrantyRepairerName(Job job, string RepairerName) private void UpdateNonWarrantyRepairerName(Job job, string RepairerName)
@@ -869,7 +913,7 @@ namespace Disco.Web.Areas.API.Controllers
Id = job.Id, Id = job.Id,
Result = "OK", Result = "OK",
UserDescription = DiscoApplication.CurrentUser.ToString() UserDescription = DiscoApplication.CurrentUser.ToString()
}; }.SetDateTime(job.JobMetaInsurance.ClaimFormSentDate);
} }
private void UpdateInsuranceDateOfPurchase(Job job, string DateOfPurchase) private void UpdateInsuranceDateOfPurchase(Job job, string DateOfPurchase)
@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web; using System.Web;
using Disco.BI.Extensions;
namespace Disco.Web.Areas.API.Models.Job namespace Disco.Web.Areas.API.Models.Job
{ {
@@ -10,5 +11,19 @@ namespace Disco.Web.Areas.API.Models.Job
public int Id { get; set; } public int Id { get; set; }
public string Result { get; set; } public string Result { get; set; }
public string UserDescription { get; set; } public string UserDescription { get; set; }
public string DateTimeFull { get; set; }
public string DateTimeFriendly { get; set; }
public string DateTimeJavascript { get; set; }
public long DateTimeSortable { get; set; }
public _DateChangeModel SetDateTime(DateTime? date)
{
this.DateTimeFriendly = date.ToFuzzy(null);
this.DateTimeJavascript = date.ToJavascriptDateTime();
this.DateTimeSortable = date.ToSortableDateTime();
this.DateTimeFull = date.ToFullDateTime(null);
return this;
}
} }
} }
+1 -3
View File
@@ -1,5 +1,4 @@
/*#source /ClientSource/Style/jQueryUI/jquery-ui.css */ /*! jQuery UI - v1.10.1 - 2013-02-18
/*! jQuery UI - v1.10.1 - 2013-02-18
* http://jqueryui.com * http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
@@ -1175,7 +1174,6 @@ body .ui-tooltip {
border-radius: 5px; border-radius: 5px;
} }
/*#source /ClientSource/Style/Site.css */
.tableData { .tableData {
border: solid 1px #e8eef4; border: solid 1px #e8eef4;
border-collapse: collapse; border-collapse: collapse;
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -4
View File
@@ -1,5 +1,4 @@
/*#source /ClientSource/Style/Timeline/graphics.css */ div.simileAjax-bubble-container {
div.simileAjax-bubble-container {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
border: none; border: none;
@@ -171,7 +170,6 @@ div.simileAjax-bubble-close {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB1UlEQVQ4y72Tu4saURjFhW23TRvIH7BtIH9AIKW1iCBiQE3hAyG6qIgBRXwERWRQUSMpdH2gDoiigvgMTCHiA8VH5btJFQgsnL13IGlmk2VZdouvmGHO73zn3DsiAKKnjOhZAIPB4E2/3//U7Xa/tdttptVqfWw2m68eBBDhBRFek/k1mUywWq2wWCwwHA5Rr9d/1mo1yX8BvV4vOJ1Osd/vcT6fcTqdcDwecTgcsFwuQQzAsqzxXkCn03nHcRwvoh/P5/O/YvqezmazQSaT+Z1KpV4LACRnlK5LRePxGOQZo9GIFyYSCVQqFdBYpVIJ4XD4swBASvpBHajjH9d0Oo1YLIZiscj3QLZENpuF2+2+EQBIQdx6vebz73Y7kPYRCARgs9kQiUTQaDR4UDQahdVqFQLIit/pitvtFgQGu93OC30+H8RiMSwWC+LxOFwuFwwGwxcBoFwufyBHhdlshkKhgGAwyOemK+t0OphMJh6m0WhuVSrV1b3HmEwm2Vwuh2q1inw+D9I2GIaB3++H0+mEVquFXC7/+s97EAqFLj0eD0udaH6v1wuHwwGj0QilUgmpVMpIJJKLB6+y2Wx+r9frb9RqNadQKDiZTEaFb1/uZ3rM3AHRX/GLx8FvpQAAAABJRU5ErkJggg==) /*images/close-button.png*/ no-repeat; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB1UlEQVQ4y72Tu4saURjFhW23TRvIH7BtIH9AIKW1iCBiQE3hAyG6qIgBRXwERWRQUSMpdH2gDoiigvgMTCHiA8VH5btJFQgsnL13IGlmk2VZdouvmGHO73zn3DsiAKKnjOhZAIPB4E2/3//U7Xa/tdttptVqfWw2m68eBBDhBRFek/k1mUywWq2wWCwwHA5Rr9d/1mo1yX8BvV4vOJ1Osd/vcT6fcTqdcDwecTgcsFwuQQzAsqzxXkCn03nHcRwvoh/P5/O/YvqezmazQSaT+Z1KpV4LACRnlK5LRePxGOQZo9GIFyYSCVQqFdBYpVIJ4XD4swBASvpBHajjH9d0Oo1YLIZiscj3QLZENpuF2+2+EQBIQdx6vebz73Y7kPYRCARgs9kQiUTQaDR4UDQahdVqFQLIit/pitvtFgQGu93OC30+H8RiMSwWC+LxOFwuFwwGwxcBoFwufyBHhdlshkKhgGAwyOemK+t0OphMJh6m0WhuVSrV1b3HmEwm2Vwuh2q1inw+D9I2GIaB3++H0+mEVquFXC7/+s97EAqFLj0eD0udaH6v1wuHwwGj0QilUgmpVMpIJJKLB6+y2Wx+r9frb9RqNadQKDiZTEaFb1/uZ3rM3AHRX/GLx8FvpQAAAABJRU5ErkJggg==) /*images/close-button.png*/ no-repeat;
} }
/*#source /ClientSource/Style/Timeline/timeline-bundle.css */
/*------------------- Horizontal / Vertical lines ----------------*/ /*------------------- Horizontal / Vertical lines ----------------*/
@@ -402,7 +400,6 @@ div.simileAjax-bubble-close {
} }
/*#source /ClientSource/Style/Timeline/disco.timelineextensions.css */
.timeline-container { .timeline-container {
border: 1px solid #aaa; border: 1px solid #aaa;
} }
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -173,6 +173,7 @@
<Compile Include="Controllers\InitialConfigController.cs" /> <Compile Include="Controllers\InitialConfigController.cs" />
<Compile Include="Controllers\PluginWebHandlerController.cs" /> <Compile Include="Controllers\PluginWebHandlerController.cs" />
<Compile Include="Controllers\UpdateController.cs" /> <Compile Include="Controllers\UpdateController.cs" />
<Compile Include="Extensions\ControllerExtensions.cs" />
<Compile Include="Extensions\HtmlExtensions.cs" /> <Compile Include="Extensions\HtmlExtensions.cs" />
<Compile Include="App_Start\AppConfig.cs" /> <Compile Include="App_Start\AppConfig.cs" />
<Compile Include="App_Start\BundleConfig.cs" /> <Compile Include="App_Start\BundleConfig.cs" />
@@ -1837,7 +1838,7 @@
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties> </WebProjectProperties>
</FlavorProperties> </FlavorProperties>
<UserProperties BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" BuildVersion_BuildAction="ReBuild" BuildVersion_StartDate="2001/1/1" /> <UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_BuildAction="ReBuild" BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" />
</VisualStudio> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Disco.Web.Extensions
{
public static class ControllerExtensions
{
public static ActionResult RedirectToAction(this Controller controller, ActionResult result, string urlFragment)
{
var callInfo = result.GetT4MVCResult();
if (!string.IsNullOrWhiteSpace(urlFragment))
{
var url = UrlHelper.GenerateUrl(null, null, null, callInfo.RouteValueDictionary, RouteTable.Routes, controller.HttpContext.Request.RequestContext, false);
url = string.Concat(url, "#", urlFragment);
return new RedirectResult(url, false);
}
else
{
return new RedirectToRouteResult(callInfo.RouteValueDictionary);
}
}
}
}
+1 -1
View File
@@ -77,7 +77,7 @@ namespace Disco.Web
public static MvcHtmlString ToMultilineString(this string s) public static MvcHtmlString ToMultilineString(this string s)
{ {
return new MvcHtmlString(HttpUtility.HtmlEncode(s).Replace("\n", "<br />").Replace(Environment.NewLine, "<br />")); return new MvcHtmlString(HttpUtility.HtmlEncode(s).Replace(Environment.NewLine, "<br />").Replace("\n", "<br />").Replace("\r", "<br />"));
} }
public static List<Tuple<string, ActionResult>> ToBreadcrumb(this HtmlHelper htmlHelper, string title1, ActionResult link1, string title2 = null, ActionResult link2 = null, string title3 = null, ActionResult link3 = null, string title4 = null, ActionResult link4 = null, string title5 = null, ActionResult link5 = null) public static List<Tuple<string, ActionResult>> ToBreadcrumb(this HtmlHelper htmlHelper, string title1, ActionResult link1, string title2 = null, ActionResult link2 = null, string title3 = null, ActionResult link3 = null, string title4 = null, ActionResult link4 = null, string title5 = null, ActionResult link5 = null)
+2 -2
View File
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// //
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("1.2.0319.1534")] [assembly: AssemblyVersion("1.2.0326.1428")]
[assembly: AssemblyFileVersion("1.2.0319.1534")] [assembly: AssemblyFileVersion("1.2.0326.1428")]
@@ -1,96 +1,43 @@
@model Disco.Web.Models.Job.ShowModel @model Disco.Web.Models.Job.ShowModel
<table id="jobNonWarrantyFinance"> <table id="jobNonWarrantyFinance">
<tr> <tr>
<th style="width: 200px;"> <th style="width: 200px;">Accounting Charge Required
Accounting Charge Required
</th> </th>
<td> <td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeRequiredDate) @CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredDate, "Not Required", "Job_JobMetaNonWarranty_AccountingChargeRequiredDate")
<span id="Job_JobMetaNonWarranty_AccountingChargeRequiredUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString()))</span> <span id="Job_JobMetaNonWarranty_AccountingChargeRequiredUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString()))</span>
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredDate'),
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredUser'),
'Not Required',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeRequired(Model.Job.Id, null)))',
'AccountingChargeRequiredDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 200px;"> <th style="width: 200px;">Accounting Charge Added
Accounting Charge Added
</th> </th>
<td> <td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeAddedDate) @CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeAddedDate, "Not Added", "Job_JobMetaNonWarranty_AccountingChargeAddedDate")
<span id="Job_JobMetaNonWarranty_AccountingChargeAddedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString()))</span> <span id="Job_JobMetaNonWarranty_AccountingChargeAddedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString()))</span>
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargeAddedDate'),
$('#Job_JobMetaNonWarranty_AccountingChargeAddedUser'),
'Not Added',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeAdded(Model.Job.Id, null)))',
'AccountingChargeAddedDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 200px;"> <th style="width: 200px;">Accounting Charge Paid
Accounting Charge Paid
</th> </th>
<td> <td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargePaidDate) @CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargePaidDate, "Not Paid", "Job_JobMetaNonWarranty_AccountingChargePaidDate")
<span id="Job_JobMetaNonWarranty_AccountingChargePaidUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString()))</span> <span id="Job_JobMetaNonWarranty_AccountingChargePaidUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString()))</span>
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargePaidDate'),
$('#Job_JobMetaNonWarranty_AccountingChargePaidUser'),
'Not Paid',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargePaid(Model.Job.Id, null)))',
'AccountingChargePaidDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 200px;"> <th style="width: 200px;">Purchase Order Raised
Purchase Order Raised
</th> </th>
<td> <td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate) @CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate, "Not Raised", "Job_JobMetaNonWarranty_PurchaseOrderRaisedDate")
<span id="Job_JobMetaNonWarranty_PurchaseOrderRaisedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString()))</span> <span id="Job_JobMetaNonWarranty_PurchaseOrderRaisedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString()))</span>
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedDate'),
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedUser'),
'Not Raised',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderRaised(Model.Job.Id, null)))',
'PurchaseOrderRaisedDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th> <th>Purchase Order Reference
Purchase Order Reference
</th> </th>
<td> <td>
@Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference) @Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference)
@@ -138,47 +85,165 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 200px;"> <th style="width: 200px;">Purchase Order Sent
Purchase Order Sent
</th> </th>
<td> <td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderSentDate) @CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderSentDate, "Not Sent", "Job_JobMetaNonWarranty_PurchaseOrderSentDate")
<span id="Job_JobMetaNonWarranty_PurchaseOrderSentUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString()))</span> <span id="Job_JobMetaNonWarranty_PurchaseOrderSentUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString()))</span>
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_PurchaseOrderSentDate'),
$('#Job_JobMetaNonWarranty_PurchaseOrderSentUser'),
'Not Sent',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderSent(Model.Job.Id, null)))',
'PurchaseOrderSentDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 200px;"> <th style="width: 200px;">Invoice Received
Invoice Received
</th> </th>
<td> <td>
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.InvoiceReceivedDate) @CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.InvoiceReceivedDate, "Not Received", "Job_JobMetaNonWarranty_InvoiceReceivedDate")
<span id="Job_JobMetaNonWarranty_InvoiceReceivedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString()))</span> <span id="Job_JobMetaNonWarranty_InvoiceReceivedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString()))</span>
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_InvoiceReceivedDate'),
$('#Job_JobMetaNonWarranty_InvoiceReceivedUser'),
'Not Received',
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyInvoiceReceived(Model.Job.Id, null)))',
'InvoiceReceivedDate',
@(Model.Job.OpenedDate.ToJavascriptDate())
);
});
</script>
</td> </td>
</tr> </tr>
</table> </table>
<script>
(function(){
var baseUpdateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
var dialog, dialogForm, dialogHeader, dialogDateBox, dialogDatePropertyNameBox;
var friendlyName, dateField, userField, updatePropertyName, notSetDisplay, minDate, useAjax;
function dateDialogGet(){
if (!dialog){
dialog = $('<div>').attr({'class': 'dialog'})
dialogForm = $('<form>').attr({'action': baseUpdateUrl, 'method': 'post'}).appendTo(dialog);
var dialogBody = $('<p>').appendTo(dialogForm);
dialogHeader = $('<h3>').attr('autofocus', 'autofocus').appendTo(dialogBody);
dialogDatePropertyNameBox = $('<input>').attr({'type': 'hidden', 'name': 'key'}).appendTo(dialogBody);
dialogDateBox = $('<input>').attr({'type': 'datetime', 'name': 'value'}).css({'display': 'block', 'margin-top': 15, 'margin-left': 'auto', 'margin-right': 'auto' }).appendTo(dialogBody);
$('<input>').attr({'type': 'hidden', 'name': 'redirect'}).val('true').appendTo(dialogBody);
dialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Update": dateDialogUpdate,
Cancel: function () {
$(this).dialog("close");
}
},
open: function(){
dialog.dialog('widget').find('.ui-dialog-buttonpane :tabbable:first').focus();
}
});
dialogDateBox.datetimepicker({
defaultDate: new Date(),
ampm: true,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd',
});
}
return dialog;
}
function dateDialogUpdate(){
var dateValue = dialogDateBox.val();
if (useAjax){
// Use Ajax
var $dateField, $userField;
$dateField = $('#' + dateField);
if (userField)
$userField = $('#' + userField);
dialog.dialog("close");
var $ajaxLoading = ($userField ? $userField.next('.ajaxLoading') : $dateField.next('.ajaxLoading')).show();
var data = {
key: updatePropertyName,
value: dateValue
};
$.getJSON(baseUpdateUrl, data, function (response, result) {
if (result != 'success' || response.Result != 'OK') {
alert('Unable to change ' + friendlyName + ' Date:\n' + response);
$ajaxLoading.hide();
} else {
if (response.DateTimeFull){
$dateField.attr('data-datetimeformatted', response.DateTimeJavascript)
.attr('data-discodatetime', response.DateTimeSortable)
.attr('title', response.DateTimeFull)
.text(response.DateTimeFriendly);
}else{
$dateField.attr('data-datetimeformatted', '')
.attr('data-discodatetime', '-1')
.attr('title', notSetDisplay)
.text(notSetDisplay);
}
if ($userField)
$userField.text('by ' + response.UserDescription);
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
}else{
// Post Form & Redirect
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
dialogDatePropertyNameBox.val(updatePropertyName);
dialogForm.submit();
}
}
function dateDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax){
friendlyName = FriendlyName;
dateField = DateField;
userField = UserField;
updatePropertyName = UpdatePropertyName;
notSetDisplay = NotSetDisplay;
minDate = MinDate;
useAjax = UseAjax;
var d = dateDialogGet();
d.dialog('option', 'title', friendlyName);
dialogHeader.text(friendlyName + ' Date');
var dfVal = $('#' + DateField).attr('data-datetimeformatted');
if (dfVal)
dialogDateBox.datetimepicker('setDate', new Date(dfVal));
else
dialogDateBox.datetimepicker('setDate', new Date());
if (MinDate)
dialogDateBox.datetimepicker('option', 'minDate', MinDate);
else
dialogDateBox.datetimepicker('option', 'minDate', null);
d.dialog('open');
}
function dateDialogCreateUpdater(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax){
$('<a>').attr({href: '#', 'class': 'button small', style: 'margin-right: 5px;'}).text('Update').click(function(event){
event.preventDefault();
dateDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax);
}).insertBefore('#' + DateField);
}
if (!document.DiscoFunctions)
document.DiscoFunctions = {};
if (!document.DiscoFunctions.DateDialogCreateUpdater)
document.DiscoFunctions.DateDialogCreateUpdater = dateDialogCreateUpdater;
})();
$(function(){
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavascriptDateTime())';
document.DiscoFunctions.DateDialogCreateUpdater('Accounting Charge Required', 'Job_JobMetaNonWarranty_AccountingChargeRequiredDate', 'Job_JobMetaNonWarranty_AccountingChargeRequiredUser', 'NonWarrantyAccountingChargeRequired', 'Not Required', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater('Accounting Charge Added', 'Job_JobMetaNonWarranty_AccountingChargeAddedDate', 'Job_JobMetaNonWarranty_AccountingChargeAddedUser', 'NonWarrantyAccountingChargeAdded', 'Not Added', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater('Accounting Charge Paid', 'Job_JobMetaNonWarranty_AccountingChargePaidDate', 'Job_JobMetaNonWarranty_AccountingChargePaidUser', 'NonWarrantyAccountingChargePaid', 'Not Paid', jobOpenDate, false);
document.DiscoFunctions.DateDialogCreateUpdater('Purchase Order Raised', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedDate', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedUser', 'NonWarrantyPurchaseOrderRaised', 'Not Raised', jobOpenDate, true);
document.DiscoFunctions.DateDialogCreateUpdater('Purchase Order Sent', 'Job_JobMetaNonWarranty_PurchaseOrderSentDate', 'Job_JobMetaNonWarranty_PurchaseOrderSentUser', 'NonWarrantyPurchaseOrderSent', 'Not Sent', jobOpenDate, true);
document.DiscoFunctions.DateDialogCreateUpdater('Invoice Received', 'Job_JobMetaNonWarranty_InvoiceReceivedDate', 'Job_JobMetaNonWarranty_InvoiceReceivedUser', 'NonWarrantyInvoiceReceived', 'Not Received', jobOpenDate, true);
});
</script>
@@ -31,9 +31,9 @@ namespace Disco.Web.Views.Job.JobParts
using Disco.Web; using Disco.Web;
using Disco.Web.Extensions; using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.4.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/NonWarrantyFinance.cshtml")] [System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/NonWarrantyFinance.cshtml")]
public class NonWarrantyFinance : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel> public partial class NonWarrantyFinance : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{ {
public NonWarrantyFinance() public NonWarrantyFinance()
{ {
@@ -48,13 +48,13 @@ WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\""); WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Accounting Charge Required\r\n </th>\r\n <td>\r\n"); WriteLiteral(">Accounting Charge Required\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 8 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 7 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeRequiredDate)); Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredDate, "Not Required", "Job_JobMetaNonWarranty_AccountingChargeRequiredDate"));
#line default #line default
@@ -66,7 +66,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeRequiredUser\"");
WriteLiteral(">"); WriteLiteral(">");
#line 9 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 8 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString())); Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString()));
@@ -77,54 +77,23 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 10 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 9 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader()); Write(AjaxHelpers.AjaxLoader());
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n <script"); WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredDate'),
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredUser'),
'Not Required',
'");
#line 17 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeRequired(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'AccountingChargeRequiredDate\',\r\n");
WriteLiteral(" ");
#line 19 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\""); WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Accounting Charge Added\r\n </th>\r\n <td>\r\n"); WriteLiteral(">Accounting Charge Added\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 30 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 16 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeAddedDate)); Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeAddedDate, "Not Added", "Job_JobMetaNonWarranty_AccountingChargeAddedDate"));
#line default #line default
@@ -136,7 +105,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeAddedUser\"");
WriteLiteral(">"); WriteLiteral(">");
#line 31 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 17 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString())); Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString()));
@@ -147,54 +116,23 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 32 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 18 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader()); Write(AjaxHelpers.AjaxLoader());
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n <script"); WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargeAddedDate'),
$('#Job_JobMetaNonWarranty_AccountingChargeAddedUser'),
'Not Added',
'");
#line 39 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeAdded(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'AccountingChargeAddedDate\',\r\n");
WriteLiteral(" ");
#line 41 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\""); WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Accounting Charge Paid\r\n </th>\r\n <td>\r\n"); WriteLiteral(">Accounting Charge Paid\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 52 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 25 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargePaidDate)); Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargePaidDate, "Not Paid", "Job_JobMetaNonWarranty_AccountingChargePaidDate"));
#line default #line default
@@ -206,7 +144,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargePaidUser\"");
WriteLiteral(">"); WriteLiteral(">");
#line 53 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 26 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString())); Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString()));
@@ -217,54 +155,23 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 54 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 27 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader()); Write(AjaxHelpers.AjaxLoader());
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n <script"); WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_AccountingChargePaidDate'),
$('#Job_JobMetaNonWarranty_AccountingChargePaidUser'),
'Not Paid',
'");
#line 61 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargePaid(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'AccountingChargePaidDate\',\r\n");
WriteLiteral(" ");
#line 63 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\""); WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Purchase Order Raised\r\n </th>\r\n <td>\r\n"); WriteLiteral(">Purchase Order Raised\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 74 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 34 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate)); Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate, "Not Raised", "Job_JobMetaNonWarranty_PurchaseOrderRaisedDate"));
#line default #line default
@@ -276,7 +183,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderRaisedUser\"");
WriteLiteral(">"); WriteLiteral(">");
#line 75 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 35 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString())); Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString()));
@@ -287,50 +194,19 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 76 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 36 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader()); Write(AjaxHelpers.AjaxLoader());
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n <script"); WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Purchase Order Reference\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedDate'),
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedUser'),
'Not Raised',
'");
#line 83 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderRaised(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'PurchaseOrderRaisedDate\',\r\n");
WriteLiteral(" ");
#line 85 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n Purchase Order Reference\r" +
"\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 96 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 43 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference)); Write(Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference));
@@ -341,7 +217,7 @@ WriteLiteral("\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 97 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 44 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxSave()); Write(AjaxHelpers.AjaxSave());
@@ -352,7 +228,7 @@ WriteLiteral("\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 98 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 45 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader()); Write(AjaxHelpers.AjaxLoader());
@@ -385,7 +261,7 @@ WriteLiteral(@">
url: '"); url: '");
#line 119 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 66 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderReference(Model.Job.Id, null))); Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderReference(Model.Job.Id, null)));
@@ -417,13 +293,13 @@ WriteLiteral(@"',
WriteLiteral(" style=\"width: 200px;\""); WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Purchase Order Sent\r\n </th>\r\n <td>\r\n"); WriteLiteral(">Purchase Order Sent\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 145 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 91 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderSentDate)); Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderSentDate, "Not Sent", "Job_JobMetaNonWarranty_PurchaseOrderSentDate"));
#line default #line default
@@ -435,7 +311,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderSentUser\"");
WriteLiteral(">"); WriteLiteral(">");
#line 146 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 92 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString())); Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString()));
@@ -446,54 +322,23 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 147 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 93 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader()); Write(AjaxHelpers.AjaxLoader());
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n <script"); WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_PurchaseOrderSentDate'),
$('#Job_JobMetaNonWarranty_PurchaseOrderSentUser'),
'Not Sent',
'");
#line 154 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderSent(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n \'PurchaseOrderSentDate\',\r\n");
WriteLiteral(" ");
#line 156 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate());
#line default
#line hidden
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\""); WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">\r\n Invoice Received\r\n </th>\r\n <td>\r\n"); WriteLiteral(">Invoice Received\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 167 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 100 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.InvoiceReceivedDate)); Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.InvoiceReceivedDate, "Not Received", "Job_JobMetaNonWarranty_InvoiceReceivedDate"));
#line default #line default
@@ -505,7 +350,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_InvoiceReceivedUser\"");
WriteLiteral(">"); WriteLiteral(">");
#line 168 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 101 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString())); Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString()));
@@ -516,44 +361,125 @@ WriteLiteral("</span>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 169 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 102 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(AjaxHelpers.AjaxLoader()); Write(AjaxHelpers.AjaxLoader());
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n <script"); WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n (function(){\r\n var bas" +
"eUpdateUrl = \'");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
document.DiscoFunctions.DateChangeUserHelper(
$('#Job_JobMetaNonWarranty_InvoiceReceivedDate'),
$('#Job_JobMetaNonWarranty_InvoiceReceivedUser'),
'Not Received',
'");
#line 176 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 108 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyInvoiceReceived(Model.Job.Id, null))); Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));
#line default #line default
#line hidden #line hidden
WriteLiteral("\',\r\n \'InvoiceReceivedDate\',\r\n"); WriteLiteral("\';\r\n\r\n var dialog, dialogForm, dialogHeader, dialogDateBox, dialogDateProp" +
"ertyNameBox;\r\n var friendlyName, dateField, userField, updatePropertyName" +
WriteLiteral(" "); ", notSetDisplay, minDate, useAjax;\r\n\r\n function dateDialogGet(){\r\n " +
" if (!dialog){\r\n dialog = $(\'<div>\').attr({\'class\': \'dialog\'}" +
")\r\n dialogForm = $(\'<form>\').attr({\'action\': baseUpdateUrl, \'meth" +
"od\': \'post\'}).appendTo(dialog);\r\n var dialogBody = $(\'<p>\').appen" +
"dTo(dialogForm);\r\n dialogHeader = $(\'<h3>\').attr(\'autofocus\', \'au" +
"tofocus\').appendTo(dialogBody);\r\n dialogDatePropertyNameBox = $(\'" +
"<input>\').attr({\'type\': \'hidden\', \'name\': \'key\'}).appendTo(dialogBody);\r\n " +
" dialogDateBox = $(\'<input>\').attr({\'type\': \'datetime\', \'name\': \'value\'}" +
").css({\'display\': \'block\', \'margin-top\': 15, \'margin-left\': \'auto\', \'margin-righ" +
"t\': \'auto\' }).appendTo(dialogBody);\r\n $(\'<input>\').attr({\'type\': " +
"\'hidden\', \'name\': \'redirect\'}).val(\'true\').appendTo(dialogBody);\r\n\r\n " +
" dialog.dialog({\r\n resizable: false,\r\n " +
"modal: true,\r\n autoOpen: false,\r\n buttons:" +
" {\r\n \"Update\": dateDialogUpdate,\r\n " +
" Cancel: function () {\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n },\r\n open: funct" +
"ion(){\r\n dialog.dialog(\'widget\').find(\'.ui-dialog-buttonp" +
"ane :tabbable:first\').focus();\r\n }\r\n });\r\n " +
" dialogDateBox.datetimepicker({\r\n defaultDate: new" +
" Date(),\r\n ampm: true,\r\n changeYear: true," +
"\r\n changeMonth: true,\r\n dateFormat: \'yy/mm" +
"/dd\',\r\n });\r\n }\r\n return dialog;\r\n }" +
"\r\n\r\n function dateDialogUpdate(){\r\n var dateValue = dialogDate" +
"Box.val();\r\n\r\n if (useAjax){\r\n // Use Ajax\r\n " +
" var $dateField, $userField;\r\n $dateField = $(\'#\' + dateFiel" +
"d);\r\n if (userField)\r\n $userField = $(\'#\' + us" +
"erField);\r\n\r\n dialog.dialog(\"close\");\r\n\r\n var $aja" +
"xLoading = ($userField ? $userField.next(\'.ajaxLoading\') : $dateField.next(\'.aja" +
"xLoading\')).show();\r\n\r\n var data = {\r\n key: up" +
"datePropertyName,\r\n value: dateValue\r\n };\r\n " +
" $.getJSON(baseUpdateUrl, data, function (response, result) {\r\n " +
" if (result != \'success\' || response.Result != \'OK\') {\r\n " +
" alert(\'Unable to change \' + friendlyName + \' Date:\\n\' + response);" +
"\r\n $ajaxLoading.hide();\r\n } else {\r\n " +
" if (response.DateTimeFull){\r\n $" +
"dateField.attr(\'data-datetimeformatted\', response.DateTimeJavascript)\r\n " +
" .attr(\'data-discodatetime\', response.DateTimeSortable)\r\n " +
" .attr(\'title\', response.DateTimeFull)\r\n " +
" .text(response.DateTimeFriendly);\r\n " +
" }else{\r\n $dateField.attr(\'data-datetimeformatted\', \'" +
"\')\r\n .attr(\'data-discodatetime\', \'-1\')\r\n " +
" .attr(\'title\', notSetDisplay)\r\n " +
" .text(notSetDisplay);\r\n }\r\n " +
"if ($userField)\r\n $userField.text(\'by \' + response.Us" +
"erDescription);\r\n $ajaxLoading.hide().next(\'.ajaxOk\').sho" +
"w().delay(\'fast\').fadeOut(\'slow\');\r\n }\r\n })\r\n " +
" }else{\r\n // Post Form & Redirect\r\n dial" +
"og.dialog(\"disable\");\r\n dialog.dialog(\"option\", \"buttons\", null);" +
"\r\n\r\n dialogDatePropertyNameBox.val(updatePropertyName);\r\n\r\n " +
" dialogForm.submit();\r\n }\r\n }\r\n\r\n function dat" +
"eDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDispla" +
"y, MinDate, UseAjax){\r\n friendlyName = FriendlyName;\r\n dat" +
"eField = DateField;\r\n userField = UserField;\r\n updatePrope" +
"rtyName = UpdatePropertyName;\r\n notSetDisplay = NotSetDisplay;\r\n " +
" minDate = MinDate;\r\n useAjax = UseAjax;\r\n\r\n var d =" +
" dateDialogGet();\r\n\r\n d.dialog(\'option\', \'title\', friendlyName);\r\n " +
" dialogHeader.text(friendlyName + \' Date\');\r\n\r\n var dfVal = $" +
"(\'#\' + DateField).attr(\'data-datetimeformatted\');\r\n\r\n if (dfVal)\r\n " +
" dialogDateBox.datetimepicker(\'setDate\', new Date(dfVal));\r\n " +
" else\r\n dialogDateBox.datetimepicker(\'setDate\', new Date());\r\n" +
"\r\n if (MinDate)\r\n dialogDateBox.datetimepicker(\'option" +
"\', \'minDate\', MinDate);\r\n else\r\n dialogDateBox.datetim" +
"epicker(\'option\', \'minDate\', null);\r\n\r\n d.dialog(\'open\');\r\n }\r" +
"\n\r\n function dateDialogCreateUpdater(FriendlyName, DateField, UserField, " +
"UpdatePropertyName, NotSetDisplay, MinDate, UseAjax){\r\n $(\'<a>\').attr" +
"({href: \'#\', \'class\': \'button small\', style: \'margin-right: 5px;\'}).text(\'Update" +
"\').click(function(event){\r\n event.preventDefault();\r\n " +
" dateDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSe" +
"tDisplay, MinDate, UseAjax);\r\n }).insertBefore(\'#\' + DateField);\r\n " +
" }\r\n\r\n if (!document.DiscoFunctions)\r\n document.DiscoFunct" +
"ions = {};\r\n if (!document.DiscoFunctions.DateDialogCreateUpdater)\r\n " +
" document.DiscoFunctions.DateDialogCreateUpdater = dateDialogCreateUpdater" +
";\r\n })();\r\n $(function(){\r\n var jobOpenDate = \'");
#line 178 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml" #line 240 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
Write(Model.Job.OpenedDate.ToJavascriptDate()); Write(Model.Job.OpenedDate.ToJavascriptDateTime());
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " + WriteLiteral("\';\r\n\r\n document.DiscoFunctions.DateDialogCreateUpdater(\'Accounting Charge " +
" </td>\r\n </tr>\r\n</table>\r\n"); "Required\', \'Job_JobMetaNonWarranty_AccountingChargeRequiredDate\', \'Job_JobMetaNo" +
"nWarranty_AccountingChargeRequiredUser\', \'NonWarrantyAccountingChargeRequired\', " +
"\'Not Required\', jobOpenDate, false);\r\n document.DiscoFunctions.DateDialog" +
"CreateUpdater(\'Accounting Charge Added\', \'Job_JobMetaNonWarranty_AccountingCharg" +
"eAddedDate\', \'Job_JobMetaNonWarranty_AccountingChargeAddedUser\', \'NonWarrantyAcc" +
"ountingChargeAdded\', \'Not Added\', jobOpenDate, false);\r\n document.DiscoFu" +
"nctions.DateDialogCreateUpdater(\'Accounting Charge Paid\', \'Job_JobMetaNonWarrant" +
"y_AccountingChargePaidDate\', \'Job_JobMetaNonWarranty_AccountingChargePaidUser\', " +
"\'NonWarrantyAccountingChargePaid\', \'Not Paid\', jobOpenDate, false);\r\n doc" +
"ument.DiscoFunctions.DateDialogCreateUpdater(\'Purchase Order Raised\', \'Job_JobMe" +
"taNonWarranty_PurchaseOrderRaisedDate\', \'Job_JobMetaNonWarranty_PurchaseOrderRai" +
"sedUser\', \'NonWarrantyPurchaseOrderRaised\', \'Not Raised\', jobOpenDate, true);\r\n " +
" document.DiscoFunctions.DateDialogCreateUpdater(\'Purchase Order Sent\', \'J" +
"ob_JobMetaNonWarranty_PurchaseOrderSentDate\', \'Job_JobMetaNonWarranty_PurchaseOr" +
"derSentUser\', \'NonWarrantyPurchaseOrderSent\', \'Not Sent\', jobOpenDate, true);\r\n " +
" document.DiscoFunctions.DateDialogCreateUpdater(\'Invoice Received\', \'Job_" +
"JobMetaNonWarranty_InvoiceReceivedDate\', \'Job_JobMetaNonWarranty_InvoiceReceived" +
"User\', \'NonWarrantyInvoiceReceived\', \'Not Received\', jobOpenDate, true);\r\n })" +
";\r\n</script>\r\n");
} }
} }
+1 -1
View File
@@ -521,7 +521,7 @@
} }
@if (Model.Job.CanInsuranceClaimFormSent()) @if (Model.Job.CanInsuranceClaimFormSent())
{ {
@Html.ActionLinkSmallButton("Insurance Claim Form Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimFormSent_Button", "alert") @Html.ActionLinkSmallButton("Insurance Claim Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimSent_Button", "alert")
} }
@if (Model.Job.CanLogRepair()) @if (Model.Job.CanLogRepair())
{ {
@@ -1740,7 +1740,7 @@ WriteLiteral(" ");
#line hidden #line hidden
#line 524 "..\..\Views\Job\JobParts\_Subject.cshtml" #line 524 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Insurance Claim Form Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimFormSent_Button", "alert")); Write(Html.ActionLinkSmallButton("Insurance Claim Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimSent_Button", "alert"));
#line default #line default
+2 -2
View File
@@ -31,9 +31,9 @@ namespace Disco.Web.Views.Job
using Disco.Web; using Disco.Web;
using Disco.Web.Extensions; using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.4.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/Show.cshtml")] [System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/Show.cshtml")]
public class Show : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel> public partial class Show : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{ {
public Show() public Show()
{ {