2334 lines
120 KiB
Plaintext
2334 lines
120 KiB
Plaintext
<%@ Page Title="" Language="C#" MasterPageFile="../FIBasePage.master" AutoEventWireup="true" CodeFile="SnapshotsManage.aspx.cs" Inherits="fic_Management_SnapshotsManage" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="holder_head" Runat="Server">
|
|
|
|
<link href="<%=Common.GenerateUrl("fic/css/Grid.css") %>" rel="stylesheet" />
|
|
<link href="<%=Common.GenerateUrl("fic/css/form.css") %>" rel="stylesheet" />
|
|
<link href="<%=Common.GenerateUrl("fic/css/theme.css") %>" rel="stylesheet" />
|
|
<style type="text/css">
|
|
.no_wrap th {
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
.FloatLeft {
|
|
float: left;
|
|
margin-right: 10px;
|
|
}
|
|
.tab_header {
|
|
list-style: none;
|
|
padding: 0 0 0 10px;
|
|
margin: 10px 0 0 0;
|
|
border-bottom: 1px solid #ccc;
|
|
height: 29px;
|
|
}
|
|
.tab_header [data-href].selected {
|
|
height: 16px;
|
|
margin-top: 0;
|
|
border-bottom: 1px solid #fff;
|
|
line-height: 17px;
|
|
}
|
|
.tab_header [data-href] {
|
|
float: left;
|
|
height: 12px;
|
|
padding: 6px 4px;
|
|
margin-right: -1px;
|
|
margin-top: 4px;
|
|
border: 1px solid #ccc;
|
|
line-height: 12px;
|
|
cursor: default;
|
|
}
|
|
.tab_header [data-href]:hover {
|
|
background: #eee;
|
|
}
|
|
.tab_header [data-href].selected:hover {
|
|
background: none;
|
|
}
|
|
.dataJob {
|
|
border: 1px solid #ccc;
|
|
border-top: none;
|
|
border-radius:0px 0px 4px 4px;
|
|
padding: 6px 6px 0 6px;
|
|
|
|
}
|
|
|
|
.disabledli {
|
|
pointer-events: none;
|
|
background-color: #eee;
|
|
color: #666;
|
|
}
|
|
.max160 {
|
|
max-width: 160px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
#Snapshots tr {
|
|
height: 30px;
|
|
line-height: 30px;
|
|
}
|
|
.loading {
|
|
width: 40px;
|
|
margin: 80px auto;
|
|
font-size: 2em;
|
|
text-align: center;
|
|
color: #fff;
|
|
}
|
|
#Snapshots ul {
|
|
list-style: none;
|
|
padding: 0px;
|
|
margin: 0px;
|
|
}
|
|
#Snapshots ul li:hover {
|
|
/*border: 1px solid rgb(109, 189, 209);*/
|
|
/*background-color: #badde9;*/
|
|
background-color: #dceef4;
|
|
box-sizing: border-box;
|
|
margin-right: 1px;
|
|
line-height: 24px;
|
|
}
|
|
.tableselect {
|
|
background-color: #badde9;
|
|
}
|
|
|
|
.dialog-content {
|
|
margin: 10px 0;
|
|
}
|
|
|
|
.dialog-content table {
|
|
border-collapse: collapse;
|
|
width: 100%;
|
|
}
|
|
|
|
.dialog-content table tr {
|
|
line-height: 30px;
|
|
}
|
|
|
|
.dialog-content table td.label {
|
|
text-align: left;
|
|
width: 200px;
|
|
padding-left: 20px;
|
|
line-height: 24px;
|
|
height: 24px;
|
|
vertical-align: top;
|
|
}
|
|
|
|
.dialog-content table td input,
|
|
.dialog-content table td textarea,
|
|
.dialog-content table td select {
|
|
border: 1px solid #a9a9a9;
|
|
width: 340px;
|
|
height: 20px;
|
|
padding: 1px;
|
|
}
|
|
|
|
.dialog-content table td select {
|
|
height: 24px;
|
|
width: 344px;
|
|
}
|
|
|
|
.dialog-content table td input[type="checkbox"] {
|
|
border: none;
|
|
}
|
|
|
|
.dialog-content table td textarea {
|
|
height: 100px;
|
|
max-width: 340px;
|
|
}
|
|
|
|
#dialog_user_manualpass,
|
|
#dialog_user_randompass,
|
|
#dialog_reset_manualpass,
|
|
#dialog_reset_randompass {
|
|
width: auto;
|
|
height: 16px;
|
|
margin: 3px 4px 0 4px;
|
|
}
|
|
|
|
.form .form-search:before {
|
|
content: "\f002";
|
|
}
|
|
</style>
|
|
|
|
<script src="<%=Common.GenerateUrl("fic/js/controls/gridctrl.js") %>"></script>
|
|
<script src="<%=Common.GenerateUrl("fic/js/chart.js") %>"></script>
|
|
<script src="<%=Common.GenerateUrl("fic/js/controls/form.js") %>"></script>
|
|
<script src="<%=Common.GenerateUrl("fic/js/chartManage/commonOp.js") %>"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
var gridCtrl;
|
|
var FilterTypes = [];
|
|
var Snapshotsname = [];
|
|
var joblist = [];
|
|
var checkFrs = true;
|
|
var isFireFox=navigator.userAgent.toUpperCase().indexOf("FIREFOX") == "-1" ? false : true;
|
|
function childPageInitLanguage() {
|
|
$('#module_main').applyLanguageText();
|
|
|
|
}
|
|
$(function () {
|
|
|
|
$(window).resize(function () {
|
|
$('#Users_list').css('height', $(window).height() - 38);
|
|
gridCtrl && gridCtrl.resize();
|
|
}).resize();
|
|
checkfrsinit(function(res) {
|
|
checkFrs = res;
|
|
GetAllJobScheduleBriefInfo();
|
|
// initDatatable();
|
|
initGridLayOut();
|
|
});
|
|
|
|
|
|
});
|
|
|
|
function checkfrsinit(callback) {
|
|
_network.management("IsInstallFRS", "", function (e) {
|
|
callback(e.Result);
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function showAlert(message, title, icon, next) {
|
|
if (message && message.hasOwnProperty('LGID')) {
|
|
if (!message.LGID.startWith('LHBIS_')) {
|
|
message.LGID = 'LHBIS_FIC_CLIENT_MODULES_' + message.LGID;
|
|
}
|
|
message = GetLanguageByKey(message.LGID, message.Default);
|
|
}
|
|
|
|
var msg = new $msgdialog();
|
|
msg.title = title || DEFAULT_LANG.FICManagement;
|
|
msg.message = message;
|
|
msg.showMessage(500, 175, undefined, [[DEFAULT_LANG.ok, next]]);
|
|
}
|
|
|
|
function showConfirm(msg, title, onok) {
|
|
if (msg && msg.hasOwnProperty('LGID')) {
|
|
if (!msg.LGID.startWith('LHBIS_')) {
|
|
msg.LGID = 'LHBIS_FIC_CLIENT_MODULES_' + msg.LGID;
|
|
}
|
|
msg = GetLanguageByKey(msg.LGID, msg.Default);
|
|
}
|
|
|
|
$alertdialog.showConfirm(
|
|
title || DEFAULT_LANG.FICManagement,
|
|
msg, [
|
|
[DEFAULT_LANG.cancel],
|
|
[DEFAULT_LANG.ok, onok]
|
|
]);
|
|
}
|
|
|
|
|
|
|
|
function showmaskbg(flag) {
|
|
if (flag) {
|
|
$('#mask_bg').fadeIn(100);
|
|
} else {
|
|
$('#mask_bg').fadeOut(100);
|
|
}
|
|
}
|
|
function RefreshVariable() {
|
|
$('.topTools input[data-cls="ad"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="ed"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="cd"]').prop('disabled', true);
|
|
gridCtrl.selectedIndexes = [-1];
|
|
initGridLayOut();
|
|
}
|
|
|
|
function onchange(item, status) {
|
|
ShowLoadingMask();
|
|
|
|
GetSnapshotDetailedInfo(item.ID, function(result) {
|
|
result.Enabled = item.Enabled;
|
|
var SnapshotDetails = {
|
|
$type: "FI.FIC.Contracts.DataObjects.BLObject.SnapshotDetails, FICIntfAdv",
|
|
AgeUnit:result.AgeUnit,
|
|
AutoNaming: result.AutoNaming,
|
|
DestDTName: result.DestDTName,
|
|
Enabled: result.Enabled,
|
|
ExecuteCount: result.ExecuteCount,
|
|
FRSProperties: result.FRSProperties,
|
|
FailReceiver: result.FailReceiver,
|
|
ID: result.ID,
|
|
IsPackaged: result.IsPackaged,
|
|
JobID: result.JobID,
|
|
MailWhenFailed: result.MailWhenFailed,
|
|
MailWhenSucced: result.MailWhenSucced,
|
|
MaxAge: result.MaxAge,
|
|
Name: result.Name,
|
|
RetryCount: result.RetryCount,
|
|
SendToFRS: result.SendToFRS,
|
|
SourceDT: result.SourceDT,
|
|
SuccedReceiver: result.SuccedReceiver
|
|
};
|
|
|
|
_network.management("ModifySnapshot", [SnapshotDetails], function (e) {
|
|
if (e.Result) {
|
|
HiddenLoadingMask();
|
|
initGridLayOut();
|
|
} else {
|
|
HiddenLoadingMask();
|
|
}
|
|
});
|
|
});
|
|
}
|
|
function initGridLayOut() {
|
|
gridCtrl = new GridView('#Users_list');
|
|
gridCtrl.canMultiSelect = true;
|
|
//showmaskbg(true);
|
|
var list_colums = [
|
|
{
|
|
name: 'Name',
|
|
caption: GetLanguageByKey('LHBIS_FIC_CLIENT_FICCONTROLS_SETDRILLDOWNTOURL_A005', 'Name'),
|
|
key: 'Name',
|
|
width: 180,
|
|
align: 'left'
|
|
},
|
|
{
|
|
name: 'Scheduled Job',
|
|
caption: GetLanguageByKey('LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_LIST_A006', 'Scheduled Job'),
|
|
key: 'ScheduledJob',
|
|
// onchanged: onchange,
|
|
////type: 3,
|
|
width: 100,
|
|
align: 'left'
|
|
},
|
|
{
|
|
name: 'Enabled',
|
|
caption: GetLanguageByKey('LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_LIST_A007', 'Enabled'),
|
|
key: 'Enabled',
|
|
onchanged: onchange,
|
|
type: 3,
|
|
width: 80,
|
|
align: 'center'
|
|
},
|
|
{
|
|
name: 'Package',
|
|
caption: GetLanguageByKey('LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A017', 'Package'),
|
|
key: 'IsPackaged',
|
|
// onchanged: onchange,
|
|
type: 3,
|
|
width: 80,
|
|
enabled: false,
|
|
align: 'center'
|
|
|
|
}
|
|
];
|
|
gridCtrl.init();
|
|
GridView.applyGridWidth('ManagementSnapsh', list_colums, gridCtrl, initList);
|
|
|
|
gridCtrl.rowdblclick = function (e) {
|
|
Edit();
|
|
};
|
|
gridCtrl.selectedrowchanged = function (rowindex) {
|
|
var rowdata = gridCtrl.source[rowindex].Values;
|
|
$(".topTools input").prop("disabled", false);
|
|
if (rowdata.IsPackaged) {
|
|
$('.topTools input[data-cls="cd"]').prop('disabled', true);
|
|
}
|
|
|
|
}
|
|
gridCtrl.cellclick = function (rowindex) {
|
|
var rowdata = gridCtrl.source[rowindex].Values;
|
|
$(".topTools input").prop("disabled", false);
|
|
if (rowdata.IsPackaged) {
|
|
$('.topTools input[data-cls="cd"]').prop('disabled', true);
|
|
}
|
|
}
|
|
|
|
gridCtrl.columnchanged = GridView.saveColumnInfo('ManagementSnapsh');
|
|
}
|
|
function initList() {
|
|
|
|
var top = gridCtrl.scrollTop();
|
|
var indexes = gridCtrl.selectedIndexes;
|
|
ShowLoadingMask();
|
|
_network.management("GetAllSnapshotBriefInfo", "", function (e) {
|
|
if (!e || e.ErrorCode !== 0) {
|
|
showmaskbg(false);
|
|
showAlert(e.ErrorMessage);
|
|
return;
|
|
} else {
|
|
var rows = e.Result;
|
|
FilterRows = [];
|
|
Snapshotsname = [];
|
|
for (var i = 0; i < rows.length; i++) {
|
|
var r = rows[i];
|
|
Snapshotsname.push(r.Name);
|
|
if (r.JobID) {
|
|
r.ScheduledJob = GetScheduledJob(r.JobID);
|
|
}
|
|
var a = joblist;
|
|
var fr = { Values: r };
|
|
FilterRows.push(fr);
|
|
}
|
|
|
|
gridCtrl.setData(FilterRows);
|
|
gridCtrl.selectedIndexes = indexes;
|
|
gridCtrl.scrollTop(top);
|
|
HiddenLoadingMask();
|
|
}
|
|
});
|
|
}
|
|
|
|
function GetScheduledJob(iid) {
|
|
var res = "";
|
|
if (joblist && joblist.length > 0) {
|
|
for (var i = 0; i < joblist.length;i++) {
|
|
if (joblist[i].ID === iid) {
|
|
res = joblist[i].Name;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return res;
|
|
}
|
|
|
|
|
|
function GetAllJobScheduleBriefInfo() {
|
|
_network.management("GetAllJobScheduleBriefInfo", "", function (e) {
|
|
if (!e || e.ErrorCode !== 0) {
|
|
showmaskbg(false);
|
|
showAlert(e.ErrorMessage);
|
|
return;
|
|
} else {
|
|
joblist = [];
|
|
var rows = e.Result;
|
|
if (rows && rows.length > 0) {
|
|
for (var i = 0; i < rows.length; i++) {
|
|
joblist.push({ ID: rows[i].ID, Name: rows[i].Name });
|
|
}
|
|
}
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function Edit() {
|
|
|
|
if (gridCtrl.selectedIndex < 0) {
|
|
return false;
|
|
}
|
|
initList();
|
|
var rowdata = gridCtrl.source[gridCtrl.selectedIndex];
|
|
var viid = rowdata.Values.ID;
|
|
var dataname = rowdata.Values.Name;
|
|
var namearr = [];
|
|
if (Snapshotsname && Snapshotsname.length > 0) {
|
|
for (var i = 0; i < Snapshotsname.length; i++) {
|
|
var r = Snapshotsname[i];
|
|
if (r !== dataname) {
|
|
namearr.push(r);
|
|
}
|
|
}
|
|
}
|
|
|
|
GetSnapshotDetailedInfo(viid, function(res) {
|
|
var datainfo = res;
|
|
var frm = new $GlobalFilterEdit();
|
|
|
|
frm.showOpen($("body"), FilterTypes, datainfo, checkFrs, namearr, initGridLayOut);
|
|
if (_utility.NeedModifyUI()) {
|
|
if (isFireFox) {
|
|
frm.formCtrl.css({ "min-width": "610px", "min-height": "540px" });
|
|
frm.bodyCtrl.css({ "min-width": "610px", "min-height": "540px" });
|
|
}else{
|
|
frm.formCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
frm.bodyCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
}
|
|
}
|
|
else if (_utility.currentLang == "en-us") {
|
|
frm.formCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
frm.bodyCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
}
|
|
else {
|
|
frm.formCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
frm.bodyCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
}
|
|
});
|
|
}
|
|
|
|
function GetSnapshotDetailedInfo(id,callback) {
|
|
_network.management("GetSnapshotDetailedInfo", [id], function (e) {
|
|
if (!e || e.ErrorCode !== 0) {
|
|
showmaskbg(false);
|
|
showAlert(e.ErrorMessage);
|
|
return;
|
|
} else {
|
|
|
|
callback(e.Result);
|
|
}
|
|
});
|
|
}
|
|
|
|
function ClearGridLayOut() {
|
|
showConfirm({
|
|
LGID: "LHBIS_FIC_CLIENT_MODULES_DATATABLEWIZARD_A050",
|
|
Default: "Are you sure you want to reset the layout?"
|
|
}, undefined, function () {
|
|
ShowLoadingMask();
|
|
GridView.clearGridWidth('ManagementSnapsh', initGridLayOut);
|
|
});
|
|
}
|
|
|
|
|
|
//制作快照
|
|
function CreateSnapshot() {
|
|
showConfirm({
|
|
LGID: "LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A031",
|
|
Default: "Are you sure you want to create these snapshots?"
|
|
}, undefined, function () {
|
|
Createsnapshots();
|
|
});
|
|
}
|
|
|
|
var massage = "";
|
|
var count = 0;
|
|
var length = 0;
|
|
function Createsnapshots() {
|
|
ShowLoadingMask();
|
|
if (gridCtrl.selectedIndex < 0) {
|
|
return false;
|
|
}
|
|
|
|
count = 0;
|
|
var faiid = [];
|
|
var arr = gridCtrl.selectedIndexes;
|
|
length = arr.length;
|
|
for (var i = 0; i < arr.length; i++) {
|
|
var index = arr[i];
|
|
var data = gridCtrl.source[index].Values.ID;
|
|
ExecuteSnapshot(data, function (e) {
|
|
if (e.ErrorCode !== 0) {
|
|
massage += massage;
|
|
count++;
|
|
if (count === length) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A027", "An error occurred while making following snapshots:\\n{0}.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", massage);
|
|
massage = "";
|
|
showAlert(m);
|
|
initGridLayOut();
|
|
$('.topTools input[data-cls="ad"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="ed"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="cd"]').prop('disabled', true);
|
|
}
|
|
} else {
|
|
var res = e.Result;
|
|
if (res.NeedWaiting) {
|
|
GetResult(res.WaitingSign, GetResultCallBack);
|
|
}
|
|
else if (res.IsSucceed) {
|
|
count++;
|
|
if (count === length) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A030", "Snapshots successfully created.");
|
|
showAlert(m);
|
|
initGridLayOut();
|
|
$('.topTools input[data-cls="ad"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="ed"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="cd"]').prop('disabled', true);
|
|
}
|
|
}
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
}
|
|
function GetResultCallBack(e) {
|
|
if (e.ErrorCode !== 0) {
|
|
massage += e.ErrorMessage + " ";
|
|
count++;
|
|
if (count === length) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A027", "An error occurred while making following snapshots:\\n{0}.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", massage);
|
|
showAlert(m);
|
|
massage = "";
|
|
initGridLayOut();
|
|
$('.topTools input[data-cls="ad"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="ed"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="cd"]').prop('disabled', true);
|
|
}
|
|
} else {
|
|
var check = e.Result;
|
|
if (check.IsSucceed) {
|
|
count++;
|
|
if (count === length) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A030", "Snapshots successfully created.");
|
|
showAlert(m);
|
|
initGridLayOut();
|
|
$('.topTools input[data-cls="ad"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="ed"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="cd"]').prop('disabled', true);
|
|
}
|
|
}
|
|
else {
|
|
setTimeout(GetResult, 5000, check.WaitingSign, GetResultCallBack);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function ExecuteSnapshot(selectid, callback) {
|
|
_network.management("ExecuteSnapshot", [selectid], function (e) {
|
|
//if (e.ErrorCode !== 0) {
|
|
// // _this.HideProgressBar();
|
|
// var m = e.ErrorMessage;
|
|
// // showAlert(m);
|
|
// callback("-1");
|
|
// return;
|
|
//}
|
|
callback(e);
|
|
|
|
});
|
|
}
|
|
|
|
function GetResult(signinnerid,callback) {
|
|
_network.management("GetResult", [signinnerid], function (e) {
|
|
//if (e.ErrorCode !== 0) {
|
|
// // _this.HideProgressBar();
|
|
// var m = e.ErrorMessage;
|
|
// // showAlert(m);
|
|
// callback("-1");
|
|
// return;
|
|
//}
|
|
callback(e);
|
|
});
|
|
}
|
|
|
|
function CheckDel() {
|
|
|
|
showConfirm({
|
|
LGID: "LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A024",
|
|
Default: "Are you sure you want to delete the selected snapshot?"
|
|
}, undefined, function () {
|
|
deletejobList();
|
|
});
|
|
}
|
|
//多选删除
|
|
function deletejobList() {
|
|
ShowLoadingMask();
|
|
if (gridCtrl.selectedIndex < 0) {
|
|
return false;
|
|
}
|
|
var arr = gridCtrl.selectedIndexes;
|
|
var count = 0;
|
|
var countjob = 0;
|
|
for (var i = 0; i < arr.length; i++) {
|
|
var index = arr[i];
|
|
var data = gridCtrl.source[index].Values;
|
|
if (data.IsPackaged || data.JobID != null) {
|
|
countjob++;
|
|
} else {
|
|
DeleteSnapshot(data.ID, function(res) {
|
|
count += res;
|
|
});
|
|
}
|
|
}
|
|
if (count === 0 && countjob == arr.length) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A025", "Delete failed.");
|
|
showAlert(m);
|
|
initGridLayOut();
|
|
} else {
|
|
initGridLayOut();
|
|
$('.topTools input[data-cls="ad"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="ed"]').prop('disabled', true);
|
|
$('.topTools input[data-cls="cd"]').prop('disabled', true);
|
|
}
|
|
}
|
|
|
|
//依据id 删除
|
|
function DeleteSnapshot(snapshotid,callback) {
|
|
_network.management("DeleteSnapshot", [snapshotid], function (e) {
|
|
if (e.ErrorCode !== 0) {
|
|
// _this.HideProgressBar();
|
|
var m = e.ErrorMessage;
|
|
showAlert(m);
|
|
callback(-1);
|
|
return;
|
|
}
|
|
if (e.Result) {
|
|
callback(1);
|
|
} else {
|
|
callback(0);
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function add() {
|
|
var frm = new $GlobalFilterEdit();
|
|
frm.showOpen($("body"), FilterTypes, undefined, checkFrs, Snapshotsname, initGridLayOut);
|
|
|
|
if (_utility.NeedModifyUI()) {
|
|
if (isFireFox) {
|
|
frm.formCtrl.css({ "min-width": "610px", "min-height": "540px" });
|
|
frm.bodyCtrl.css({ "min-width": "610px", "min-height": "540px" });
|
|
} else {
|
|
|
|
frm.formCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
frm.bodyCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
}
|
|
}
|
|
else if (_utility.currentLang == "en-us") {
|
|
frm.formCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
frm.bodyCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
}
|
|
else
|
|
{
|
|
frm.formCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
frm.bodyCtrl.css({ "min-width": "610px", "min-height": "480px" });
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
<script type="text/javascript">
|
|
if (typeof $GlobalFilterEdit !== 'object') {
|
|
$GlobalFilterEdit = $form.extend({
|
|
|
|
});
|
|
(function () {
|
|
'use strict';
|
|
|
|
$GlobalFilterEdit.prototype.showOpen = function(_ParentDom, filterTypes, jobinfo,checkFrs, rowsarr, callBack) {
|
|
var cursurPosition = -1;
|
|
var ledgeridselect;
|
|
var mappinglist;
|
|
var selecinputid = 'yearinput';
|
|
var selectid = 'yearlist';
|
|
|
|
var title = GetLanguageByKey('LHBIS_FIC_CLIENT_MODULES_SNAPSHOTMANAGER_A002', 'Add Snapshot');
|
|
if (jobinfo) {
|
|
title = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTMANAGER_A003", "Snapshot Detail");
|
|
}
|
|
|
|
var width = 720;
|
|
var height = 480;
|
|
if (_utility.NeedModifyUI()) {
|
|
if (isFireFox) {
|
|
width = 720;
|
|
height = 537;
|
|
}else{
|
|
width = 720;
|
|
height = 480;
|
|
}
|
|
}
|
|
if (_utility.currentLang == "en-us") {
|
|
width = 720;
|
|
height = 480;
|
|
}
|
|
|
|
//创建基础窗体
|
|
this.createForm(title, _ParentDom, width, height);
|
|
var _content = $("<div id='countent'></div>").css({ "margin-top": "10px", "margin-left": "10px", "margin-right": "10px" });
|
|
|
|
var div = $("<div></div>").appendTo(_content);
|
|
div = $('<div id="td_Tab"></div>').appendTo(div);
|
|
var ul = $('<ul id="ultable" class="tab_header"></ul>').appendTo(div);
|
|
var li = $('<li id="tabjob" data-href="tab_group" class="selected" ></<li>')
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A003", "Information"))
|
|
.click(function () {
|
|
var res = $(this).attr("class");
|
|
if (res === undefined || res === "") {
|
|
$(this).addClass("selected").siblings().removeClass("selected");
|
|
$("#JobSchedule").css({ "display": ""});
|
|
$("#Snapshots").css({ "display": "none" });
|
|
}
|
|
|
|
|
|
})
|
|
.appendTo(ul);
|
|
var lis = $('<li id="frsyinse" style="display:none;" data-href="tab_user" ></li>')
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A004", "FIFRS Mapping"))
|
|
.click(function () {
|
|
var res = $(this).attr("class");
|
|
if (res === undefined || res === "") {
|
|
$(this).addClass("selected").siblings().removeClass("selected");
|
|
$("#JobSchedule").css({ "display": "none" });
|
|
$("#Snapshots").css({ "display": "" });
|
|
}
|
|
|
|
})
|
|
.appendTo(ul);
|
|
var lisc = $('<li style="clear:both;"></li>').appendTo(ul);
|
|
//基本信息
|
|
|
|
if (_utility.NeedModifyUI() && isFireFox) {
|
|
var divjob = $('<div id="JobSchedule" class="dataJob" ></div>').css({ "height":"" }).appendTo(div);
|
|
} else {
|
|
var divjob = $('<div id="JobSchedule" class="dataJob" ></div>').css({ "height": "370px" }).appendTo(div);
|
|
}
|
|
// Name
|
|
var infotable = $("<table border='0' cellspacing='0' cellpadding='0' style='width:98%;margin-left:5px;'></table>").appendTo(divjob);
|
|
var infotrdom = $("<tr style='width:100%;height:30px;line-height:30px;'></tr>").appendTo(infotable);
|
|
|
|
var infotddomleft = $("<td style='width:180px;text-align:left;'></td>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_FICCONTROLS_SHAPEANDCOLORSETTING_A038", "Name"))
|
|
.appendTo(infotrdom);
|
|
var infotddomright = $("<td colspan='2' style='padding-right:5px'></td>").appendTo(infotrdom);
|
|
//name input
|
|
var nameInput = $("<input type='text' style='width:100%' tabIndex='7' id='nameinput' >").appendTo(infotddomright);
|
|
|
|
// source
|
|
infotrdom = $("<tr style='width:100%;height:30px;line-height:30px;'></tr>").appendTo(infotable);
|
|
|
|
infotddomleft = $("<td style='width:180px;text-align:left;'></td>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A006", "Source data table"))
|
|
.appendTo(infotrdom);
|
|
infotddomright = $("<td></td>").appendTo(infotrdom);
|
|
//source input
|
|
var sourceinput = $("<input type='text' style='width:100%' disabled='true' id='sourcetable' />").appendTo(infotddomright);
|
|
infotddomright = $("<td style='width:100px; text-align:right;'></td>").appendTo(infotrdom);
|
|
|
|
var getSourcedtschema = function (guid, callback) {
|
|
_network.management("GetSourceDTSchema", [guid], function (e) {
|
|
if (e.ErrorCode !== 0) {
|
|
callback([]);
|
|
}
|
|
var res = e.Result;
|
|
callback(res);
|
|
});
|
|
}
|
|
var setlistsort = function (list) {
|
|
var strarr = [];
|
|
for (var i = 0; i < list.length; i++) {
|
|
var rlist = list[i].Name.toLowerCase();
|
|
strarr.push(rlist);
|
|
}
|
|
strarr.sort();
|
|
var reslist = [];
|
|
for (var j = 0; j < strarr.length; j++) {
|
|
var jstrarr = strarr[j];
|
|
for (var k = 0; k < list.length; k++) {
|
|
var klist = list[k];
|
|
if (jstrarr === klist.Name.toLowerCase()) {
|
|
reslist.push(klist);
|
|
}
|
|
}
|
|
}
|
|
return reslist;
|
|
}
|
|
|
|
var setdata= function(item, list) {
|
|
item.empty();
|
|
$("<option></option>").attr("value", "-1").text("").appendTo(item);
|
|
if (list && list.length > 0) {
|
|
var reslist = setlistsort(list);
|
|
for (var i = 0; i < reslist.length; i++) {
|
|
$("<option></option>")
|
|
.attr("value", reslist[i].Name)
|
|
.text(reslist[i].Name)
|
|
.appendTo(item);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
var setlist = function (list) {
|
|
if (list) {
|
|
|
|
var a = list.Columns;
|
|
|
|
var yearselect = $("#yearlist");
|
|
var monthselect = $("#monthlist");
|
|
var department = $("#departmentlist");
|
|
var locationselect = $("#locationlist");
|
|
var accountselect = $("#accountlist");
|
|
var subaccountselect = $("#subaccountlist");
|
|
var ytdselect = $("#ytdlist");
|
|
var mtdselect = $("#mtdlist");
|
|
var flist = [];
|
|
var ilist = [];
|
|
var islist = [];
|
|
// String=0,Byte=1,Int16=2,Int32=3,Int64=4,UInt16 = 5,UInt32 = 6,UInt64 = 7,
|
|
// Double = 8,Decimal = 9, DateTime = 10, ByteArray = 11, Boolean = 12
|
|
if (a && a.length > 0) {
|
|
flist = a;
|
|
for (var i = 0; i < a.length; i++) {
|
|
var listarr = a[i];
|
|
if (listarr.DataType == "3" || listarr.DataType=="2") {
|
|
ilist.push(listarr);
|
|
}
|
|
if (listarr.DataType == "9" || listarr.DataType == "3" || listarr.DataType == "2" || listarr.DataType == "4" || listarr.DataType == "8") {
|
|
islist.push(listarr);
|
|
}
|
|
}
|
|
}
|
|
setdata(yearselect, ilist);
|
|
|
|
setdata(monthselect, ilist);
|
|
setdata(department, flist);
|
|
setdata(locationselect, flist);
|
|
setdata(accountselect, flist);
|
|
setdata(subaccountselect, flist);
|
|
setdata(ytdselect, islist);
|
|
setdata(mtdselect, islist);
|
|
|
|
$("#frsyinse").removeClass("disabledli");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
var buttonsource = $("<input style='width:88px' tabIndex='8' id='buttonsource' type='button'/>")
|
|
.val(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A022", "Select"))
|
|
.click(this, function (e) {
|
|
var frm = new $DataTableSelect();
|
|
frm.showOpen($("body"), function (tableid, tablename, res) {
|
|
$("#sourcetable").val(tablename);
|
|
$("#sourcetable").attr("tableid", tableid);
|
|
if ($("#sendfrs").prop("checked")) {
|
|
setlist(res);
|
|
}
|
|
});
|
|
frm.formCtrl.css({ "min-width": "660px", "min-height": "480px" });
|
|
frm.bodyCtrl.css({ "min-width": "660px", "min-height": "480px" });
|
|
})
|
|
.appendTo(infotddomright);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Destination Table Name
|
|
infotrdom = $("<tr style='width:100%;height:30px;line-height:30px;'></tr>").appendTo(infotable);
|
|
|
|
infotddomleft = $("<td style='width:180px;text-align:left;'></td>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A008", "Destination Table Name"))
|
|
.appendTo(infotrdom);
|
|
infotddomright = $("<td></td>").appendTo(infotrdom);
|
|
//Destination input
|
|
var tableName = $("<input type='text' style='width:100%' tabIndex='9' id='tableName' />").appendTo(infotddomright);
|
|
infotddomright = $("<td style='width:100px; text-align:right;'></td>").appendTo(infotrdom);
|
|
var generate = $("<input style='width:88px' tabIndex='10' id='generate' type='button'/>")
|
|
.val(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A028", "Generate"))
|
|
.click(function (e) {
|
|
var res = $.newGuid();
|
|
var tablename = 'SNAPSHOT_' + res.toUpperCase().replace(/-/g, "");
|
|
$("#tableName").val(tablename);
|
|
})
|
|
.appendTo(infotddomright);
|
|
//add 新增
|
|
if (!jobinfo) {
|
|
var res = $.newGuid();
|
|
var tablename = 'SNAPSHOT_' + res.toUpperCase().replace(/-/g, "");
|
|
tableName.val(tablename);
|
|
}
|
|
|
|
//
|
|
infotrdom = $("<tr style='width:100%;height:30px; line-height:30px;'></tr>").appendTo(infotable);
|
|
|
|
infotddomleft = $("<td style='width:180px; text-align:left;'></td>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A010", "Retry count when Snapshot fails"))
|
|
.appendTo(infotrdom);
|
|
infotddomright = $("<td></td>").appendTo(infotrdom);
|
|
//retry input
|
|
var retrycount = $("<input type='text' style='width:100%' tabIndex='11' value='3' id='retrycount' />")
|
|
.blur(function(e) {
|
|
var res = $(this).val();
|
|
if (strIsNullorEmpty(res)) {
|
|
$(this).val(1);
|
|
} else {
|
|
if (isNaN(Number(res))) {
|
|
$(this).val(1);
|
|
}
|
|
}
|
|
})
|
|
.keydown(function (e) {
|
|
var code = e.keyCode;
|
|
if (e.ctrlKey) {
|
|
if (!(code === 65 || code === 67 || code === 86 || code === 90)) {
|
|
if (e.preventDefault != null) {
|
|
e.preventDefault();
|
|
} else {
|
|
e.returnValue = false;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (!e.shiftKey) {
|
|
if (!((code > 47 && code < 58) || (code > 95 && code < 106) || (code === 8||code===39||code===9) || (code > 32 && code < 38))) {
|
|
if (e.preventDefault != null) {
|
|
e.preventDefault();
|
|
} else {
|
|
e.returnValue = false;
|
|
}
|
|
}
|
|
} else {
|
|
if (e.preventDefault != null) {
|
|
e.preventDefault();
|
|
} else {
|
|
e.returnValue = false;
|
|
}
|
|
}
|
|
}
|
|
})
|
|
.appendTo(infotddomright);
|
|
infotddomright = $("<td style='width:100px; text-align:right;'></td>").appendTo(infotrdom);
|
|
|
|
//When Snapshot Failed
|
|
var whendiv = $("<div style='width:98%;margin-left:5px;' ></div>").appendTo(divjob);
|
|
var fieldset = $("<fieldset style='border:1px solid #ccc;height:50px; margin:5px 0px; border-radius:4px;' ></fieldset>").appendTo(whendiv);
|
|
var legend = $("<legend ></legend>").appendTo(fieldset);
|
|
var span = $("<span><span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A012", "When Snapshot Failed")).appendTo(legend);
|
|
var failedtable = $("<table border='0' cellspacing='0' cellpadding='0' style='width:98%;'></table>").appendTo(fieldset);
|
|
var failedtr = $("<tr></tr>").appendTo(failedtable);
|
|
var failedtdleft = $("<td style='width:240px; height:40px;'></td>").appendTo(failedtr);
|
|
var failedcheck = $("<input id='failedsend' type='checkbox' tabIndex='12' />")
|
|
.click(function() {
|
|
if ($(this).prop("checked")) {
|
|
$("#failedreceiver").prop("disabled", false);
|
|
} else {
|
|
$("#failedreceiver").prop("disabled", true);
|
|
}
|
|
})
|
|
.appendTo(failedtdleft);
|
|
var failedspan = $("<span></span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A013", "Send an Email")).appendTo(failedtdleft);
|
|
var failedtdrigth = $("<td style='width:60px;'></td>").appendTo(failedtr);
|
|
failedspan = $("<span></span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A014", "Receiver")).appendTo(failedtdrigth);
|
|
failedtdrigth = $("<td></td>").appendTo(failedtr);
|
|
var failedreceiver = $("<input type='text'id='failedreceiver' style='width:100%' tabIndex='13' disabled='true'/>").appendTo(failedtdrigth);
|
|
|
|
//When Snapshot Succeed
|
|
whendiv = $("<div style='width:98%;margin-left:5px;'></div>").appendTo(divjob);
|
|
fieldset = $("<fieldset style='border:1px solid #ccc; height:50px; margin:10px 0px; border-radius:4px;'></fieldset>").appendTo(whendiv);
|
|
legend = $("<legend></legend>").appendTo(fieldset);
|
|
span = $("<span><span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A015", "When Snapshot Succeed")).appendTo(legend);
|
|
failedtable = $("<table border='0' cellspacing='0' cellpadding='0' style='width:98%;'></table>").appendTo(fieldset);
|
|
failedtr = $("<tr></tr>").appendTo(failedtable);
|
|
failedtdleft = $("<td style='width:240px; height:40px;'></td>").appendTo(failedtr);
|
|
var succeedcheck = $("<input id='succeedsend' type='checkbox' tabIndex='14'/>")
|
|
.click(function() {
|
|
if ($(this).prop("checked")) {
|
|
$("#succeedreceiver").prop("disabled", false);
|
|
} else {
|
|
$("#succeedreceiver").prop("disabled",true);
|
|
}
|
|
})
|
|
.appendTo(failedtdleft);
|
|
failedspan = $("<span></span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A013", "Send an Email")).appendTo(failedtdleft);
|
|
failedtdrigth = $("<td style='width:60px;'></td>").appendTo(failedtr);
|
|
failedspan = $("<span></span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A014", "Receiver")).appendTo(failedtdrigth);
|
|
failedtdrigth = $("<td></td>").appendTo(failedtr);
|
|
var succeedreceiver = $("<input type='text' id='succeedreceiver' style='width:100%' tabIndex='14' disabled='true'/>").appendTo(failedtdrigth);
|
|
|
|
infotable = $("<table border='0' cellspacing='0' cellpadding='0' style='width:98%;margin-left:5px;'></table>").appendTo(divjob);
|
|
infotrdom = $("<tr style='width:100%;height:30px;'></tr>").appendTo(infotable);
|
|
var bottontd = $("<td id='pushFrs' style=''></td>")
|
|
.css({ "display": checkFrs?"":"none"})
|
|
.appendTo(infotrdom);
|
|
var sendfrs = $("<input type='checkbox' id='sendfrs' tabIndex='15'/>")
|
|
.click(function (e) {
|
|
if ($(this).prop("checked")) {
|
|
$("#frsyinse").css({ "display": "" });
|
|
$("#frsyinse").addClass("disabledli");
|
|
var res = $("#sourcetable").val();
|
|
var id = $("#sourcetable").attr("tableid");
|
|
if (res != "") {
|
|
if (id!=null){
|
|
getSourcedtschema(id, function (res) {
|
|
setlist(res);
|
|
});
|
|
}
|
|
}
|
|
} else {
|
|
$("#frsyinse").css({ "display": "none" });
|
|
}
|
|
})
|
|
.appendTo(bottontd);
|
|
span = $("<span></span>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A016", "Send Data To FIFRS"))
|
|
.appendTo(bottontd);
|
|
bottontd = $("<td style='text-align:right;'></td>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A017", "Maximum Snapshot Age")).appendTo(infotrdom);
|
|
bottontd = $("<td style='width:50px;'></td>").appendTo(infotrdom);
|
|
var maxage = $("<input type='text' value='6' style='width:40px; margin:0 10px' tabIndex='16' id='maxage' />")
|
|
.keydown(function (e) {
|
|
var code = e.keyCode;
|
|
if (e.ctrlKey) {
|
|
if (!(code === 65 || code === 67 || code === 86 || code === 90)) {
|
|
if (e.preventDefault != null) {
|
|
e.preventDefault();
|
|
} else {
|
|
e.returnValue = false;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (!e.shiftKey) {
|
|
if (!((code > 47 && code < 58) || (code > 95 && code < 106) || (code === 8||code===9) || (code > 32 && code < 37))) {
|
|
if (e.preventDefault != null) {
|
|
e.preventDefault();
|
|
} else {
|
|
e.returnValue = false;
|
|
}
|
|
}
|
|
} else {
|
|
if (e.preventDefault != null) {
|
|
e.preventDefault();
|
|
} else {
|
|
e.returnValue = false;
|
|
}
|
|
}
|
|
}
|
|
})
|
|
.blur(function (e) {
|
|
var res = $(this).val();
|
|
if (strIsNullorEmpty(res)) {
|
|
$(this).val(1);
|
|
}else{
|
|
if (isNaN(Number(res))) {
|
|
$(this).val(1);
|
|
}
|
|
}
|
|
})
|
|
.appendTo(bottontd);
|
|
bottontd = $("<td style='width:100px;'></td>").appendTo(infotrdom);
|
|
var select = $("<select id='ageselect' style='width:100px;' tabIndex='17' ></select>").appendTo(bottontd);
|
|
var optionMax = $("<option ></option>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_ITEMS_A001", "Year(s)"))
|
|
.attr("value", "0")
|
|
.appendTo(select);
|
|
optionMax = $("<option selected ></option>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_ITEMS_A002", "Month(s)"))
|
|
.attr("value", "1")
|
|
.appendTo(select);
|
|
optionMax = $("<option></option>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_ITEMS_A003", "Week(s)"))
|
|
.attr("value", "2")
|
|
.appendTo(select);
|
|
optionMax = $("<option></option>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_ITEMS_A004", "Year(s)"))
|
|
.attr("value", "3")
|
|
.appendTo(select);
|
|
optionMax = $("<option></option>")
|
|
.text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_ITEMS_A005", "Hour(s)"))
|
|
.attr("value", "4")
|
|
.appendTo(select);
|
|
|
|
var getCursorPosition= function(tid) {
|
|
var tdom = document.getElementById(tid);
|
|
if (tdom.selectionStart!=null) {//非IE浏览器
|
|
cursurPosition = tdom.selectionStart;
|
|
} else {//IE
|
|
var range = document.selection.createRange();
|
|
range.moveStart("character", -tdom.value.length);
|
|
cursurPosition = range.text.length;
|
|
}
|
|
|
|
}
|
|
|
|
var inset_flg= function(str, flg, sn) {
|
|
var newstr = "";
|
|
if (str && str.length > 0) {
|
|
var a = str.substring(0, sn);
|
|
var b = str.substring(sn, str.length) ;
|
|
newstr = a + flg + b;
|
|
} else {
|
|
newstr = flg;
|
|
}
|
|
return newstr;
|
|
}
|
|
|
|
|
|
if (checkFrs){
|
|
//FRS 映射
|
|
|
|
if (_utility.NeedModifyUI() && isFireFox) {
|
|
var divsnaps = $('<div id="Snapshots" class="dataJob" style="display:none;"></div>').css({ "height": "428px" }).appendTo(div);
|
|
} else {
|
|
var divsnaps = $('<div id="Snapshots" class="dataJob" style="display:none;"></div>').css({ "height": "370px" }).appendTo(div);
|
|
}
|
|
var divtop = $("<div id='Snapshotstable' style='height:25px; line-height:25px;background:#eee;text-align:right;'></div>").appendTo(divsnaps);
|
|
var expressionspan = $("<span></span>").text(GetLanguageByKey("LHBIS_SILVERLIGHT_UI_WIZARDS_DRILLDOWNCTRL_A019", "Expression Helper:")).appendTo(divtop);
|
|
var convCombox = [
|
|
{ "key": null, "Text": "Built-in Functions" },
|
|
{ "key": "Conv_Year(, , )", "Text": "Conv_Year(year, month, offset)", "Description": GetLanguageByKey("LHBIS_SILVERLIGHT_UI_WIZARDS_DRILLDOWNCTRL_A024", "") },
|
|
{ "key": "Conv_Month(, )", "Text": "Conv_Month(month, offset)", "Description": GetLanguageByKey("LHBIS_SILVERLIGHT_UI_WIZARDS_DRILLDOWNCTRL_A025", "") },
|
|
{ "key": "Conv_Period(, )", "Text": "Conv_Period(period, offset)", "Description": GetLanguageByKey("LHBIS_SILVERLIGHT_UI_WIZARDS_DRILLDOWNCTRL_A026", "") }
|
|
];
|
|
var selectExpression = $("<select style='width:180px;margin:0 10px;'tabIndex='18' ></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
var course = cursurPosition;
|
|
var id = "#" + selecinputid;
|
|
var flg = $(id).val();
|
|
var sid = "#" + selectid;
|
|
$(sid).val("-1");
|
|
var text = inset_flg(flg, res, course);
|
|
$(id).val(text);
|
|
})
|
|
.appendTo(divtop);
|
|
for (var j = 0; j < convCombox.length; j++) {
|
|
var selectexp = $("<option></option>")
|
|
.attr("title", convCombox[j].Description)
|
|
.val(convCombox[j].key)
|
|
.text(convCombox[j].Text)
|
|
.appendTo(selectExpression);
|
|
}
|
|
var rightcombox = [
|
|
{ "key": null, "Text": " " },
|
|
{ "key": "@CY", "Text": "@CY" },
|
|
{ "key": "@CM", "Text": "@CM" },
|
|
{ "key": "@CD", "Text": "@CD" },
|
|
{ "key": "@CQ", "Text": "@CQ" },
|
|
{ "key": "@CP", "Text": "@CP" },
|
|
{ "key": "@CFY", "Text": "@CFY" },
|
|
{ "key": "@CFP", "Text": "@CFP" },
|
|
{ "key": "@OFFSET", "Text": "@OFFSET" }];
|
|
var expression = $("<select style='width:80px; margin-right:2px;' tabIndex='19'></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
var course = cursurPosition;
|
|
var id = "#" + selecinputid;
|
|
var flg = $(id).val();
|
|
var sid = "#" + selectid;
|
|
$(sid).val("-1");
|
|
var text = inset_flg(flg, res, course);
|
|
$(id).val(text);
|
|
})
|
|
.appendTo(divtop);
|
|
for(var i=0;i<rightcombox.length;i++){
|
|
var expoption = $("<option></option>")
|
|
.val(rightcombox[i].key)
|
|
.text(rightcombox[i].Text)
|
|
.appendTo(expression);
|
|
}
|
|
//var minddel = $("<div style='height:30px;border-bottom:1px solid #999; line-height:30px;'></div>").appendTo(divsnaps);
|
|
//var mispan = $("<span style='margin-left:80px;'></span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_FRS_A002", "Mapping Field")).appendTo(minddel);
|
|
//var textspan = $("<span style='margin-left:60px;'></span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_FRS_A003", "Expression / Value")).appendTo(minddel);
|
|
////Ledger ID
|
|
var mapptalbe = $("<table border='0' cellspacing='0' cellpadding='0' style='width:100%;margin-top:10px;' ></table>").appendTo(divsnaps);
|
|
var mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
var toptd = $("<td style='width:80px;text-align:right;'></td>").appendTo(mapptr);
|
|
toptd = $("<td style='width:125px;padding:0 10px;'></td>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_FRS_A002", "Mapping Field")).appendTo(mapptr);
|
|
toptd = $("<td style='padding-right:5px; text-align:left'></td>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_FRS_A003", "Expression / Value")).appendTo(mapptr);
|
|
toptd = $("<td style='width:120px;'></td>").appendTo(mapptr);
|
|
mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
var mapptdf = $("<td style='width:80px;text-align:right;'></td>").text("Ledger ID").appendTo(mapptr);
|
|
mapptdf = $("<td style='width:125px;padding:0 10px;'></td>").appendTo(mapptr);
|
|
var ledgerid = $("<select style='width:100%;' disabled='true'; tabIndex='20' ></select>").appendTo(mapptdf);
|
|
mapptdf = $("<td style=''></td>").appendTo(mapptr);
|
|
var ledgerselectlist = $("<select id='ledgerselect' style='width:100%' tabIndex='21'></select>").appendTo(mapptdf);
|
|
var ledgeridoption = $('<option value="-1" style="display:none;" disabled selected></option>').appendTo(ledgerselectlist);
|
|
mapptdf = $("<td style='width:120px;'></td>").appendTo(mapptr);
|
|
//year
|
|
mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
mapptdf = $("<td style='width:80px;text-align:right;'></td>").text("Year").appendTo(mapptr);
|
|
mapptdf = $("<td style='padding:0 10px;'></td>").appendTo(mapptr);
|
|
var year = $("<select id='yearlist' style='width:100%;' tabIndex='22'></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
if (res !== "-1") {
|
|
$("#yearinput").val("");
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
var yearoptio = $("<option selected></option>").attr("value","").text("").appendTo(year);
|
|
mapptdf = $("<td style='padding-right:5px;'></td>").appendTo(mapptr);
|
|
var yearinput = $("<input type='text' id='yearinput' style='width:100%;' tabIndex='23'></input>")
|
|
.keydown(function(e) {
|
|
$("#yearlist").val("-1");
|
|
})
|
|
.focus(function(e) {
|
|
selecinputid = "yearinput";
|
|
selectid = "yearlist";
|
|
})
|
|
.click(function(e) {
|
|
getCursorPosition("yearinput");
|
|
})
|
|
.appendTo(mapptdf);
|
|
mapptdf = $("<td style='width:120px;'></td>").appendTo(mapptr);
|
|
//month
|
|
mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
mapptdf = $("<td style='width:80px;text-align:right;'></td>").text("Month").appendTo(mapptr);
|
|
mapptdf = $("<td style='padding:0 10px;'></td>").appendTo(mapptr);
|
|
var month = $("<select id='monthlist' style='width:100%;' tabIndex='24'></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
if (res !== "-1") {
|
|
$("#monthinput").val("");
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
var blankselect = $("<option></option>").attr("value", "-1").text("").appendTo(month);
|
|
mapptdf = $("<td style='padding-right:5px;'></td>").appendTo(mapptr);
|
|
var monthinput = $("<input type='text' id='monthinput' style='width:100%;' tabIndex='25'></input>")
|
|
.keydown(function(e) {
|
|
$("#monthlist").val("-1");
|
|
})
|
|
.focus(function (e) {
|
|
selecinputid = "monthinput";
|
|
selectid = "monthlist";
|
|
})
|
|
.click(function (e) {
|
|
getCursorPosition("monthinput");
|
|
})
|
|
.appendTo(mapptdf);
|
|
mapptdf = $("<td style='width:120px;'></td>").appendTo(mapptr);
|
|
//department
|
|
mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
mapptdf = $("<td style='width:80px;text-align:right;'></td>").text("Department").appendTo(mapptr);
|
|
mapptdf = $("<td style='padding:0 10px;'></td>").appendTo(mapptr);
|
|
var department = $("<select id='departmentlist' style='width:100%;' tabIndex='26'></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
if (res !== "-1") {
|
|
$("#departmentinput").val("");
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
blankselect = $("<option></option>").attr("value", "-1").text("").appendTo(department);
|
|
mapptdf = $("<td style='padding-right:5px;'></td>").appendTo(mapptr);
|
|
var departmentinput = $("<input type='text' id='departmentinput' style='width:100%;' tabIndex='27'></input>")
|
|
.keydown(function(e) {
|
|
$("#departmentlist").val("-1");
|
|
})
|
|
.focus(function (e) {
|
|
selecinputid = "departmentinput";
|
|
selectid = "departmentlist";
|
|
})
|
|
.click(function (e) {
|
|
getCursorPosition("departmentinput");
|
|
})
|
|
.appendTo(mapptdf);
|
|
mapptdf = $("<td style='width:120px;'></td>").appendTo(mapptr);
|
|
//location
|
|
mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
mapptdf = $("<td style='width:80px;text-align:right;'></td>").text("Location").appendTo(mapptr);
|
|
mapptdf = $("<td style='padding:0 10px;'></td>").appendTo(mapptr);
|
|
var location = $("<select id='locationlist' style='width:100%;' tabIndex='28'></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
if (res !== "-1") {
|
|
$("#locationinput").val("");
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
blankselect = $("<option></option>").attr("value", "-1").text("").appendTo(location);
|
|
mapptdf = $("<td style='padding-right:5px;'></td>").appendTo(mapptr);
|
|
var locationinput = $("<input type='text' id='locationinput' style='width:100%;' tabIndex='29'></input>")
|
|
.keydown(function(e) {
|
|
$("#locationlist").val("-1");
|
|
})
|
|
.focus(function (e) {
|
|
selecinputid = "locationinput";
|
|
selectid = "locationlist";
|
|
})
|
|
.click(function (e) {
|
|
getCursorPosition("locationinput");
|
|
})
|
|
.appendTo(mapptdf);
|
|
mapptdf = $("<td style='width:120px;'></td>").appendTo(mapptr);
|
|
//account
|
|
mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
mapptdf = $("<td style='width:80px;text-align:right;'></td>").text("Account").appendTo(mapptr);
|
|
mapptdf = $("<td style='padding:0 10px;'></td>").appendTo(mapptr);
|
|
var account = $("<select id='accountlist' style='width:100%;' tabIndex='30'></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
if (res !== "-1") {
|
|
$("#accountinput").val("");
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
blankselect = $("<option></option>").attr("value", "-1").text("").appendTo(account);
|
|
mapptdf = $("<td style='padding-right:5px;'></td>").appendTo(mapptr);
|
|
var accountinput = $("<input type='text' id='accountinput' style='width:100%;' tabIndex='31'></input>")
|
|
.keydown(function(e) {
|
|
$("#accountlist").val("-1");
|
|
})
|
|
.click(function (e) {
|
|
getCursorPosition("accountinput");
|
|
})
|
|
.focus(function (e) {
|
|
selecinputid = "accountinput";
|
|
selectid = "accountlist";
|
|
|
|
})
|
|
.appendTo(mapptdf);
|
|
mapptdf = $("<td style='width:120px;'></td>").appendTo(mapptr);
|
|
//subaccount
|
|
mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
mapptdf = $("<td style='width:80px;text-align:right;'></td>").text("Sub Account").appendTo(mapptr);
|
|
mapptdf = $("<td style='padding:0 10px;'></td>").appendTo(mapptr);
|
|
var subaccount = $("<select id='subaccountlist' style='width:100%;' tabIndex='32'></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
if (res !== "-1") {
|
|
$("#subaccountinput").val("");
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
blankselect = $("<option></option>").attr("value", "-1").text("").appendTo(subaccount);
|
|
mapptdf = $("<td style='padding-right:5px;'></td>").appendTo(mapptr);
|
|
var subaccountinput = $("<input type='text' id='subaccountinput' style='width:100%;' tabIndex='33'></input>")
|
|
.keydown(function(e) {
|
|
$("#subaccountlist").val("-1");
|
|
})
|
|
.focus(function (e) {
|
|
selecinputid = "subaccountinput";
|
|
selectid = "subaccountlist";
|
|
})
|
|
.click(function (e) {
|
|
getCursorPosition("subaccountinput");
|
|
})
|
|
.appendTo(mapptdf);
|
|
mapptdf = $("<td style='width:120px;'></td>").appendTo(mapptr);
|
|
//ytd
|
|
mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
mapptdf = $("<td style='width:80px;text-align:right;'></td>").text("YTD").appendTo(mapptr);
|
|
mapptdf = $("<td style='padding:0 10px;'></td>").appendTo(mapptr);
|
|
var ytd = $("<select id='ytdlist' disabled='true' style='width:100%;' tabIndex='34'></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
if (res !== "-1") {
|
|
$("#ytdinput").val("");
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
blankselect = $("<option></option>").attr("value", "-1").text("").appendTo(ytd);
|
|
mapptdf = $("<td style='padding-right:5px;'></td>").appendTo(mapptr);
|
|
var ytdinput = $("<input type='text' id='ytdinput' disabled='true' style='width:100%;' tabIndex='35'></input>")
|
|
.keydown(function(e) {
|
|
$("#ytdlist").val("-1");
|
|
})
|
|
.focus(function (e) {
|
|
selecinputid = "ytdinput";
|
|
selectid = "ytdlist";
|
|
})
|
|
.click(function (e) {
|
|
getCursorPosition("ytdinput");
|
|
})
|
|
.appendTo(mapptdf);
|
|
mapptdf = $("<td style='width:120px; white-space: nowrap;'></td>").appendTo(mapptr);
|
|
var ytdcheck = $("<input type='checkbox' id='ytdcheck' checked='true' tabIndex='36'/>")
|
|
.click(function(e) {
|
|
if ($(this).prop("checked")) {
|
|
$("#mtdcheck").prop("checked", false);
|
|
$("#mtdinput").prop("disabled", false);
|
|
$("#mtdlist").prop("disabled", false);
|
|
$("#ytdlist").prop("disabled", true);
|
|
$("#ytdinput").prop("disabled", true);
|
|
$("#ytdinput").val("");
|
|
} else {
|
|
$("#mtdcheck").prop("checked", true);
|
|
$("#mtdinput").prop("disabled", true);
|
|
$("#mtdlist").prop("disabled", true);
|
|
$("#ytdlist").prop("disabled", false);
|
|
$("#ytdinput").prop("disabled", false);
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
var ytdspan = $("<span></span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_FRS_A004", "Auto Calculate")).appendTo(mapptdf);
|
|
//mtd
|
|
mapptr = $("<tr></tr>").appendTo(mapptalbe);
|
|
mapptdf = $("<td style='width:80px;text-align:right;'></td>").text("MTD").appendTo(mapptr);
|
|
mapptdf = $("<td style='width:100px;padding:0 10px;'></td>").appendTo(mapptr);
|
|
var mtd = $("<select id='mtdlist' style='width:100%' tabIndex='37'></select>")
|
|
.change(function(e) {
|
|
var res = $(this).find("option:selected").attr("value");
|
|
if (res !== "-1") {
|
|
$("#mtdinput").val("");
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
blankselect = $("<option></option>").attr("value", "-1").text("").appendTo(mtd);
|
|
mapptdf = $("<td style='padding-right:5px;'></td>").appendTo(mapptr);
|
|
var mtdinput = $("<input id='mtdinput' type='text' style='width:100%;' tabIndex='38'></input>")
|
|
.keydown(function (e) {
|
|
$("#mtdlist").val("-1");
|
|
})
|
|
.focus(function (e) {
|
|
selecinputid = "mtdinput";
|
|
selectid = "mtdlist";
|
|
})
|
|
.click(function (e) {
|
|
getCursorPosition("mtdinput");
|
|
})
|
|
.appendTo(mapptdf);
|
|
mapptdf = $("<td style='width:120px;'></td>").appendTo(mapptr);
|
|
var mtdcheck = $("<input type='checkbox' id='mtdcheck' tabIndex='39'/>")
|
|
.click(function(e) {
|
|
if ($(this).prop("checked")) {
|
|
$("#ytdcheck").prop("checked", false);
|
|
$("#mtdinput").prop("disabled", true);
|
|
$("#mtdlist").prop("disabled", true);
|
|
$("#ytdlist").prop("disabled", false);
|
|
$("#ytdinput").prop("disabled", false);
|
|
$("#mtdinput").val("");
|
|
} else {
|
|
$("#ytdcheck").prop("checked", true);
|
|
$("#mtdinput").prop("disabled", false);
|
|
$("#mtdlist").prop("disabled", false);
|
|
$("#ytdlist").prop("disabled", true);
|
|
$("#ytdinput").prop("disabled", true);
|
|
}
|
|
})
|
|
.appendTo(mapptdf);
|
|
var mtdspan = $("<span></span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_FRS_A004", "Auto Calculate")).appendTo(mapptdf);
|
|
|
|
}
|
|
|
|
var showMessagef = function (m) {
|
|
var msg = new $msgdialog();
|
|
msg.title = DEFAULT_LANG.FICManagement;
|
|
msg.parentDom = _ParentDom;
|
|
msg.message = m;
|
|
msg.showMessage(500, 175, 700);
|
|
};
|
|
|
|
function isNumber(val) {
|
|
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
|
|
var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
|
|
if (regPos.test(val) || regNeg.test(val)) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
|
|
}
|
|
|
|
var modifyJobSchedule = function (_this, globa) {
|
|
_network.management("ModifySnapshot", [globa], function (e) {
|
|
if (e.ErrorCode !== 0) {
|
|
// _this.HideProgressBar();
|
|
var m = e.ErrorMessage;
|
|
showMessagef(m, _this);
|
|
return;
|
|
}
|
|
_this.HideProgressBar();
|
|
if (typeof callBack === 'function')
|
|
callBack();
|
|
_this.close();
|
|
});
|
|
}
|
|
var addJobSchedule = function (_this, globa) {
|
|
_network.management("AddSnapshot", [globa], function (e) {
|
|
if (e.ErrorCode !== 0) {
|
|
// _this.HideProgressBar();
|
|
var m = e.ErrorMessage;
|
|
showMessagef(m, _this);
|
|
return;
|
|
}
|
|
_this.HideProgressBar();
|
|
if (typeof callBack === 'function')
|
|
callBack();
|
|
_this.close();
|
|
});
|
|
}
|
|
|
|
function Conv_Year(y, m, offset) {
|
|
if (arguments.length !== 3) { throw new Error('arguments mismatch'); }
|
|
if (isNaN(y) || isNaN(m) || isNaN(offset)) {
|
|
throw new Error('parameter is invalid.');
|
|
}
|
|
}
|
|
// ReSharper disable once UnusedLocals
|
|
function Conv_Month(m, offset) {
|
|
if (arguments.length !== 2) { throw new Error('arguments mismatch'); }
|
|
if (isNaN(m) || isNaN(offset)) {
|
|
throw new Error('parameter is invalid.');
|
|
}
|
|
}
|
|
// ReSharper disable once UnusedLocals
|
|
function Conv_Period(p, offset) {
|
|
if (arguments.length !== 2) { throw new Error('arguments mismatch'); }
|
|
if (isNaN(p) || isNaN(offset)) {
|
|
throw new Error('parameter is invalid.');
|
|
}
|
|
}
|
|
|
|
|
|
var validExpression=function(express) {
|
|
var result = false;
|
|
if (!$.nullOrEmpty(express)) {
|
|
try {
|
|
eval('(' + express + ')');
|
|
result = true;
|
|
} catch (err) {
|
|
console.log(express);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
var validateInnerFunctionExpression=function(expression) {
|
|
var isRight = false;
|
|
var temp = expression;
|
|
try {
|
|
expression = temp.replace(/\[[^\[\]]*\]/g, '10')
|
|
.replace(/"[^"]*"/g, '20')
|
|
.replace(/'[^']*'/g, '30')
|
|
.replace(/@\w+/g, '40');
|
|
isRight = validExpression(expression);
|
|
} catch (e) {
|
|
}
|
|
return isRight;
|
|
}
|
|
|
|
var buttonDiv = $("<div style='margin-top: 10px; '></div>").appendTo(_content);
|
|
|
|
var checkenable = $("<input type='checkbox' id='checkenable' checked='true' tabindex='40' />").appendTo(buttonDiv);
|
|
var spanenable = $("<span></span>").text(GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_A011", "Enabled")).appendTo(buttonDiv);
|
|
$("<input type='button' tabindex='42' id='dtCopy_btCancel' />")
|
|
.val(GetLanguageByKey('LHBIS_CHANGEPASSWORD_A006', 'Cancel'))
|
|
.css({ "float": "right", "margin": "0 8px 0 0" })
|
|
.appendTo(buttonDiv)
|
|
.click(this, function(e) {
|
|
e.data.close();
|
|
});
|
|
$("<input type='button' tabindex='41' id='dtCopy_btCancel' />")
|
|
.val(GetLanguageByKey('LHBIS_FIC_CLIENT_MODULES_DATATABLECOPYDIALOG_A006', 'Save'))
|
|
.css({ "float": "right", "margin": "0 8px 0 0" })
|
|
.appendTo(buttonDiv)
|
|
.click(this, function(e) {
|
|
var _this = e.data;
|
|
var ID = $.newGuid();
|
|
if (jobinfo) {
|
|
ID = jobinfo.ID;
|
|
}
|
|
var namecheck = /^[a-zA-Z][ a-zA-Z0-9_-]*$/;
|
|
var nameinput = $("#nameinput").val();
|
|
if (!namecheck.test(nameinput) && nameinput !== "") {
|
|
var m = GetLanguageByKey("LHBIS_MULTILANGUAGE_COMMON_A012", "The name must be started with an alpha character and followed by letters, numbers, and underlines.");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
if (nameinput === "" || nameinput == undefined) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A001", "The Name field cannot be empty.");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
var sourcetable = $("#sourcetable").val();
|
|
var sourcetableid = $("#sourcetable").attr("tableid");
|
|
if (!(sourcetableid && sourcetable !== "")) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A002", "Please select a source data table first.");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
var destDtNamecheck = /^[a-zA-Z][a-zA-Z0-9_]*$/;
|
|
var destDtName = $("#tableName").val();
|
|
if (destDtName == "") {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A004", "Destination table name cannot be empty.");
|
|
showMessagef(m);
|
|
return;
|
|
} else {
|
|
if (!destDtNamecheck.test(destDtName)) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A022", "The Table name can only include the characters [A-Z, a-z], digitals [0-9] or underline [_].");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
}
|
|
|
|
var retryCount = $("#retrycount").val();
|
|
if (parseFloat(retryCount) > 2147483647) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A005", "The Retry Count format is incorrect.");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
retryCount = parseFloat(retryCount);
|
|
var failReceiver = "";
|
|
var mailWhenFailed = false;
|
|
var succedReceiver = "";
|
|
var mailWhenSucced = false;
|
|
if ($("#failedsend").prop("checked")) {
|
|
var r = $("#failedreceiver").val();
|
|
|
|
if (!strIsNullorEmpty(r)) {
|
|
failReceiver = r;
|
|
mailWhenFailed = true;
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A006", "Please provide an email address.");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
}
|
|
if ($("#succeedsend").prop("checked")) {
|
|
var r = $("#succeedreceiver").val();
|
|
if (!strIsNullorEmpty(r)) {
|
|
succedReceiver = r;
|
|
mailWhenSucced = true;
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A006", "Please provide an email address.");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
}
|
|
var maxAge = 1;
|
|
var selecage = $("#ageselect").find("option:selected").attr("value");
|
|
var ageUnit = parseFloat(selecage);
|
|
var maxageinput = $("#maxage").val();
|
|
if (parseFloat(retryCount) > 2147483647) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A005", "The Retry Count format is incorrect.");
|
|
showMessagef(m);
|
|
return;
|
|
} else {
|
|
maxAge = parseFloat(maxageinput);
|
|
}
|
|
var enabled = $("#sendfrs").prop("checked");
|
|
|
|
var frsProperties = {};
|
|
if (enabled) {
|
|
var LedgerID = {};
|
|
var Account = {}
|
|
var Department = {}
|
|
var Location = {}
|
|
var MTD = {}
|
|
var Month = {}
|
|
var SubAccount = {}
|
|
var YTD = {};
|
|
var Year = {};
|
|
frsProperties.OriAccount = {};
|
|
frsProperties.OriDepartment = {};
|
|
frsProperties.OriLocation = {};
|
|
frsProperties.OriSubAccount = {};
|
|
|
|
var ledger = $("#ledgerselect").find("option:selected").attr("value");
|
|
if (ledger == "-1") {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A009", "{0} is empty. Please complete the FIFRS mapping table.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", "Ledger ID");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
LedgerID.Expression = ledger;
|
|
frsProperties.LedgerID = LedgerID;
|
|
//year
|
|
var yearlist = $("#yearlist").find("option:selected").attr("value");
|
|
var yearinput = $("#yearinput").val();
|
|
|
|
if (yearlist == "-1") {
|
|
if (yearinput != "") {
|
|
//未验证表达式
|
|
if (!isNaN(parseFloat(yearinput))) {
|
|
var num = parseFloat(yearinput);
|
|
if (num < 1900 || num > 2050) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A010", "Expression validation failed: {0}.") + "<br>";
|
|
m = m.replace("{0}", num);
|
|
var b = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A018", "The parameter '{0}' of the expression is invalid.");
|
|
b = b.replace("{0}", "Year") + "<br>";
|
|
var c = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A020", "It must be between 1900 and 2050.");
|
|
m = m + b + c;
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
Year.Expression = yearinput;
|
|
} else {
|
|
var expression = yearinput;
|
|
var isInvalid = false;
|
|
if (_commonOp.IsUseInnerFunction(expression)) {
|
|
isInvalid = _commonOp.HasNestedFunction(expression) || !validateInnerFunctionExpression(expression);
|
|
}
|
|
else {
|
|
isInvalid = !_commonOp.ValidatePivotValue(expression, 2, false, false);
|
|
}
|
|
if (!isInvalid) {
|
|
Year.Expression = yearinput;
|
|
}
|
|
else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A010", "Expression validation failed: {0}.") + "<br>";
|
|
m = m.replace("{0}", yearinput);
|
|
var b = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A015", "The expression is not correct.");
|
|
m = m + b;
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
}
|
|
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A009", "{0} is empty. Please complete the FIFRS mapping table.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", "Year");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
} else {
|
|
Year.MappingField = yearlist;
|
|
}
|
|
frsProperties.Year = Year;
|
|
//Month
|
|
var monthlist = $("#monthlist").find("option:selected").attr("value");
|
|
var monthinput = $("#monthinput").val();
|
|
if (monthlist == "-1") {
|
|
if (monthinput != "") {
|
|
if (!isNaN(parseFloat(monthinput))) {
|
|
var nummonth = parseFloat(monthinput);
|
|
if (nummonth < 1 || nummonth > 12) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A010", "Expression validation failed: {0}.") + "<br>";
|
|
m = m.replace("{0}", nummonth);
|
|
var b = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A018", "The parameter '{0}' of the expression is invalid.");
|
|
b = b.replace("{0}", "Month");
|
|
var c = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A021", "It must be between 1 and 12.");
|
|
m = m + b + c;
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
Month.Expression = monthinput;
|
|
} else {
|
|
|
|
var expressions = monthinput;
|
|
var isInvalids = false;
|
|
if (_commonOp.IsUseInnerFunction(expressions)) {
|
|
isInvalids = _commonOp.HasNestedFunction(expressions) || !validateInnerFunctionExpression(expressions);
|
|
}
|
|
else {
|
|
isInvalids = !_commonOp.ValidatePivotValue(expressions, 2, false, false);
|
|
}
|
|
if (!isInvalids) {
|
|
Month.Expression = monthinput;
|
|
}
|
|
else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A010", "Expression validation failed: {0}.") + "<br>";
|
|
m = m.replace("{0}", monthinput);
|
|
var b = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A015", "The expression is not correct.");
|
|
m = m + b;
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A009", "{0} is empty. Please complete the FIFRS mapping table.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", "Month");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
} else {
|
|
Month.MappingField = monthlist;
|
|
}
|
|
frsProperties.Month = Month;
|
|
|
|
//Department
|
|
var departmentlist = $("#departmentlist").find("option:selected").attr("value");
|
|
var departmentinput = $("#departmentinput").val();
|
|
if (departmentlist == "-1") {
|
|
if (departmentinput != "") {
|
|
|
|
Department.Expression = departmentinput;
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A009", "{0} is empty. Please complete the FIFRS mapping table.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", "Department");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
} else {
|
|
Department.MappingField = departmentlist;
|
|
}
|
|
frsProperties.Department = Department;
|
|
|
|
//Location
|
|
var locationlist = $("#locationlist").find("option:selected").attr("value");
|
|
var locationinput = $("#locationinput").val();
|
|
if (locationlist == "-1") {
|
|
if (locationinput != "") {
|
|
Location.Expression = locationinput;
|
|
} else {
|
|
|
|
//
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A009", "{0} is empty. Please complete the FIFRS mapping table.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", "Location");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
} else {
|
|
Location.MappingField = locationlist;
|
|
}
|
|
frsProperties.Location = Location;
|
|
|
|
//Account
|
|
var accountlist = $("#accountlist").find("option:selected").attr("value");
|
|
var accountinput = $("#accountinput").val();
|
|
if (accountlist == "-1") {
|
|
if (accountinput != "") {
|
|
Account.Expression = accountinput;
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A009", "{0} is empty. Please complete the FIFRS mapping table.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", "Location");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
} else {
|
|
Account.MappingField = accountlist;
|
|
}
|
|
frsProperties.Account = Account;
|
|
|
|
//SubAccount
|
|
var subaccountlist = $("#subaccountlist").find("option:selected").attr("value");
|
|
var subaccountinput = $("#subaccountinput").val();
|
|
if (subaccountlist == "-1") {
|
|
if (subaccountinput != "") {
|
|
|
|
SubAccount.Expression = subaccountinput;
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A009", "{0} is empty. Please complete the FIFRS mapping table.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", "SubAccount");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
} else {
|
|
SubAccount.MappingField = subaccountlist;
|
|
}
|
|
frsProperties.SubAccount = SubAccount;
|
|
//YTD
|
|
var ytdlist = $("#ytdlist").find("option:selected").attr("value");
|
|
var ytdinput = $("#ytdinput").val();
|
|
var ytdcheck = $("#ytdcheck").prop("checked");
|
|
if (ytdcheck) {
|
|
YTD.AutoCalc = true;
|
|
} else {
|
|
YTD.AutoCalc = false;
|
|
if (ytdlist == "-1") {
|
|
if (strIsNullorEmpty(ytdinput)) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A009", "{0} is empty. Please complete the FIFRS mapping table.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", "YTD");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
if (isNumber(ytdinput)) {
|
|
YTD.Expression = ytdinput;
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A010", "Expression validation failed: {0}.")+"<br>";
|
|
m = m.replace("{0}", ytdinput);
|
|
var b = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A019", "{0} must be an integer.");
|
|
b = b.replace("{0}", "YTD");
|
|
m = m + b;
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
|
|
} else {
|
|
YTD.MappingField = ytdlist;
|
|
}
|
|
}
|
|
frsProperties.YTD = YTD;
|
|
|
|
//MTD
|
|
var mtdlist = $("#mtdlist").find("option:selected").attr("value");
|
|
var mtdinput = $("#mtdinput").val();
|
|
var mtdcheck = $("#mtdcheck").prop("checked");
|
|
|
|
if (mtdcheck) {
|
|
MTD.AutoCalc = true;
|
|
} else {
|
|
MTD.AutoCalc = false;
|
|
if (mtdlist == "-1") {
|
|
if (strIsNullorEmpty(mtdinput)) {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A009", "{0} is empty. Please complete the FIFRS mapping table.");
|
|
m = m.replace("\\n", " \n");
|
|
m = m.replace("{0}", "MTD");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
if (isNumber(mtdinput)) {
|
|
MTD.Expression = mtdinput;
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A010", "Expression validation failed: {0}.") + "<br>";
|
|
m = m.replace("{0}", mtdinput);
|
|
var b = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_NOTICE_A019", "{0} must be an integer.");
|
|
b = b.replace("{0}", "MTD");
|
|
m = m + b;
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
|
|
} else {
|
|
MTD.MappingField = mtdlist;
|
|
}
|
|
}
|
|
frsProperties.MTD = MTD;
|
|
|
|
}
|
|
|
|
if (rowsarr && rowsarr.length > 0) {
|
|
for (var i = 0; i < rowsarr.length; i++) {
|
|
var row = rowsarr[i].toLowerCase();
|
|
if (row == nameinput.toLowerCase()) {
|
|
var m = GetLanguageByKey("LHBIS_EXCEPTION_SCENE_A023", "An error occurred in the snapshot management.") + "<br>";
|
|
m = m + GetLanguageByKey("LHBIS_EXCEPTION_E0X65022007", "There is already a snapshot of the same name");
|
|
showMessagef(m);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
var SnapshotDetails;
|
|
if (jobinfo) {
|
|
SnapshotDetails = {
|
|
$type: "FI.FIC.Contracts.DataObjects.BLObject.SnapshotDetails, FICIntfAdv",
|
|
AgeUnit: ageUnit,
|
|
AutoNaming: false,
|
|
DestDTName: destDtName,
|
|
Enabled: $("#checkenable").prop("checked"),
|
|
ExecuteCount: jobinfo.ExecuteCount,
|
|
FailReceiver: failReceiver,
|
|
ID: jobinfo.ID,
|
|
IsPackaged: jobinfo.IsPackaged,
|
|
MailWhenFailed: mailWhenFailed,
|
|
MailWhenSucced: mailWhenSucced,
|
|
MaxAge: maxAge,
|
|
Name: nameinput,
|
|
RetryCount: retryCount,
|
|
SendToFRS: enabled,
|
|
SourceDT: sourcetableid,
|
|
SuccedReceiver: succedReceiver
|
|
};
|
|
if (enabled) {
|
|
SnapshotDetails.FRSProperties = frsProperties;
|
|
}
|
|
modifyJobSchedule(_this, SnapshotDetails);
|
|
} else {
|
|
SnapshotDetails = {
|
|
$type: "FI.FIC.Contracts.DataObjects.BLObject.SnapshotDetails, FICIntfAdv",
|
|
AgeUnit: ageUnit,
|
|
AutoNaming: false,
|
|
DestDTName: destDtName,
|
|
Enabled: $("#checkenable").prop("checked"),
|
|
ExecuteCount: 0,
|
|
FailReceiver: failReceiver,
|
|
ID:$.newGuid(),
|
|
IsPackaged:false,
|
|
MailWhenFailed: mailWhenFailed,
|
|
MailWhenSucced: mailWhenSucced,
|
|
MaxAge: maxAge,
|
|
Name: nameinput,
|
|
RetryCount: retryCount,
|
|
SendToFRS: enabled,
|
|
SourceDT: sourcetableid,
|
|
SuccedReceiver: succedReceiver
|
|
};
|
|
if (enabled) {
|
|
SnapshotDetails.FRSProperties = frsProperties;
|
|
}
|
|
addJobSchedule(_this, SnapshotDetails);
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
var getdataNameDt= function(dtid, callback) {
|
|
_network.management('GetSourceDTInfo', [dtid],
|
|
function (e) {
|
|
if (e.ErrorCode !== 0) {
|
|
HiddenLoadingMask();
|
|
callback("");
|
|
return;
|
|
}
|
|
var rows = e.Result;
|
|
callback(rows);
|
|
|
|
});
|
|
}
|
|
|
|
|
|
var getdataName = function (dtid, callback) {
|
|
getdataNameDt(dtid, function (res) {
|
|
if (res) {
|
|
var names = res.DataTableName;
|
|
callback(names);
|
|
} else {
|
|
var m = GetLanguageByKey("LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_EXCEPTION_A002", "An error occurred while getting the Source Data Table structure.") + "<br>";
|
|
var m1 = GetLanguageByKey("LHBIS_EXCEPTION_E0X650270C0", "The source Data Table does not exist.");
|
|
showMessagef(m + m1);
|
|
callback("");
|
|
}
|
|
});
|
|
}
|
|
|
|
if (jobinfo) {
|
|
nameInput.val(jobinfo.Name);
|
|
|
|
getdataName(jobinfo.SourceDT, function(name) {
|
|
sourceinput.val(name).attr("tableid", jobinfo.SourceDT);
|
|
if(name!=""){
|
|
_network.management('GetSourceDTSchema', [jobinfo.SourceDT], function (e) {
|
|
if (e.ErrorCode > 0) {
|
|
var m1 = GetLanguageByKey("LHBIS_EXCEPTION_SCENE_A023", "An error occurred in the snapshot management.") + "<br>";
|
|
var m = GetLanguageByKey("LHBIS_EXCEPTION_E0X65022011", "Getting the Data Table Schema has failed. Please check the Data Table.");
|
|
showMessagef(m1 + m);
|
|
}
|
|
});
|
|
}
|
|
|
|
tableName.val(jobinfo.DestDTName);
|
|
retrycount.val(jobinfo.RetryCount);
|
|
maxage.val(jobinfo.MaxAge);
|
|
select.val(jobinfo.AgeUnit);
|
|
sendfrs.attr("checked", jobinfo.SendToFRS);
|
|
checkenable.attr("checked", jobinfo.Enabled);
|
|
if (jobinfo.MailWhenSucced) {
|
|
succeedcheck.attr("checked", true);
|
|
succeedreceiver.val(jobinfo.SuccedReceiver);
|
|
succeedreceiver.attr("disabled", false);
|
|
}
|
|
if (jobinfo.MailWhenFailed) {
|
|
failedcheck.attr("checked", true);
|
|
failedreceiver.val(jobinfo.FailReceiver);
|
|
failedreceiver.attr("disabled", false);
|
|
}
|
|
if (jobinfo.ExecuteCount != "0") {
|
|
buttonsource.attr("disabled", true);
|
|
tableName.attr("readonly", "readonly");
|
|
generate.attr("disabled", true);
|
|
}
|
|
|
|
|
|
if (jobinfo.FRSProperties) {
|
|
var frspro = jobinfo.FRSProperties;
|
|
|
|
$("#frsyinse").css({ "display": "" });
|
|
$("#frsyinse").addClass("disabledli");
|
|
|
|
getSourcedtschema(jobinfo.SourceDT, function (res) {
|
|
setlist(res);
|
|
if (name == "") {
|
|
$("#frsyinse").addClass("disabledli");
|
|
}
|
|
else{
|
|
$("#ledgerselect").val(frspro.LedgerID.Expression);
|
|
//month
|
|
if (frspro.Month.MappingField) {
|
|
$("#monthlist").val(frspro.Month.MappingField);
|
|
$("#monthinput").val("");
|
|
} else {
|
|
$("#monthlist").val("-1");
|
|
$("#monthinput").val(frspro.Month.Expression);
|
|
}
|
|
//yearlist
|
|
if (frspro.Year.MappingField) {
|
|
$("#yearlist").val(frspro.Year.MappingField);
|
|
$("#yearinput").val("");
|
|
} else {
|
|
$("#yearlist").val("-1");
|
|
$("#yearinput").val(frspro.Year.Expression);
|
|
}
|
|
//departmentlist
|
|
if (frspro.Department.MappingField) {
|
|
$("#departmentlist").val(frspro.Department.MappingField);
|
|
$("#departmentinput").val("");
|
|
} else {
|
|
$("#departmentlist").val("-1");
|
|
$("#departmentinput").val(frspro.Department.Expression);
|
|
}
|
|
//locationlist
|
|
if (frspro.Location.MappingField) {
|
|
$("#locationlist").val(frspro.Location.MappingField);
|
|
$("#locationinput").val("");
|
|
} else {
|
|
$("#locationlist").val("-1");
|
|
$("#locationinput").val(frspro.Location.Expression);
|
|
}
|
|
//accountlist
|
|
if (frspro.Account.MappingField) {
|
|
$("#accountlist").val(frspro.Account.MappingField);
|
|
$("#accountinput").val("");
|
|
} else {
|
|
$("#accountlist").val("-1");
|
|
$("#accountinput").val(frspro.Account.Expression);
|
|
}
|
|
//subaccountlist
|
|
if (frspro.SubAccount.MappingField) {
|
|
$("#subaccountlist").val(frspro.SubAccount.MappingField);
|
|
$("#subaccountinput").val("");
|
|
} else {
|
|
$("#subaccountlist").val("-1");
|
|
$("#subaccountinput").val(frspro.SubAccount.Expression);
|
|
}
|
|
//ytdlist ytdinput
|
|
if (frspro.YTD.AutoCalc) {
|
|
$("#ytdcheck").attr("checked", true);
|
|
$("#ytdlist").val("-1");
|
|
$("#ytdlist").attr("disabled", true);
|
|
$("#ytdinput").attr("disabled", true);
|
|
$("#ytdinput").val("");
|
|
} else {
|
|
$("#ytdcheck").attr("checked", false);
|
|
$("#ytdlist").attr("disabled", false);
|
|
$("#ytdinput").attr("disabled", false);
|
|
if (frspro.YTD.Expression) {
|
|
$("#ytdlist").val("-1");
|
|
$("#ytdinput").val(frspro.YTD.Expression);
|
|
}
|
|
else{
|
|
$("#ytdlist").val(frspro.YTD.MappingField);
|
|
$("#ytdinput").val("");
|
|
}
|
|
}
|
|
//mtdlist mtdinput
|
|
if (frspro.MTD.AutoCalc) {
|
|
$("#mtdcheck").attr("checked", true);
|
|
$("#mtdlist").val("-1");
|
|
$("#mtdlist").attr("disabled", true);
|
|
$("#mtdinput").attr("disabled", true);
|
|
$("#mtdinput").val("");
|
|
} else {
|
|
$("#mtdcheck").attr("checked", false);
|
|
$("#mtdlist").attr("disabled", false);
|
|
$("#mtdinput").attr("disabled", false);
|
|
if (frspro.MTD.Expression) {
|
|
$("#mtdlist").val("-1");
|
|
$("#mtdinput").val(frspro.MTD.Expression);
|
|
}
|
|
else {
|
|
$("#mtdlist").val(frspro.MTD.MappingField);
|
|
$("#mtdinput").val("");
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
this.bodyCtrlAppend(_content);
|
|
//显示
|
|
this.show();
|
|
var getFrsDataSource = function (callback) {
|
|
_network.management('GetFRSDataSource', "", function (e) {
|
|
|
|
callback(e.Result);
|
|
|
|
});
|
|
}
|
|
var sortlist= function(list) {
|
|
var reslist = [];
|
|
for(var i=0;i<list.length;i++) {
|
|
var arr = list[i];
|
|
reslist.push(arr[1].toLowerCase());
|
|
}
|
|
reslist.sort();
|
|
var listarr = [];
|
|
|
|
for (var j = 0; j < reslist.length; j++) {
|
|
var ch = reslist[j];
|
|
for (var k = 0; k < list.length; k++) {
|
|
var listch = list[k];
|
|
if (listch[1].toLowerCase() === ch) {
|
|
listarr.push(listch);
|
|
}
|
|
}
|
|
}
|
|
return listarr;
|
|
}
|
|
|
|
if (checkFrs) {
|
|
ledgeridselect = [];
|
|
var ledgerselect = $("#ledgerselect");
|
|
getFrsDataSource(function (res) {
|
|
var list = res.Rows;
|
|
if (list && list.length > 0) {
|
|
var rlist = sortlist(list);
|
|
for (var i = 0; i < rlist.length; i++) {
|
|
var option = $("<option></option>")
|
|
.attr("value", rlist[i][0])
|
|
.text(rlist[i][1])
|
|
.appendTo(ledgerselect);
|
|
}
|
|
|
|
}
|
|
});
|
|
|
|
}
|
|
};
|
|
$GlobalFilterEdit.prototype.onSizeChange = function (left, top, width, height) {
|
|
var heights = 480;
|
|
var res = parseFloat(height) - 480;
|
|
if (_utility.currentLang == "fr-fr") {
|
|
var isFireFoxs = navigator.userAgent.toUpperCase().indexOf("FIREFOX")=="-1" ? false : true;
|
|
if (isFireFoxs) {
|
|
heights = 540;
|
|
res = parseFloat(height) - 540;
|
|
if (res > 0) {
|
|
$("#JobSchedule").css({ "height": 432 + res });
|
|
$("#Snapshots").css({ "height": 432 + res });
|
|
} else {
|
|
|
|
$("#JobSchedule").css({ "height": "432px" });
|
|
$("#Snapshots").css({ "height": "432px" });
|
|
}
|
|
} else {
|
|
heights = 480;
|
|
res = parseFloat(height) - 480;
|
|
if (res > 0) {
|
|
$("#JobSchedule").css({ "height": 372 + res });
|
|
$("#Snapshots").css({ "height": 372 + res });
|
|
} else {
|
|
|
|
$("#JobSchedule").css({ "height": "372px" });
|
|
$("#Snapshots").css({ "height": "372px" });
|
|
}
|
|
}
|
|
|
|
} else {
|
|
|
|
if (res > 0) {
|
|
$("#JobSchedule").css({ "height": 370 + res });
|
|
$("#Snapshots").css({ "height": 370 + res });
|
|
} else {
|
|
$("#JobSchedule").css({ "height": "370px" });
|
|
$("#Snapshots").css({ "height": "370px" });
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}());
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</asp:Content>
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="holder_content" Runat="Server">
|
|
<div id="module_main" style="min-width: 400px;">
|
|
<div class="topTools">
|
|
<span class="helpiconspan">
|
|
<span class="helpicon" PageName="Snapshots"></span>
|
|
</span>
|
|
<input type="button" data-lgid="LHBIS_FIC_CLIENT_MODULES_SNAPSHOTCTRL_LIST_A008" style="margin-left: 10px; " data-cls="ad" tabindex="6" onclick="CreateSnapshot();" value="Create Snapshot" disabled="disabled" />
|
|
<input type="button" data-lgid="LHBIS_FIC_CLIENT_MODULES_DRILLDOWNURLPROVIDER_A004" value="Reset Layout" tabindex="5" onclick ="ClearGridLayOut();" />
|
|
<input type="button" data-lgid="FI_FRS_BLRD0143" onclick="RefreshVariable();" value="Refresh" tabindex="4" />
|
|
<input type="button" data-lgid="LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A004" data-cls="cd" onclick="CheckDel();" tabindex="3" value="Delete" disabled="disabled" />
|
|
<input type="button" data-lgid="LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A003" data-cls="ed" value="Edit" tabindex="2" onclick="Edit();" disabled="disabled" />
|
|
<input type="button" data-lgid="LHBIS_FIC_CLIENT_MODULES_JOBLISTMODULE_A002" value="Add" tabindex='1' onclick="add();" />
|
|
<div style="clear: both"></div>
|
|
</div>
|
|
<div id="Users_list" style="margin-top: 10px;"></div>
|
|
</div>
|
|
</asp:Content>
|
|
|