学 赵
4 years ago
17 changed files with 90 additions and 1968 deletions
@ -1,425 +0,0 @@ |
|||
using CK.SCP.Models; |
|||
using CK.SCP.Models.Enums; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Models.ScpEntity.ExcelExportEnttity; |
|||
using CK.SCP.Utils; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Data.Entity.Core; |
|||
using System.Data.Entity.Migrations; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace CK.SCP.Controller |
|||
{ |
|||
public class SCP_FORECAST_CONTROLLER |
|||
{ |
|||
/// <summary>
|
|||
/// 获取数据
|
|||
/// </summary>
|
|||
/// <param name="p_entity"></param>
|
|||
/// <param name="p_action"></param>
|
|||
public static void Get_V_TB_FORECAST_List(V_TB_FORECAST p_entity, Action<ResultObject<IQueryable<V_TB_FORECAST>>> p_action) |
|||
{ |
|||
ResultObject<IQueryable<V_TB_FORECAST>> _ret = new ResultObject<IQueryable<V_TB_FORECAST>>(); |
|||
try |
|||
{ |
|||
using (Models.ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
IQueryable<V_TB_FORECAST> q = db.V_TB_FORECAST; |
|||
|
|||
if (!string.IsNullOrEmpty(p_entity.PartCode)) |
|||
{ |
|||
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode)); |
|||
} |
|||
if (!string.IsNullOrEmpty(p_entity.VendId)) |
|||
{ |
|||
q = q.Where(p => p.VendId == p_entity.VendId); |
|||
} |
|||
if (p_entity.BillStateList != null && p_entity.BillStateList.Count > 0) |
|||
{ |
|||
q = q.Where(p => p_entity.BillStateList.Contains((int)p.State)); |
|||
} |
|||
if (!string.IsNullOrEmpty(p_entity.State_DESC)) |
|||
{ |
|||
q = q.Where(p => p.State_DESC.Contains(p_entity.State_DESC)); |
|||
} |
|||
if (!string.IsNullOrEmpty(p_entity.Month)) |
|||
{ |
|||
q = q.Where(p => p.Month == p_entity.Month); |
|||
} |
|||
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); |
|||
if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0) |
|||
{ |
|||
q = q.Where(p => p_entity.UserInAddress.Contains(p.Site)); |
|||
} |
|||
if (!string.IsNullOrEmpty(p_entity.CreateUser)) |
|||
{ |
|||
q = q.Where(p => p.CreateUser == p_entity.CreateUser); |
|||
} |
|||
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0) |
|||
{ |
|||
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId)); |
|||
} |
|||
_ret.State = ReturnStatus.Succeed; |
|||
_ret.Result = q; |
|||
p_action(_ret); |
|||
} |
|||
} |
|||
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
|
|||
{ |
|||
var sb = new StringBuilder(); |
|||
foreach (var error in dbEx.EntityValidationErrors.ToList()) |
|||
{ |
|||
error.ValidationErrors.ToList().ForEach(i => |
|||
{ |
|||
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); |
|||
}); |
|||
} |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.ErrorList.Add(dbEx); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", sb.ToString()); |
|||
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); |
|||
} |
|||
catch (OptimisticConcurrencyException ex)//并发冲突异常
|
|||
{ |
|||
|
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.ErrorList.Add(ex); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", ex.ToString()); |
|||
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); |
|||
} |
|||
catch (ScpException ex) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.ErrorList.Add(ex); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", ex.ToString()); |
|||
|
|||
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) |
|||
{ |
|||
var inner = (UpdateException)ex.InnerException; |
|||
|
|||
|
|||
throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); |
|||
} |
|||
else |
|||
{ |
|||
if (ex.InnerException != null) throw ex.InnerException; |
|||
} |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.ErrorList.Add(e); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", e.Message); |
|||
throw e; |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// EXCEL导入
|
|||
/// </summary>
|
|||
/// <param name="p_order_list"></param>
|
|||
/// <param name="p_creator"></param>
|
|||
/// <returns></returns>
|
|||
public static ResultObject<bool> EXCEL_FORECAST_MOD(List<SCP_FORECAST_EXPORT> p_order_list, string p_creator, string site) |
|||
{ |
|||
ResultObject<bool> _ret = new ResultObject<bool>(); |
|||
try |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
int number = 1; |
|||
List<string> lineError = new List<string>(); |
|||
List<string> ErrorList = new List<string>(); |
|||
var _lst = p_order_list; |
|||
_lst.ForEach |
|||
(p => |
|||
{ |
|||
var _ls = CheckExcelMode_Forecast(db, p); |
|||
if (_ls.Count > 0) |
|||
{ |
|||
lineError.Add(number.ToString()); |
|||
ErrorList.Add(string.Join("<br>", _ls.ToArray())); |
|||
} |
|||
number++; |
|||
}); |
|||
if (lineError.Count > 0) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.MessageList.AddRange(ErrorList); |
|||
_ret.Result = false; |
|||
} |
|||
else |
|||
{ |
|||
_lst.ForEach(p => |
|||
{ |
|||
var _item = db.TB_FORECAST.SingleOrDefault(t => t.PartCode == p.零件编号.ToUpper() && t.VendId == p.供应商编码 && t.Month == p.月份) ?? |
|||
new TB_FORECAST { PartCode = p.零件编号.ToUpper(), VendId = p.供应商编码, Month = p.月份, GUID = System.Guid.NewGuid() }; |
|||
_item.MonthQty1 = decimal.Parse(p.预测1); |
|||
_item.MonthQty2 = decimal.Parse(p.预测2); |
|||
_item.MonthQty3 = decimal.Parse(p.预测3); |
|||
_item.IsDeleted = false; |
|||
_item.CreateUser = p_creator; |
|||
_item.CreateTime = DateTime.Now; |
|||
_item.State = (int)ForecastState.New; |
|||
_item.UpdateInfo = ""; |
|||
_item.Site = site; |
|||
db.TB_FORECAST.AddOrUpdate(_item); |
|||
}); |
|||
if (_ret.MessageList.Count == 0) |
|||
{ |
|||
int state = db.SaveChanges(); |
|||
if (state != -1) |
|||
{ |
|||
_ret.State = ReturnStatus.Succeed; |
|||
_ret.Result = true; |
|||
} |
|||
else |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
|
|||
{ |
|||
var sb = new StringBuilder(); |
|||
|
|||
foreach (var error in dbEx.EntityValidationErrors.ToList()) |
|||
{ |
|||
|
|||
error.ValidationErrors.ToList().ForEach(i => |
|||
{ |
|||
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); |
|||
}); |
|||
} |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(dbEx); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", sb.ToString()); |
|||
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); |
|||
} |
|||
catch (OptimisticConcurrencyException ex)//并发冲突异常
|
|||
{ |
|||
|
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(ex); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", ex.ToString()); |
|||
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); |
|||
} |
|||
catch (ScpException ex) |
|||
{ |
|||
|
|||
|
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(ex); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", ex.ToString()); |
|||
|
|||
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) |
|||
{ |
|||
var inner = (UpdateException)ex.InnerException; |
|||
|
|||
|
|||
throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); |
|||
} |
|||
else |
|||
{ |
|||
if (ex.InnerException != null) throw ex.InnerException; |
|||
} |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", e.Message); |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(e); |
|||
throw e; |
|||
} |
|||
return _ret; |
|||
} |
|||
/// <summary>
|
|||
/// 导入验证
|
|||
/// </summary>
|
|||
/// <param name="db"></param>
|
|||
/// <param name="p_excel"></param>
|
|||
/// <returns></returns>
|
|||
private static List<string> CheckExcelMode_Forecast(ScpEntities db, SCP_FORECAST_EXPORT p_excel) |
|||
{ |
|||
List<string> ErrorList = new List<string>(); |
|||
if ( |
|||
string.IsNullOrEmpty(p_excel.零件编号) || |
|||
string.IsNullOrEmpty(p_excel.供应商编码) || |
|||
string.IsNullOrEmpty((p_excel.月份).ToString()) || |
|||
string.IsNullOrEmpty(p_excel.预测1) || |
|||
string.IsNullOrEmpty(p_excel.预测2) || |
|||
string.IsNullOrEmpty(p_excel.预测3)) |
|||
{ |
|||
ErrorList.Add(string.Format("零件编号【{0}】有填写为空!", p_excel.零件编号)); |
|||
} |
|||
return ErrorList; |
|||
} |
|||
|
|||
public static ResultObject<bool> Save_TB_FORECAST_STATE(List<long> p_list, string p_user, ForecastState State) |
|||
{ |
|||
ResultObject<bool> _ret = new ResultObject<bool>(); |
|||
try |
|||
{ |
|||
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|||
{ |
|||
if (State == ForecastState.Confirm) |
|||
{ |
|||
var _ls = db.TB_FORECAST.Where(p => p_list.Contains(p.UID)).ToList(); |
|||
int count = _ls.Count(p => p.State == (int)ForecastState.New); |
|||
if (count == _ls.Count && _ls.Count > 0) |
|||
{ |
|||
_ls.ForEach(p => |
|||
{ |
|||
p.State = (int)ForecastState.Confirm; |
|||
p.UpdateTime = DateTime.Now; |
|||
p.UpdateUser = p_user; |
|||
p.UpdateInfo = "供应商确认"; |
|||
} |
|||
); |
|||
db.TB_FORECAST.AddOrUpdate(p => p.UID, _ls.ToArray()); |
|||
} |
|||
else |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.Message = "选择的记录,有已经确认的数据!"; |
|||
} |
|||
} |
|||
if (State == ForecastState.Reject) |
|||
{ |
|||
var _ls = db.TB_FORECAST.Where(p => p_list.Contains(p.UID)).ToList(); |
|||
int count = _ls.Count(p => p.State == (int)ForecastState.New); |
|||
if (count == _ls.Count && _ls.Count > 0) |
|||
{ |
|||
_ls.ForEach(p => |
|||
{ |
|||
p.State = (int)ForecastState.Reject; |
|||
p.UpdateTime = DateTime.Now; |
|||
p.UpdateUser = p_user; |
|||
p.UpdateInfo = "作废"; |
|||
p.IsDeleted = true ; |
|||
} |
|||
); |
|||
db.TB_FORECAST.AddOrUpdate(p => p.UID, _ls.ToArray()); |
|||
} |
|||
else |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.Message = "选择的记录,有已经确认的数据!"; |
|||
} |
|||
} |
|||
if (State == ForecastState.New) |
|||
{ |
|||
var _ls = db.TB_FORECAST.Where(p => p_list.Contains(p.UID)).ToList(); |
|||
int count = _ls.Count(p => p.State == (int)ForecastState.Confirm); |
|||
if (count == _ls.Count && _ls.Count > 0) |
|||
{ |
|||
_ls.ForEach(p => |
|||
{ |
|||
p.State = (int)ForecastState.New; |
|||
p.UpdateTime = DateTime.Now; |
|||
p.UpdateUser = p_user; |
|||
p.UpdateInfo = "取消确认"; |
|||
} |
|||
); |
|||
db.TB_FORECAST.AddOrUpdate(p => p.UID, _ls.ToArray()); |
|||
} |
|||
else |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.Message = "选择的记录,有不是确认的数据!"; |
|||
} |
|||
} |
|||
if (string.IsNullOrEmpty(_ret.Message)) |
|||
{ |
|||
if (db.SaveChanges() != -1) |
|||
{ |
|||
_ret.State = ReturnStatus.Succeed; |
|||
_ret.Result = true; |
|||
} |
|||
else |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.Message = "数据更新失败!"; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
|
|||
{ |
|||
var sb = new StringBuilder(); |
|||
|
|||
foreach (var error in dbEx.EntityValidationErrors.ToList()) |
|||
{ |
|||
|
|||
error.ValidationErrors.ToList().ForEach(i => |
|||
{ |
|||
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); |
|||
}); |
|||
} |
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(dbEx); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", sb.ToString()); |
|||
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); |
|||
} |
|||
catch (OptimisticConcurrencyException ex)//并发冲突异常
|
|||
{ |
|||
|
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(ex); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", ex.ToString()); |
|||
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); |
|||
} |
|||
catch (ScpException ex) |
|||
{ |
|||
|
|||
|
|||
_ret.State = ReturnStatus.Failed; |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(ex); |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", ex.ToString()); |
|||
|
|||
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) |
|||
{ |
|||
var inner = (UpdateException)ex.InnerException; |
|||
|
|||
|
|||
throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); |
|||
} |
|||
else |
|||
{ |
|||
if (ex.InnerException != null) throw ex.InnerException; |
|||
} |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
_ret.State = ReturnStatus.Failed; |
|||
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", e.Message); |
|||
_ret.Result = false; |
|||
_ret.ErrorList.Add(e); |
|||
throw e; |
|||
} |
|||
|
|||
return _ret; |
|||
} |
|||
} |
|||
} |
@ -1,101 +0,0 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_FORECAST.aspx.cs" Inherits="SCP.Views.PlanData.SCP_FORECAST" %> |
|||
|
|||
<!DOCTYPE html> |
|||
|
|||
<html xmlns="http://www.w3.org/1999/xhtml"> |
|||
<head runat="server"> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title></title> |
|||
</head> |
|||
<body> |
|||
<form id="form1" runat="server"> |
|||
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> |
|||
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> |
|||
<Items> |
|||
<f:Form runat="server"> |
|||
<Toolbars> |
|||
<f:Toolbar ID="Toolbar1" runat="server"> |
|||
<Items> |
|||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> |
|||
</f:ToolbarSeparator> |
|||
<f:Button ID="btnRefresh" runat="server" Text="刷新" EnablePostBack="True" Icon="Reload" OnClientClick="location.reload();"> |
|||
</f:Button> |
|||
<f:Button ID="btnSave" runat="server" Hidden="true" Text="确认" Icon="CssValid" OnClick="btnSave_Click" ></f:Button> |
|||
<f:Button ID="btnCancleSave" runat="server" Hidden="true" Text="取消确认" Icon="CssGo" OnClick="BtnCancleSave_Click" OnClientClick="if(!confirm('是否取消确认?'))return false;"></f:Button> |
|||
<f:Button ID="btnDelete" runat="server" Text="删除" Icon="CssDelete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否删除?'))return false;" ></f:Button> |
|||
<f:ToolbarSeparator runat="server" /> |
|||
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload> |
|||
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click"> |
|||
</f:Button> |
|||
</Items> |
|||
</f:Toolbar> |
|||
</Toolbars> |
|||
</f:Form> |
|||
<f:Form BodyPadding="10px" Height="50px" ID="extForm1" |
|||
runat="server" Title="" ShowHeader="false"> |
|||
<Rows> |
|||
<f:FormRow ColumnWidths="33% 33% 33% 33%" ID="FormRow_2" runat="server"> |
|||
<Items> |
|||
<f:TextBox runat="server" Label="零件号" ID="TextPartCode"> |
|||
</f:TextBox> |
|||
<f:TextBox runat="server" Label="供应商编码" ID="TextVendId"> |
|||
</f:TextBox> |
|||
<f:DropDownList ID="ddl_Day" runat="server" Label="查询月份"> |
|||
<f:ListItem Text="全部" Value="0" Selected="true" /> |
|||
<f:ListItem Text="1月" Value="1" /> |
|||
<f:ListItem Text="2月" Value="2" /> |
|||
<f:ListItem Text="3月" Value="3" /> |
|||
<f:ListItem Text="4月" Value="4" /> |
|||
<f:ListItem Text="5月" Value="5" /> |
|||
<f:ListItem Text="6月" Value="6" /> |
|||
<f:ListItem Text="7月" Value="7" /> |
|||
<f:ListItem Text="8月" Value="8" /> |
|||
<f:ListItem Text="9月" Value="9" /> |
|||
<f:ListItem Text="10月" Value="10" /> |
|||
<f:ListItem Text="11月" Value="11" /> |
|||
<f:ListItem Text="12月" Value="12" /> |
|||
</f:DropDownList> |
|||
<f:DropDownList runat="server" ID="DDL_State" Label="状态"> |
|||
<f:ListItem Text="-" Value=""/> |
|||
<f:ListItem Text="新建" Value="0" /> |
|||
<f:ListItem Text="已确认" Value="1" /> |
|||
</f:DropDownList> |
|||
<f:Button runat="server" ID="Button1" Text="查询" OnClick="btnSearch_Click"></f:Button> |
|||
</Items> |
|||
</f:FormRow> |
|||
</Rows> |
|||
</f:Form> |
|||
<f:Grid ID="Grid_V_TB_FORECAST" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableCheckBoxSelect="true" |
|||
runat="server" DataKeyNames="UID,PartCode,Month,MonthQty1,MonthQty2,MonthQty3,State,CreateUser,CreateTime" |
|||
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_FORECAST_PageIndexChange" |
|||
AutoScroll="True" EnableRowDoubleClickEvent="True"> |
|||
<PageItems> |
|||
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server"> |
|||
</f:ToolbarSeparator> |
|||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:"> |
|||
</f:ToolbarText> |
|||
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" |
|||
runat="server"> |
|||
<f:ListItem Text="100" Value="100" /> |
|||
<f:ListItem Text="200" Value="200" /> |
|||
</f:DropDownList> |
|||
</PageItems> |
|||
<Columns> |
|||
<f:BoundField runat="server" HeaderText="UID" Hidden="true" ColumnID="" DataField="UID" /> |
|||
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" /> |
|||
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" /> |
|||
<f:BoundField runat="server" HeaderText="零件编号" ColumnID="" DataField="PartCode" /> |
|||
<f:BoundField runat="server" HeaderText="月份" ColumnID="" DataField="Month" /> |
|||
<f:BoundField runat="server" HeaderText="N+1" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty1" /> |
|||
<f:BoundField runat="server" HeaderText="N+2" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty2" /> |
|||
<f:BoundField runat="server" HeaderText="N+3" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty3" /> |
|||
<f:BoundField runat="server" HeaderText="状态" Hidden="true" ColumnID="" DataField="State" /> |
|||
<f:BoundField runat="server" HeaderText="创建者" ColumnID="" DataField="CreateUser" /> |
|||
<f:BoundField Width="100px" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期" /> |
|||
</Columns> |
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
</form> |
|||
</body> |
|||
</html> |
@ -1,239 +0,0 @@ |
|||
using CK.SCP.Controller; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Models.ScpEntity.ExcelExportEnttity; |
|||
using CK.SCP.Utils; |
|||
using FineUI; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Data; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Web; |
|||
using System.Web.UI; |
|||
using System.Web.UI.WebControls; |
|||
using CK.SCP.Models.Enums; |
|||
|
|||
namespace SCP.Views.PlanData |
|||
{ |
|||
public partial class SCP_FORECAST : PageBase |
|||
{ |
|||
/// <summary>
|
|||
/// 页面加载
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
LoadData(); |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 加载数据
|
|||
/// </summary>
|
|||
public void LoadData() |
|||
{ |
|||
BindData(); |
|||
} |
|||
/// <summary>
|
|||
/// 数据绑定
|
|||
/// </summary>
|
|||
public void BindData() |
|||
{ |
|||
SearchV_TB_FORECAST_Data((result) => |
|||
{ |
|||
Grid_V_TB_FORECAST.RecordCount = result.Count(); |
|||
var list = SortAndPage<V_TB_FORECAST>(result, Grid_V_TB_FORECAST); |
|||
Grid_V_TB_FORECAST.DataSource = list; |
|||
Grid_V_TB_FORECAST.DataBind(); |
|||
}); |
|||
} |
|||
/// <summary>
|
|||
/// 获取数据
|
|||
/// </summary>
|
|||
/// <param name="p_action"></param>
|
|||
public void SearchV_TB_FORECAST_Data(Action<IQueryable<V_TB_FORECAST>> p_action) |
|||
{ |
|||
V_TB_FORECAST _entity = new V_TB_FORECAST(); |
|||
_entity.IsDeleted = false; |
|||
if (!string.IsNullOrEmpty(TextPartCode.Text)) |
|||
{ |
|||
_entity.PartCode = TextPartCode.Text; |
|||
} |
|||
if (!string.IsNullOrEmpty(TextVendId.Text)) |
|||
{ |
|||
_entity.VendId = TextVendId.Text; |
|||
} |
|||
if (ddl_Day.SelectedValue != "0") |
|||
{ |
|||
_entity.Month = ddl_Day.SelectedValue; |
|||
} |
|||
_entity.UserInAddress = CurrentUser.FactoryList; |
|||
_entity.UserInVendIds = CurrentUser.VenderList; |
|||
if (!string.IsNullOrEmpty(DDL_State.SelectedValue)) |
|||
{ |
|||
_entity.BillStateList = new List<int>() { int.Parse(DDL_State.SelectedValue) }; |
|||
} |
|||
SCP_FORECAST_CONTROLLER.Get_V_TB_FORECAST_List(_entity, (_ret) => |
|||
{ |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
/// <summary>
|
|||
/// 查询
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnSearch_Click(object sender, EventArgs e) |
|||
{ |
|||
BindData(); |
|||
} |
|||
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
BindData(); |
|||
} |
|||
protected void Grid_V_TB_FORECAST_PageIndexChange(object sender, GridPageEventArgs e) |
|||
{ |
|||
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
BindData(); |
|||
} |
|||
/// <summary>
|
|||
/// 导入
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnInput_Click(object sender, EventArgs e) |
|||
{ |
|||
try |
|||
{ |
|||
string _fileName = FileUp.FileName; |
|||
if (string.IsNullOrEmpty(_fileName)) |
|||
{ |
|||
Alert.Show("选择文件为空!"); |
|||
return; |
|||
} |
|||
string _lx = _fileName.Split('.')[1]; |
|||
Stream _stream = FileUp.PostedFile.InputStream; |
|||
DataTable _dt = new DataTable(); |
|||
if (_lx == "xls") |
|||
{ |
|||
_dt = ExcelHelper.GetDataTable(_stream); |
|||
} |
|||
else |
|||
{ |
|||
_dt = ExcelHelper.GetDataTableOfXlsx(_stream); |
|||
} |
|||
var list = ConvertHelper.ToList<SCP_FORECAST_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList(); |
|||
var ret = SCP_FORECAST_CONTROLLER.EXCEL_FORECAST_MOD(list, CurrentUser.Name, CurrentUser.FactoryList[0]); |
|||
if (ret.State == ReturnStatus.Succeed && ret.Result == true) |
|||
{ |
|||
BindData(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(string.Join("<br>", ret.MessageList)); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
Alert.Show(ex.Message); |
|||
} |
|||
|
|||
} |
|||
/// <summary>
|
|||
/// 确认数据
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnSave_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray; |
|||
List<long> _UidList = new List<long>(); |
|||
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++) |
|||
{ |
|||
if (_selections.Contains(i)) |
|||
{ |
|||
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i]; |
|||
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
|||
{ |
|||
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
|||
} |
|||
} |
|||
} |
|||
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Confirm); |
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
BindData(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(ret.Message); |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 删除数据
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnDelete_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray; |
|||
List<long> _UidList = new List<long>(); |
|||
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++) |
|||
{ |
|||
if (_selections.Contains(i)) |
|||
{ |
|||
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i]; |
|||
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
|||
{ |
|||
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
|||
} |
|||
} |
|||
} |
|||
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Reject); |
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
BindData(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(ret.Message); |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 取消确认
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void BtnCancleSave_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray; |
|||
List<long> _UidList = new List<long>(); |
|||
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++) |
|||
{ |
|||
if (_selections.Contains(i)) |
|||
{ |
|||
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i]; |
|||
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
|||
{ |
|||
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
|||
} |
|||
} |
|||
} |
|||
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.New); |
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
BindData(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(ret.Message); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,204 +0,0 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.PlanData { |
|||
|
|||
|
|||
public partial class SCP_FORECAST { |
|||
|
|||
/// <summary>
|
|||
/// form1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
|||
|
|||
/// <summary>
|
|||
/// Panel1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Panel Panel1; |
|||
|
|||
/// <summary>
|
|||
/// Toolbar1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Toolbar Toolbar1; |
|||
|
|||
/// <summary>
|
|||
/// ToolbarSeparator1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.ToolbarSeparator ToolbarSeparator1; |
|||
|
|||
/// <summary>
|
|||
/// btnRefresh 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnRefresh; |
|||
|
|||
/// <summary>
|
|||
/// btnSave 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnSave; |
|||
|
|||
/// <summary>
|
|||
/// btnCancleSave 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnCancleSave; |
|||
|
|||
/// <summary>
|
|||
/// btnDelete 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnDelete; |
|||
|
|||
/// <summary>
|
|||
/// FileUp 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.FileUpload FileUp; |
|||
|
|||
/// <summary>
|
|||
/// btnInput 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnInput; |
|||
|
|||
/// <summary>
|
|||
/// extForm1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Form extForm1; |
|||
|
|||
/// <summary>
|
|||
/// FormRow_2 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.FormRow FormRow_2; |
|||
|
|||
/// <summary>
|
|||
/// TextPartCode 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TextPartCode; |
|||
|
|||
/// <summary>
|
|||
/// TextVendId 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TextVendId; |
|||
|
|||
/// <summary>
|
|||
/// ddl_Day 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList ddl_Day; |
|||
|
|||
/// <summary>
|
|||
/// DDL_State 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList DDL_State; |
|||
|
|||
/// <summary>
|
|||
/// Button1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button Button1; |
|||
|
|||
/// <summary>
|
|||
/// Grid_V_TB_FORECAST 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid_V_TB_FORECAST; |
|||
|
|||
/// <summary>
|
|||
/// ToolbarSeparator2 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.ToolbarSeparator ToolbarSeparator2; |
|||
|
|||
/// <summary>
|
|||
/// ToolbarText1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.ToolbarText ToolbarText1; |
|||
|
|||
/// <summary>
|
|||
/// ddlGridPageSize 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList ddlGridPageSize; |
|||
} |
|||
} |
@ -1,101 +0,0 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_FORECAST.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_FORECAST" %> |
|||
|
|||
<!DOCTYPE html> |
|||
|
|||
<html xmlns="http://www.w3.org/1999/xhtml"> |
|||
<head runat="server"> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
|||
<title></title> |
|||
</head> |
|||
<body> |
|||
<form id="form1" runat="server"> |
|||
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> |
|||
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> |
|||
<Items> |
|||
<f:Form runat="server"> |
|||
<Toolbars> |
|||
<f:Toolbar ID="Toolbar1" runat="server"> |
|||
<Items> |
|||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> |
|||
</f:ToolbarSeparator> |
|||
<f:Button ID="btnRefresh" runat="server" Text="刷新" EnablePostBack="True" Icon="Reload" OnClientClick="location.reload();"> |
|||
</f:Button> |
|||
<f:Button ID="btnSave" runat="server" Text="确认" Icon="CssValid" OnClick="btnSave_Click" ></f:Button> |
|||
<f:Button ID="btnCancleSave" runat="server" Text="取消确认" Icon="CssGo" OnClick="BtnCancleSave_Click" OnClientClick="if(!confirm('是否取消确认?'))return false;"></f:Button> |
|||
<f:Button ID="btnDelete" runat="server" Hidden="true" Text="删除" Icon="CssDelete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否删除?'))return false;" ></f:Button> |
|||
<f:ToolbarSeparator runat="server" /> |
|||
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Hidden="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload> |
|||
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" Hidden="true" OnClick="btnInput_Click"> |
|||
</f:Button> |
|||
</Items> |
|||
</f:Toolbar> |
|||
</Toolbars> |
|||
</f:Form> |
|||
<f:Form BodyPadding="10px" Height="50px" ID="extForm1" |
|||
runat="server" Title="" ShowHeader="false"> |
|||
<Rows> |
|||
<f:FormRow ColumnWidths="33% 33% 33% 33%" ID="FormRow_2" runat="server"> |
|||
<Items> |
|||
<f:TextBox runat="server" Label="零件号" ID="TextPartCode"> |
|||
</f:TextBox> |
|||
<f:TextBox runat="server" Label="供应商编码" ID="TextVendId"> |
|||
</f:TextBox> |
|||
<f:DropDownList ID="ddl_Day" runat="server" Label="查询月份"> |
|||
<f:ListItem Text="全部" Value="0" Selected="true" /> |
|||
<f:ListItem Text="1月" Value="1" /> |
|||
<f:ListItem Text="2月" Value="2" /> |
|||
<f:ListItem Text="3月" Value="3" /> |
|||
<f:ListItem Text="4月" Value="4" /> |
|||
<f:ListItem Text="5月" Value="5" /> |
|||
<f:ListItem Text="6月" Value="6" /> |
|||
<f:ListItem Text="7月" Value="7" /> |
|||
<f:ListItem Text="8月" Value="8" /> |
|||
<f:ListItem Text="9月" Value="9" /> |
|||
<f:ListItem Text="10月" Value="10" /> |
|||
<f:ListItem Text="11月" Value="11" /> |
|||
<f:ListItem Text="12月" Value="12" /> |
|||
</f:DropDownList> |
|||
<f:DropDownList runat="server" ID="DDL_State" Label="状态"> |
|||
<f:ListItem Text="-" Value=""/> |
|||
<f:ListItem Text="新建" Value="0" /> |
|||
<f:ListItem Text="已确认" Value="1" /> |
|||
</f:DropDownList> |
|||
<f:Button runat="server" ID="Button1" Text="查询" OnClick="btnSearch_Click"></f:Button> |
|||
</Items> |
|||
</f:FormRow> |
|||
</Rows> |
|||
</f:Form> |
|||
<f:Grid ID="Grid_V_TB_FORECAST" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableCheckBoxSelect="true" |
|||
runat="server" DataKeyNames="UID,PartCode,Month,MonthQty1,MonthQty2,MonthQty3,State,CreateUser,CreateTime" |
|||
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_FORECAST_PageIndexChange" |
|||
AutoScroll="True" EnableRowDoubleClickEvent="True"> |
|||
<PageItems> |
|||
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server"> |
|||
</f:ToolbarSeparator> |
|||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:"> |
|||
</f:ToolbarText> |
|||
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" |
|||
runat="server"> |
|||
<f:ListItem Text="100" Value="100" /> |
|||
<f:ListItem Text="200" Value="200" /> |
|||
</f:DropDownList> |
|||
</PageItems> |
|||
<Columns> |
|||
<f:BoundField runat="server" HeaderText="UID" Hidden="true" ColumnID="" DataField="UID" /> |
|||
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" /> |
|||
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" /> |
|||
<f:BoundField runat="server" HeaderText="零件编号" ColumnID="" DataField="PartCode" /> |
|||
<f:BoundField runat="server" HeaderText="月份" ColumnID="" DataField="Month" /> |
|||
<f:BoundField runat="server" HeaderText="N+1" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty1" /> |
|||
<f:BoundField runat="server" HeaderText="N+2" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty2" /> |
|||
<f:BoundField runat="server" HeaderText="N+3" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty3" /> |
|||
<f:BoundField runat="server" HeaderText="状态" Hidden="true" ColumnID="" DataField="State" /> |
|||
<f:BoundField runat="server" HeaderText="创建者" ColumnID="" DataField="CreateUser" /> |
|||
<f:BoundField Width="100px" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期" /> |
|||
</Columns> |
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
</form> |
|||
</body> |
|||
</html> |
@ -1,240 +0,0 @@ |
|||
using CK.SCP.Controller; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using CK.SCP.Models.ScpEntity.ExcelExportEnttity; |
|||
using CK.SCP.Utils; |
|||
using FineUI; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Data; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Web; |
|||
using System.Web.UI; |
|||
using System.Web.UI.WebControls; |
|||
using CK.SCP.Models.Enums; |
|||
|
|||
|
|||
namespace SCP.Views.SupplierData |
|||
{ |
|||
public partial class SCP_FORECAST : PageBase |
|||
{ |
|||
/// <summary>
|
|||
/// 页面加载
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
LoadData(); |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 加载数据
|
|||
/// </summary>
|
|||
public void LoadData() |
|||
{ |
|||
BindData(); |
|||
} |
|||
/// <summary>
|
|||
/// 数据绑定
|
|||
/// </summary>
|
|||
public void BindData() |
|||
{ |
|||
SearchV_TB_FORECAST_Data((result) => |
|||
{ |
|||
Grid_V_TB_FORECAST.RecordCount = result.Count(); |
|||
var list = SortAndPage<V_TB_FORECAST>(result, Grid_V_TB_FORECAST); |
|||
Grid_V_TB_FORECAST.DataSource = list; |
|||
Grid_V_TB_FORECAST.DataBind(); |
|||
}); |
|||
} |
|||
/// <summary>
|
|||
/// 获取数据
|
|||
/// </summary>
|
|||
/// <param name="p_action"></param>
|
|||
public void SearchV_TB_FORECAST_Data(Action<IQueryable<V_TB_FORECAST>> p_action) |
|||
{ |
|||
V_TB_FORECAST _entity = new V_TB_FORECAST(); |
|||
_entity.IsDeleted = false; |
|||
if (!string.IsNullOrEmpty(TextPartCode.Text)) |
|||
{ |
|||
_entity.PartCode = TextPartCode.Text; |
|||
} |
|||
if (!string.IsNullOrEmpty(TextVendId.Text)) |
|||
{ |
|||
_entity.VendId = TextVendId.Text; |
|||
} |
|||
if (ddl_Day.SelectedValue != "0") |
|||
{ |
|||
_entity.Month = ddl_Day.SelectedValue; |
|||
} |
|||
_entity.UserInAddress = CurrentUser.FactoryList; |
|||
_entity.UserInVendIds = CurrentUser.VenderList; |
|||
if (!string.IsNullOrEmpty(DDL_State.SelectedValue)) |
|||
{ |
|||
_entity.BillStateList = new List<int>() { int.Parse(DDL_State.SelectedValue) }; |
|||
} |
|||
SCP_FORECAST_CONTROLLER.Get_V_TB_FORECAST_List(_entity, (_ret) => |
|||
{ |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
/// <summary>
|
|||
/// 查询
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnSearch_Click(object sender, EventArgs e) |
|||
{ |
|||
BindData(); |
|||
} |
|||
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
BindData(); |
|||
} |
|||
protected void Grid_V_TB_FORECAST_PageIndexChange(object sender, GridPageEventArgs e) |
|||
{ |
|||
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
BindData(); |
|||
} |
|||
/// <summary>
|
|||
/// 导入
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnInput_Click(object sender, EventArgs e) |
|||
{ |
|||
try |
|||
{ |
|||
string _fileName = FileUp.FileName; |
|||
if (string.IsNullOrEmpty(_fileName)) |
|||
{ |
|||
Alert.Show("选择文件为空!"); |
|||
return; |
|||
} |
|||
string _lx = _fileName.Split('.')[1]; |
|||
Stream _stream = FileUp.PostedFile.InputStream; |
|||
DataTable _dt = new DataTable(); |
|||
if (_lx == "xls") |
|||
{ |
|||
_dt = ExcelHelper.GetDataTable(_stream); |
|||
} |
|||
else |
|||
{ |
|||
_dt = ExcelHelper.GetDataTableOfXlsx(_stream); |
|||
} |
|||
var list = ConvertHelper.ToList<SCP_FORECAST_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList(); |
|||
var ret = SCP_FORECAST_CONTROLLER.EXCEL_FORECAST_MOD(list, CurrentUser.Name, CurrentUser.FactoryList[0]); |
|||
if (ret.State == ReturnStatus.Succeed && ret.Result == true) |
|||
{ |
|||
BindData(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(string.Join("<br>", ret.MessageList)); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
Alert.Show(ex.Message); |
|||
} |
|||
|
|||
} |
|||
/// <summary>
|
|||
/// 确认数据
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnSave_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray; |
|||
List<long> _UidList = new List<long>(); |
|||
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++) |
|||
{ |
|||
if (_selections.Contains(i)) |
|||
{ |
|||
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i]; |
|||
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
|||
{ |
|||
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
|||
} |
|||
} |
|||
} |
|||
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Confirm); |
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
BindData(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(ret.Message); |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 删除数据
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnDelete_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray; |
|||
List<long> _UidList = new List<long>(); |
|||
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++) |
|||
{ |
|||
if (_selections.Contains(i)) |
|||
{ |
|||
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i]; |
|||
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
|||
{ |
|||
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
|||
} |
|||
} |
|||
} |
|||
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Reject); |
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
BindData(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(ret.Message); |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 取消确认
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void BtnCancleSave_Click(object sender, EventArgs e) |
|||
{ |
|||
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray; |
|||
List<long> _UidList = new List<long>(); |
|||
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++) |
|||
{ |
|||
if (_selections.Contains(i)) |
|||
{ |
|||
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i]; |
|||
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
|||
{ |
|||
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
|||
} |
|||
} |
|||
} |
|||
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.New); |
|||
if (ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
BindData(); |
|||
} |
|||
else |
|||
{ |
|||
Alert.Show(ret.Message); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,204 +0,0 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.SupplierData { |
|||
|
|||
|
|||
public partial class SCP_FORECAST { |
|||
|
|||
/// <summary>
|
|||
/// form1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
|||
|
|||
/// <summary>
|
|||
/// Panel1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Panel Panel1; |
|||
|
|||
/// <summary>
|
|||
/// Toolbar1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Toolbar Toolbar1; |
|||
|
|||
/// <summary>
|
|||
/// ToolbarSeparator1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.ToolbarSeparator ToolbarSeparator1; |
|||
|
|||
/// <summary>
|
|||
/// btnRefresh 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnRefresh; |
|||
|
|||
/// <summary>
|
|||
/// btnSave 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnSave; |
|||
|
|||
/// <summary>
|
|||
/// btnCancleSave 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnCancleSave; |
|||
|
|||
/// <summary>
|
|||
/// btnDelete 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnDelete; |
|||
|
|||
/// <summary>
|
|||
/// FileUp 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.FileUpload FileUp; |
|||
|
|||
/// <summary>
|
|||
/// btnInput 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnInput; |
|||
|
|||
/// <summary>
|
|||
/// extForm1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Form extForm1; |
|||
|
|||
/// <summary>
|
|||
/// FormRow_2 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.FormRow FormRow_2; |
|||
|
|||
/// <summary>
|
|||
/// TextPartCode 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TextPartCode; |
|||
|
|||
/// <summary>
|
|||
/// TextVendId 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TextVendId; |
|||
|
|||
/// <summary>
|
|||
/// ddl_Day 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList ddl_Day; |
|||
|
|||
/// <summary>
|
|||
/// DDL_State 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList DDL_State; |
|||
|
|||
/// <summary>
|
|||
/// Button1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button Button1; |
|||
|
|||
/// <summary>
|
|||
/// Grid_V_TB_FORECAST 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid_V_TB_FORECAST; |
|||
|
|||
/// <summary>
|
|||
/// ToolbarSeparator2 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.ToolbarSeparator ToolbarSeparator2; |
|||
|
|||
/// <summary>
|
|||
/// ToolbarText1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.ToolbarText ToolbarText1; |
|||
|
|||
/// <summary>
|
|||
/// ddlGridPageSize 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList ddlGridPageSize; |
|||
} |
|||
} |
@ -1,87 +0,0 @@ |
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_FORECAST_REPORT.aspx.cs" Inherits="SCP.Views.沈阳金杯.Report.SCP_FORECAST_REPORT" %> |
|||
|
|||
<!DOCTYPE html> |
|||
|
|||
<html xmlns="http://www.w3.org/1999/xhtml"> |
|||
<head runat="server"> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
|||
<title></title> |
|||
</head> |
|||
<body> |
|||
<form id="form1" runat="server"> |
|||
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> |
|||
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> |
|||
<Items> |
|||
<f:Form runat="server"> |
|||
<Toolbars> |
|||
<f:Toolbar ID="Toolbar1" runat="server"> |
|||
<Items> |
|||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> |
|||
</f:ToolbarSeparator> |
|||
<f:Button ID="btnRefresh" runat="server" Text="刷新" EnablePostBack="True" Icon="Reload" OnClientClick="location.reload();"> |
|||
</f:Button> |
|||
<%--<f:Button ID="btnOutput" runat="server" Text="导出" Hidden="true" Icon="PageExcel"> |
|||
</f:Button>--%> |
|||
</Items> |
|||
</f:Toolbar> |
|||
</Toolbars> |
|||
</f:Form> |
|||
<f:Form BodyPadding="10px" Height="40px" ID="extForm1" runat="server" Title="" ShowHeader="false"> |
|||
<Rows> |
|||
<f:FormRow ColumnWidths="33% 33% 33% " ID="FormRow_1" runat="server"> |
|||
<Items> |
|||
<f:TextBox runat="server" Label="零件号" ID="TextPartCode"> |
|||
</f:TextBox> |
|||
<f:TextBox runat="server" Label="供应商编号" ID="TextVendId"> |
|||
</f:TextBox> |
|||
<f:DropDownList runat="server" ID="TextM" Label="订货月份"> |
|||
<f:ListItem Text="全部" Value="0" /> |
|||
<f:ListItem Text="一月" Value="1" /> |
|||
<f:ListItem Text="二月" Value="2" /> |
|||
<f:ListItem Text="三月" Value="3" /> |
|||
<f:ListItem Text="四月" Value="4" /> |
|||
<f:ListItem Text="五月" Value="5" /> |
|||
<f:ListItem Text="六月" Value="6" /> |
|||
<f:ListItem Text="七月" Value="7" /> |
|||
<f:ListItem Text="八月" Value="8" /> |
|||
<f:ListItem Text="九月" Value="9" /> |
|||
<f:ListItem Text="十月" Value="10" /> |
|||
<f:ListItem Text="十一月" Value="11" /> |
|||
<f:ListItem Text="十二月" Value="12" /> |
|||
</f:DropDownList> |
|||
<f:Button runat="server" ID="btnQuery" Text="查询" OnClick="btnSearch_Click"></f:Button> |
|||
</Items> |
|||
</f:FormRow> |
|||
</Rows> |
|||
</f:Form> |
|||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" |
|||
runat="server" DataKeyNames="PartCode,VendId,VendName,AskQty,MonthQty1,MonthQty2,MonthQty3,Month" |
|||
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_PageIndexChange" |
|||
AutoScroll="True" EnableRowDoubleClickEvent="True" > |
|||
<PageItems> |
|||
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server"> |
|||
</f:ToolbarSeparator> |
|||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:"> |
|||
</f:ToolbarText> |
|||
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" |
|||
runat="server"> |
|||
<f:ListItem Text="100" Value="100" /> |
|||
<f:ListItem Text="200" Value="200" /> |
|||
</f:DropDownList> |
|||
</PageItems> |
|||
<Columns> |
|||
<f:BoundField runat="server" HeaderText="零件号" Width="150px" ColumnID="" DataField="PartCode" /> |
|||
<f:BoundField runat="server" HeaderText="供应商编号" Width="100px" ColumnID="" DataField="VendId" /> |
|||
<f:BoundField runat="server" HeaderText="供应商名称" Width="150px" ColumnID="" DataField="VendName" /> |
|||
<f:BoundField runat="server" HeaderText="订单要货数量" Width="100px" ColumnID="" DataField="AskQty" DataFormatString="{0:F0}"/> |
|||
<f:BoundField runat="server" HeaderText="N+1" Width="100px" ColumnID="" DataField="MonthQty1" DataFormatString="{0:F0}"/> |
|||
<f:BoundField runat="server" HeaderText="N+2" Width="100px" ColumnID="" DataField="MonthQty2" DataFormatString="{0:F0}"/> |
|||
<f:BoundField runat="server" HeaderText="N+3" Width="100px" ColumnID="" DataField="MonthQty3" DataFormatString="{0:F0}"/> |
|||
<f:BoundField runat="server" HeaderText="月份" Width="100px" ColumnID="" DataField="Month" /> |
|||
</Columns> |
|||
</f:Grid> |
|||
</Items> |
|||
</f:Panel> |
|||
</form> |
|||
</body> |
|||
</html> |
@ -1,105 +0,0 @@ |
|||
using CK.SCP.Controller; |
|||
using CK.SCP.Models.ScpEntity; |
|||
using FineUI; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web; |
|||
using System.Web.UI; |
|||
using System.Web.UI.WebControls; |
|||
|
|||
namespace SCP.Views.沈阳金杯.Report |
|||
{ |
|||
public partial class SCP_FORECAST_REPORT : PageBase |
|||
{ |
|||
/// <summary>
|
|||
/// 加载
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void Page_Load(object sender, EventArgs e) |
|||
{ |
|||
if (!IsPostBack) |
|||
{ |
|||
TextM.SelectedValue = DateTime.Now.Month.ToString(); |
|||
LoadData(); |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 加载数据
|
|||
/// </summary>
|
|||
public void LoadData() |
|||
{ |
|||
BindData(); |
|||
} |
|||
/// <summary>
|
|||
/// 数据绑定
|
|||
/// </summary>
|
|||
public void BindData() |
|||
{ |
|||
SearchV_FORECAST_REPORT_Data((result) => |
|||
{ |
|||
Grid1.RecordCount = result.Count(); |
|||
var list = SortAndPage(result, Grid1); |
|||
Grid1.DataSource = list; |
|||
Grid1.DataBind(); |
|||
}); |
|||
} |
|||
/// <summary>
|
|||
/// 查询数据
|
|||
/// </summary>
|
|||
/// <param name="p_action"></param>
|
|||
public void SearchV_FORECAST_REPORT_Data(Action<IQueryable<V_FORECAST_REPORT>> p_action) |
|||
{ |
|||
V_FORECAST_REPORT _entity = new V_FORECAST_REPORT(); |
|||
if (!string.IsNullOrEmpty(TextPartCode.Text)) |
|||
{ |
|||
_entity.PartCode = TextPartCode.Text; |
|||
} |
|||
if (!string.IsNullOrEmpty(TextPartCode.Text)) |
|||
{ |
|||
_entity.VendId = TextVendId.Text; |
|||
} |
|||
if (!string.IsNullOrEmpty(TextM.SelectedValue)) |
|||
{ |
|||
_entity.Month = int.Parse(TextM.SelectedValue); |
|||
} |
|||
SCP_REPORT_CONTROLLER.Get_V_SCP_FORECAST_REPORT_List( _entity, (_ret) => |
|||
{ |
|||
if (_ret.State == ReturnStatus.Succeed) |
|||
{ |
|||
p_action(_ret.Result); |
|||
} |
|||
}); |
|||
} |
|||
/// <summary>
|
|||
/// 查询事件
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void btnSearch_Click(object sender, EventArgs e) |
|||
{ |
|||
BindData(); |
|||
} |
|||
/// <summary>
|
|||
/// 分页条数change事件
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|||
{ |
|||
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
BindData(); |
|||
} |
|||
/// <summary>
|
|||
/// 页面索引change事件
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
protected void Grid_PageIndexChange(object sender, GridPageEventArgs e) |
|||
{ |
|||
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|||
BindData(); |
|||
} |
|||
} |
|||
} |
@ -1,150 +0,0 @@ |
|||
//------------------------------------------------------------------------------
|
|||
// <自动生成>
|
|||
// 此代码由工具生成。
|
|||
//
|
|||
// 对此文件的更改可能导致不正确的行为,如果
|
|||
// 重新生成代码,则所做更改将丢失。
|
|||
// </自动生成>
|
|||
//------------------------------------------------------------------------------
|
|||
|
|||
namespace SCP.Views.沈阳金杯.Report { |
|||
|
|||
|
|||
public partial class SCP_FORECAST_REPORT { |
|||
|
|||
/// <summary>
|
|||
/// form1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
|||
|
|||
/// <summary>
|
|||
/// Panel1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Panel Panel1; |
|||
|
|||
/// <summary>
|
|||
/// Toolbar1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Toolbar Toolbar1; |
|||
|
|||
/// <summary>
|
|||
/// ToolbarSeparator1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.ToolbarSeparator ToolbarSeparator1; |
|||
|
|||
/// <summary>
|
|||
/// btnRefresh 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnRefresh; |
|||
|
|||
/// <summary>
|
|||
/// extForm1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Form extForm1; |
|||
|
|||
/// <summary>
|
|||
/// FormRow_1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.FormRow FormRow_1; |
|||
|
|||
/// <summary>
|
|||
/// TextPartCode 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TextPartCode; |
|||
|
|||
/// <summary>
|
|||
/// TextVendId 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.TextBox TextVendId; |
|||
|
|||
/// <summary>
|
|||
/// TextM 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList TextM; |
|||
|
|||
/// <summary>
|
|||
/// btnQuery 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Button btnQuery; |
|||
|
|||
/// <summary>
|
|||
/// Grid1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.Grid Grid1; |
|||
|
|||
/// <summary>
|
|||
/// ToolbarSeparator2 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.ToolbarSeparator ToolbarSeparator2; |
|||
|
|||
/// <summary>
|
|||
/// ToolbarText1 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.ToolbarText ToolbarText1; |
|||
|
|||
/// <summary>
|
|||
/// ddlGridPageSize 控件。
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// 自动生成的字段。
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|||
/// </remarks>
|
|||
protected global::FineUI.DropDownList ddlGridPageSize; |
|||
} |
|||
} |
Loading…
Reference in new issue