(function () {
window.onload = function () {
$(".app-menu-strip").append("
Change Project");
//$(".ui-btn-right.app-btn.ui-btn.ui-btn-icon-notext.ui-shadow.ui-corner-all.app-avatar").before("
Test");
}
})();
function projectPage() {
var _app = $app
var mobile = _app.touch = _app.mobile = new Web.Mobile();
_app.alert = function (message, callback) {
return showConfirmation({ name: '_alert', message: message, /*icon: 'info-outline', */submit: callback, cancel: false });
};
function getdata() {
var project=$("#login-project").val();
$.ajax({
async: true,
type: "POST",
url: "/test.aspx/SetSession",
data: '{"project":"' + project + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
$.ajax({
async: true,
type: "POST",
url: "/test.aspx/GetSession",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
alert("Success"+r.d);
},
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
},
});
}
function showConfirmation(options) {
var msg = options.message,
message = msg != null ? msg.toString() : '',
cancel = options.cancel,
promise = $.Deferred();
_app.survey({
_submit: options.submit,
_cancel: cancel,
_promise: promise,
//text: mobile.appName(),
controller: options.name,
questions: [{ name: 'msg__', value: message, text: false, readOnly: true, rows: 3, htmlEncode: !message.match(//) }],
//tags: 'modal-fit-content modal-always modal-max-xxs promo-none modal-buttons-more-none',// + ' material-icon-' + options.icon,
options: {
modal: {
fitContent: true,
always: true,
max: 'xxs',
buttons: {
more: false
}/*,
gapRequired: true*/
},
contentStub: false,
promo: false
},
submit: 'alertconfirmed.app',
cancel: cancel != false ? 'alertnotconfirmed.app' : cancel,
layout: '
[Message]'
});
return promise;
}
//debugger;
var id = '';
$.ajax({
async: true,
type: "POST",
url: "/Test.aspx/GetUserWiseProject",
data: '{"UserName":"' + id + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
var ddlCustomers = 'Please select project';
$.each(r.d, function () {
ddlCustomers += "" + this['Text'] + "";
});
var select = " Select Project" + ddlCustomers + "";
_app.alert(select, function () {getdata(); })
},
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
};