TASKBLL方法
/// <summary>
/// 获取所有任务
/// </summary>
/// <returns></returns>
public object GetList()
{
return Common.NewtonJsonHelper.Deserialize<object>
(Common.NewtonJsonHelper.Serialize(this.All(), null), null);
}
/// <summary>
/// 获取任务表信息
/// </summary>
/// <param name="page">页数</param>
/// <param name="limit">每页显示的条数</param>
/// <param name="swhere">搜索条件</param>
/// <param name="sort">排序条件</param>
/// create by hnn 2017-08-16
/// <returns></returns>
public object GetList(int page, int limit, string swhere, string sort)
{
swhere = swhere != null ? swhere.TrimEnd(',') + ",STATE|int|0|=,STATEVALUE|int|3|=" : "STATE|int|0|=,STATEVALUE|int|3|=";
//swhere = swhere != null ? swhere.TrimEnd(',') + "STATEVALUE|int|3|=" : "STATEVALUE|int|3|=";
PageParameter pagePara = new PageParameter()
{
PageIndex = page,
Limit = limit,
Swhere = swhere,
Sort = sort,
ObjName = "TaskList",
Igorelist = new List<string>()
};
QueryParameter query = new QueryParameter("Task", pagePara.Swhere, pagePara, null);
return this.GetAllPageList(query);
}
/// <summary>
/// 保存审核表数据
/// </summary>
/// <param name="task"></param>
/// <returns></returns>
public object PostSellSave(Task task)
{
return this.SaveOrUpdate(task);
}
/// <summary>
/// 批量删除事件
/// create by hnn
/// </summary>
/// <param name="PostClass">OID的集合</param>
/// <returns>true:删除成功,false:删除失败</returns>
public bool PostSellDelete(PostClass PostClass)
{
string OIDs = PostClass.PostData;
return this.LogicDelete(OIDs) > 0;
}
}
多条件查询
swhere = swhere != null ? swhere.TrimEnd(',') + ",STATE|int|0|=,STATEVALUE|int|3|=" : "STATE|int|0|=,STATEVALUE|int|3|=";
显示隐藏文本框:改变display属性
//隐藏文本框
$scope.ClicksYes = function () {
document.getElementById("reason").style.display = "none";
$scope.form_detail.RETURNREASON = '';
};
//显示文本框
$scope.ClicksNo = function () {
document.getElementById("reason").style.display = "block";
};
模糊查询:
where += $scope.searchfield + '|string|' + $scope.searchValue + '|like,';
table表格刷新,模态框不识别reload()方法
function load() {
$scope.parentTableParams.reload();
}
登陆成功跳转页面:
登录页面的js文件
Notify.alert('登陆成功', { status: 'success' });
$state.go('Home.Page');
public object GetList(int page, int limit, string swhere, string sort)
{
string name = Tools.SessionHelper.GetSession<Base_UserInfo>(Tools.SessionHelper.SessinoName.CurUser).Name;
StringBuilder where = new StringBuilder();
swhere = swhere != null ? swhere.TrimEnd(',') + ",STATE|int|0|=,STATEVALUE|int|3|=" : "STATE|int|0|=,STATEVALUE|int|3|=";
where.Append(swhere);
where.AppendFormat(",(@TASKLEADER|string|{0}|=|or, TASKPERSON|string|{1}|=|@)", name, name);
//获取的数据,必须只有登陆账号是任务创建人或者任务负责人的时候才会显示数据库的数据
PageParameter pagePara = new PageParameter()
{
PageIndex = page,
Limit = limit,
Swhere = where.ToString(),
Sort = sort,
ObjName = "TaskList",
Igorelist = new List<string>()
};
QueryParameter query = new QueryParameter("Task", pagePara.Swhere, pagePara, null);
object TASK = this.GetAllPageList(query);
return Common.NewtonJsonHelper.Deserialize<object>
("{\"name\":" + Common.NewtonJsonHelper.Serialize(name, null) + ", \"List\":" + Common.NewtonJsonHelper.Serialize(TASK, null) + "}", null);
}
public object GetList(int page, int limit, string swhere, string sort)
{
swhere = swhere != null ? swhere.TrimEnd(',') + ",STATE|int|0|=,STATEVALUE|int|3|=" : "STATE|int|0|=,STATEVALUE|int|3|=";
PageParameter pagePara = new PageParameter()
{
PageIndex = page,
Limit = limit,
Swhere =swhere,
Sort = sort,
ObjName = "TaskList",
Igorelist = new List<string>()
};
QueryParameter query = new QueryParameter("Task", pagePara.Swhere, pagePara, null);
return this.GetAllPageList(query);
}
序列化: 将数据结构或对象转换成二进制串的过程
反序列化:将在序列化过程中所生成的二进制串转换成数据结构或者对象的过程
return Common.NewtonJsonHelper.Deserialize<object>
("{\"name\":" + Common.NewtonJsonHelper.Serialize(name, null) + ", \"List\":" + Common.NewtonJsonHelper.Serialize(TASK, null) + "}", null);
序列化的作用是方便存储和传输。
序列化是将对象状态转换为可保持或传输的格式的过程,比如转化为二进制、xml、json等的过程。
与序列化相对的是反序列化,它将流转换为对象,也就是将在序列化过程中所生成的二进制串、xml、json等转换成数据结构或者对象的过程
var selected = $scope.checkboxes.items;
var selectedOidList = [];
selectData = new Array();
var delOIDs = '';
for (var selectSignal in selected) {
if (selected[selectSignal] == true) {
selectedOidList.unshift(selectSignal);
$scope.checkboxes.items = "";
//每次赋值后,把单选框置为空
}
};
angular js 显示隐藏文本框,ng-hide,ng-show
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script>
<script src="https://cdn.bootcss.com/angular.js/1.4.6/angular-animate.min.js"></script>
</head>
<body ng-app="ngAnimate">
<h1>隐藏 DIV: <input type="checkbox" ng-model="form.dalmyCheck"></h1>
<input ng-show="form.dalmyCheck" ng-model="form.dal">
</body>
</html>