You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
3.1 KiB
106 lines
3.1 KiB
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;
|
|
|
|
namespace SCP.Views.富维冲压件
|
|
{
|
|
public partial class SCP_PO_SUBPART : PageBase
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
BindData();
|
|
}
|
|
}
|
|
|
|
public void BindData()
|
|
{
|
|
|
|
SearchInvoice((ret) => {
|
|
Grid1.RecordCount = ret.Count();
|
|
var list = SortAndPage<V_TA_SubPartCode>(ret, Grid1);
|
|
var items = list.ToList();
|
|
Grid1.DataSource = items;
|
|
Grid1.DataSource = SCP_CONTRACT_CONTROLLER.GET_SUB_PART_LIST_CYJ(list.ToList());
|
|
Grid1.DataBind();
|
|
});
|
|
|
|
}
|
|
|
|
public void SearchInvoice(Action<IQueryable<V_TA_SubPartCode>> p_action)
|
|
{
|
|
V_TA_SubPartCode _entity = new V_TA_SubPartCode();
|
|
var partcode = Session["partcode"] as List<string>;
|
|
_entity.PartList = new List<string>();
|
|
foreach (var part in partcode)
|
|
{
|
|
_entity.PartList.Add(part);
|
|
}
|
|
|
|
SCP_INVOICE_CONTROLLER.Get_TA_SubPartCode(_entity, (ret) =>
|
|
{
|
|
if (ret.State == ReturnStatus.Succeed)
|
|
{
|
|
|
|
p_action(ret.Result);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
|
|
{
|
|
BindData();
|
|
}
|
|
|
|
protected void btnSearch_Click(object sender, EventArgs e)
|
|
{
|
|
BindData();
|
|
}
|
|
protected void Confirm_Click(object sender, EventArgs e)
|
|
{
|
|
if (Session["datatable"] != null)
|
|
{
|
|
var _dtt = Session["datatable"] as DataTable;
|
|
var list = ConvertHelper.ToList<SCP_PO_EXPORT_IMPORT_MODEL>(ExcelHelper.RemoveEmpty(_dtt)).ToList();
|
|
var ret = SCP_PO_CONTROLLER.EXCEL_PO_SUBMANY(_dtt, list, CurrentUser.Name, CurrentUser.FactoryList[0], CurrentUser.ChineseName);
|
|
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
|
|
{
|
|
Alert.Show("确认成功");
|
|
|
|
}
|
|
else
|
|
{
|
|
Alert.Show(string.Join("<br>", ret.MessageList));
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
Alert.Show("缓存已丢失,麻烦刷新页面重新操作");
|
|
}
|
|
|
|
|
|
//BindData();
|
|
}
|
|
protected void Cancel_Click(object sender, EventArgs e)
|
|
{
|
|
var ret = SCP_PO_CONTROLLER.Delete_Ta_Subpart();
|
|
Alert.Show("取消成功");
|
|
Close();
|
|
}
|
|
|
|
|
|
}
|
|
}
|