Skip to content

Instantly share code, notes, and snippets.

@lohithgn

lohithgn/partnerupdated.js

Last active Aug 29, 2015
Embed
What would you like to do?
updated partner JS
var app = app || {};
app.Partner = (function(){
'use strict'
var partnerViewModel = (function(){
var partnerUid;
var show = function(e){
partnerUid = e.view.params.uid;
var partner = app.Partners.partners.getByUid(partnerUid);
appSettings.sessionSettings.selectedPartner = partner;
kendo.bind(e.view.element, partner, kendo.mobile.ui)
}
var addPartner = function()
{
var partner = {};
$("#new-partner-form").serializeArray().forEach(function(record) {
partner[record.name] = record.value;
});
partner.BpRole = "01";
partner.AddressType = "02";
var startDate = new Date();
var endDate = new Date();
endDate.setFullYear(9999);
partner.AddressValStartDate=kendo.toString(startDate,"yyyy-M-ddTHH:mm:ss");
partner.AddressValEndDate=kendo.toString(endDate,"yyyy-M-ddTHH:mm:ss");
app.Partners.partners.add(partner);
app.Partners.partners.sync();
}
return {
show:show,
add:addPartner
};
}());
return partnerViewModel;
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.