using FineUIPro;
|
using iWareCommon.Common.Entity;
|
using iWareDataCore.Check.EnumType;
|
using iWareDataCore.Check.Service;
|
using iWareExcel.EXCEL.Service;
|
using iWareWms;
|
using iWareWms.Code.Excel.Service;
|
using System;
|
using System.Collections.Generic;
|
|
namespace iWareWms.View.CHECK.Plan
|
{
|
public partial class PlanResult : PageBase
|
{
|
protected override Grid GetGrid()
|
{
|
return PlanGrid;
|
}
|
|
|
protected override DropDownList GetPageSizeDropDownList()
|
{
|
return ddlPageSize;
|
}
|
|
protected override List<object> GetDataSource(int pageIndex, int pageSize, out string msg, out int totalNum, out int currentPage)
|
{
|
var plans = PlanService.GetInstance().QueryByParam(new QueryParam
|
{
|
Search = new Dictionary<string, object> { { "PlanNo", tbPlanNo.Text.Trim() } },
|
//Filter = new Dictionary<string, object> { { "PlanStatus", 2 } },
|
PageIndex = pageIndex,
|
PageSize = pageSize
|
}, out msg, out totalNum, out currentPage);
|
|
|
|
var res = new List<object>();
|
|
plans.ForEach(x => res.Add(x));
|
|
return res;
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
|
|
|
if (!IsPostBack)
|
{
|
|
Query(1);
|
}
|
}
|
|
|
|
protected override Window GetWindow()
|
{
|
return Window2;
|
}
|
|
protected override void GetPath(object userName)
|
{
|
string msg;
|
|
var plans = PlanService.GetInstance().QueryByParam(new QueryParam
|
{
|
Search = new Dictionary<string, object> { { "PlanNo", tbPlanNo.Text.Trim() } }
|
}, out msg);
|
var datas = new List<object>();
|
plans.ForEach(x => datas.Add(x));
|
var workBooks = WorkBookService.GetInstance().QueryByParam(new QueryParam { Filter = new Dictionary<string, object> { { "Name", "查看已完成的计划" } } }, out msg);
|
var path = ExcelService.GetInstance().ToExcelByEPPlus(workBooks[0], new Dictionary<string, List<object>> { { "查看已完成的计划", datas } }, out msg);
|
Session["ExcelPath"] = path;
|
}
|
|
/// <summary>
|
/// 计划状态,前台枚举显示
|
/// </summary>
|
/// <param name="status"></param>
|
/// <returns></returns>
|
protected string GetStatus(object status)
|
{
|
return ((EPlanStatus)Convert.ToInt32(status)).ToString();
|
}
|
|
protected override FineUIPro.Timer GetTimer()
|
{
|
return timer1;
|
}
|
}
|
}
|