using FineUIPro;
|
using iWareCommon.Common.Entity;
|
using iWareExcel.EXCEL.Service;
|
using iWareLog.LOG.EnumType;
|
using iWareLog.LOG.Service;
|
using iWareWms;
|
using iWareWms.Code.Common.Entity;
|
using iWareWms.Code.Excel.Service;
|
using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
|
|
namespace iWareWms.View.SL.InOutStorageDetail
|
{
|
public partial class InOutStorageDetail : PageBase
|
{
|
protected override Grid GetGrid()
|
{
|
return InOutStorageDetailGrid;
|
}
|
|
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 places = InOutStorageDetailService.GetInstance().QueryByParam(new QueryParam
|
{
|
Search = new Dictionary<string, object> { { "FromPlaceCode", tbFromPlaceCode.Text.Trim() }, { "ToPlaceCode", tbToPlaceCode.Text.Trim() },
|
{ "EquipName", tbEquipName.Text.Trim() } , { "MaterialCode", tbMaterialCode.Text.Trim() } },
|
Geq = new Dictionary<string, object> { { "UpdateTime", (DateTime)SUpdateTime.SelectedDate } },
|
Ltd = new Dictionary<string, object> { { "UpdateTime", ((DateTime)UpdateTime.SelectedDate).AddDays(1) } },
|
Filter = new Dictionary<string, object> { { "Type", ddlType.SelectedValue } },
|
PageIndex = pageIndex,
|
PageSize = pageSize
|
}, out msg, out totalNum, out currentPage);
|
|
var res = new List<object>();
|
places.ForEach(x => res.Add(x));
|
return res;
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
|
if (!IsPostBack)
|
{
|
|
var today = DateTime.Today;
|
SUpdateTime.SelectedDate = today.AddDays(-6);
|
UpdateTime.SelectedDate = today;
|
////记录类型
|
//ddlType.Items.Add("全部", "");
|
//foreach (var type in Enum.GetValues(typeof(EInOutStorageType)))
|
//{
|
// ddlType.Items.Add(((EInOutStorageType)type).ToString(), ((int)type).ToString());
|
//}
|
Query(1);
|
}
|
}
|
|
/// <summary>
|
/// 类型前台显示
|
/// </summary>
|
/// <param name="type"></param>
|
/// <returns></returns>
|
protected string GetType(object type)
|
{
|
return ((EInOutStorageType)Convert.ToInt32(type)).ToString();
|
}
|
|
|
protected override Window GetWindow()
|
{
|
return Window1;
|
}
|
|
protected override void GetPath(object userName)
|
{
|
string msg;
|
|
var places = InOutStorageDetailService.GetInstance().QueryByParam(new QueryParam
|
{
|
|
Search = new Dictionary<string, object> { { "tbFromPlaceCode", tbFromPlaceCode.Text.Trim() }, { "tbToPlaceCode", tbToPlaceCode.Text.Trim() },
|
{ "tbEquipName", tbEquipName.Text.Trim() } , { "tbMaterialCode", tbMaterialCode.Text.Trim() } },
|
Geq = new Dictionary<string, object> { { "UpdateTime", (DateTime)SUpdateTime.SelectedDate } },
|
Ltd = new Dictionary<string, object> { { "UpdateTime", ((DateTime)UpdateTime.SelectedDate).AddDays(1) } },
|
}, out msg);
|
|
var datas = new List<object>();
|
places.ForEach(x => datas.Add(x));
|
|
var workBooks = WorkBookService.GetInstance().QueryByParam(new QueryParam { Filter = new Dictionary<string, object> { { "Name", "库存管理" } } }, out msg);
|
var path = ExcelService.GetInstance().ToExcel(CacheEntity.WorkBookDict["库存管理"], new Dictionary<string, List<object>> { { "库存变动记录", datas } }, out msg);
|
Session["ExcelPath"] = path;
|
}
|
|
protected override FineUIPro.Timer GetTimer()
|
{
|
return timer1;
|
}
|
|
}
|
}
|