using DBUtility;
|
using Model;
|
using Newtonsoft.Json;
|
using Newtonsoft.Json.Linq;
|
using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Web;
|
using System.Web.Http;
|
using System.Windows.Forms;
|
using WebAPI.Models;
|
using System.Threading.Tasks;
|
using DLL;
|
|
namespace WebAPI.Controllers.人事管理.人员履历
|
{
|
public class HR_PersonnelResumeController : ApiController
|
{
|
|
private json objJsonResult = new json();
|
public DataSet ds = new DataSet();
|
public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
|
|
|
#region 人员履历报表
|
|
/// <summary>
|
/// 人员履历报表
|
/// </summary>
|
/// <returns></returns>
|
[Route("HR_PersonnelResumeController/GetHR_PersonnelResumeList")]
|
[HttpGet]
|
public object GetHR_PersonnelResumeList(string sWhere)
|
{
|
try
|
{
|
|
Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
|
|
string HNumber = dic["HNumber"].ToString();//职员代码
|
string HName = dic["HName"].ToString();//职员
|
|
ds = oCN.RunProcReturn("exec h_p_HR_PersonnelResumeReport '" + HNumber.ToString() + "','" + HName + "'", "h_p_HR_PersonnelResumeReport");
|
List<object> columnNameList = new List<object>();
|
// 遍历所有表
|
foreach (DataTable table in ds.Tables)
|
{
|
List<object> tableColumnList = new List<object>();
|
|
// 添加列名
|
foreach (DataColumn col in table.Columns)
|
{
|
Type dataType = col.DataType;
|
string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
|
tableColumnList.Add(JsonConvert.DeserializeObject(ColmString));
|
}
|
|
// 将每个表的列名列表添加到总列名列表
|
columnNameList.Add(new { TableName = table.TableName, Columns = tableColumnList });
|
}
|
|
objJsonResult.code = "0";
|
objJsonResult.count = 1;
|
objJsonResult.Message = "成功!";
|
objJsonResult.data = ds;
|
objJsonResult.list = columnNameList;
|
return objJsonResult;
|
//}
|
}
|
catch (Exception e)
|
{
|
objJsonResult.code = "0";
|
objJsonResult.count = 0;
|
objJsonResult.Message = "返回报表信息失败!" + e.ToString();
|
objJsonResult.data = null;
|
return objJsonResult;
|
}
|
}
|
|
#endregion
|
|
|
}
|
}
|