|
using FineUIPro;
|
using iWareCommon.Common.Entity;
|
using iWareCommon.Common.EnumType;
|
using iWareDataCore.DEV.Service;
|
using iWareExcel.EXCEL.Service;
|
using iWareWms;
|
using iWareWms.Code.Excel.Service;
|
using System;
|
using System.Collections.Generic;
|
|
namespace iWareWms.View.DEV.EquipmentType
|
{
|
public partial class EquipmentType : PageBase
|
{
|
|
protected override Grid GetGrid()
|
{
|
return EquipmentTypeGrid;
|
}
|
|
|
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 equipmentType = EquipmentTypeViewService.GetInstance().QueryByParam(new QueryParam
|
{
|
Search = new Dictionary<string, object> { { "Name", tbName.Text.Trim() }},
|
Filter = new Dictionary<string, object> { { "RefLabel", ddRefLabel.SelectedValue } },
|
PageIndex = pageIndex,
|
PageSize = pageSize
|
}, out msg, out totalNum, out currentPage);
|
|
var res = new List<object>();
|
|
equipmentType.ForEach(x => res.Add(x));
|
|
return res;
|
}
|
|
|
protected string GetRefLabel(object RefLabel)
|
{
|
|
if (RefLabel == null)
|
{
|
RefLabel = 0;
|
}
|
return ((EYesOrNo)RefLabel).ToString();
|
}
|
|
|
protected override void Delete(int id, out string msg)
|
{
|
EquipmentTypeService.GetInstance().Delete(id, out msg);
|
}
|
|
protected override void Delete(List<int> ids, out string msg)
|
{
|
EquipmentTypeService.GetInstance().Delete(ids, out msg);
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (!IsPostBack)
|
{
|
//判断删除复选框是否选择了至少一项纪录
|
ResolveDeleteButtonForGrid(Button3, EquipmentTypeGrid);
|
Button1.OnClientClick = Window1.GetShowReference("~/View/DEV/EquipmentType/EquipmentTypeDetail.aspx", "新增设备类型");
|
Query(1);
|
}
|
}
|
|
protected override Window GetWindow()
|
{
|
return Window2;
|
}
|
|
//protected override void GetPath(object userName)
|
//{
|
// string msg;
|
|
// var equipmentType = EquipmentTypeViewService.GetInstance().QueryByParam(new QueryParam
|
// {
|
// Search = new Dictionary<string, object> { { "Name", tbName.Text.Trim() } },
|
// Filter = new Dictionary<string, object> { { "RefLabel", ddRefLabel.SelectedValue } },
|
// }, out msg);
|
// var datas = new List<object>();
|
// equipmentType.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;
|
//}
|
|
|
protected override FineUIPro.Timer GetTimer()
|
{
|
return timer1;
|
}
|
|
}
|
}
|