public JsonResult GetRetiredList(QueryBuilder qb) { if (qb.DefaultSort) { qb.SortField = "SortIndex,WorkNo"; qb.SortOrder = "asc,asc"; } string sql = @"select ID,GroupID,Code,Name,WorkNo,Sex,Description,InDate,OutDate,Phone,MobilePhone,Email,Address,SortIndex,LastLoginTime,LastLoginIP,LastSessionID,ErrorCount,ErrorTime,IsDeleted,DeleteTime,PrjID,PrjName,DeptID,DeptFullID,DeptName,RTX,ModifyTime from S_A_User where IsDeleted='1'"; SQLHelper sqlHelper = SQLHelper.CreateSqlHelper(ConnEnum.Base); DataTable dt = sqlHelper.ExecuteDataTable(sql, qb); dt.Columns.Add("DeptNames"); AuthFO authFO = FormulaHelper.CreateFO <AuthFO>(); foreach (DataRow row in dt.Rows) { row["DeptNames"] = authFO.GetUserDeptNames(row["ID"].ToString()); } GridData data = new GridData(dt); data.total = qb.TotolCount; return(Json(data)); }
public JsonResult GetRetiredList(QueryBuilder qb) { if (qb.DefaultSort) { qb.SortField = "SortIndex,WorkNo"; qb.SortOrder = "asc,asc"; } string sql = "select * from S_A_User where IsDeleted='1'"; SQLHelper sqlHelper = SQLHelper.CreateSqlHelper(ConnEnum.Base); DataTable dt = sqlHelper.ExecuteDataTable(sql, qb); dt.Columns.Add("DeptNames"); AuthFO authFO = FormulaHelper.CreateFO <AuthFO>(); foreach (DataRow row in dt.Rows) { row["DeptNames"] = authFO.GetUserDeptNames(row["ID"].ToString()); } GridData data = new GridData(dt); data.total = qb.TotolCount; return(Json(data)); }
public override JsonResult GetModel(string id) { AuthFO authFO = FormulaHelper.CreateFO <AuthFO>(); var entity = GetEntity <S_A_User>(id); string deptNames = authFO.GetUserDeptNames(id); var dic = FormulaHelper.ModelToDic(entity); dic.Add("DeptNames", deptNames); return(Json(dic)); }
public override JsonResult GetList(QueryBuilder qb) { if (qb.DefaultSort) { qb.SortField = "SortIndex,WorkNo"; qb.SortOrder = "asc,asc"; } if (!string.IsNullOrEmpty(Request["CorpID"])) { qb.Add("CorpID", QueryMethod.In, Request["CorpID"]); } qb.Fields = "distinct ID,Code,Name,WorkNo,Sex,InDate,OutDate,Phone,MobilePhone,Email,Address,SortIndex,IsDeleted,PrjID,PrjName,DeptID,DeptFullID,DeptName,RTX,ModifyTime,ErrorCount,CorpID"; string sql = @" SELECT S_A_User.ID,S_A_User.Code,S_A_User.Name,WorkNo,Sex,InDate,OutDate,Phone,MobilePhone,Email,Address,S_A_User.SortIndex,S_A_User.IsDeleted,PrjID,PrjName,DeptID,DeptFullID,DeptName,RTX,ModifyTime,FullID,S_A_User.ErrorCount,CorpID from S_A_User join S_A__OrgUser on UserID=S_A_User.ID join S_A_Org on S_A_Org.ID=OrgID where S_A_User.IsDeleted='0' or S_A_User.IsDeleted is null"; SQLHelper sqlHelper = SQLHelper.CreateSqlHelper(ConnEnum.Base); DataTable dt = sqlHelper.ExecuteDataTable(sql, qb); dt.Columns.Add("DeptNames"); AuthFO authFO = FormulaHelper.CreateFO <AuthFO>(); foreach (DataRow row in dt.Rows) { row["DeptNames"] = authFO.GetUserDeptNames(row["ID"].ToString()); } GridData data = new GridData(dt); data.total = qb.TotolCount; return(Json(data)); }