|
@ -135,7 +135,7 @@ namespace SCP.BasicData |
|
|
SearchV_TB_PRICEData((result) => |
|
|
SearchV_TB_PRICEData((result) => |
|
|
{ |
|
|
{ |
|
|
Grid1.RecordCount = result.Count(); |
|
|
Grid1.RecordCount = result.Count(); |
|
|
var list = SortAndPage<V_TB_PRICE>(result, Grid1); |
|
|
var list = SortAndPage(result, Grid1); |
|
|
|
|
|
|
|
|
Grid1.DataSource = list; |
|
|
Grid1.DataSource = list; |
|
|
Grid1.DataBind(); |
|
|
Grid1.DataBind(); |
|
@ -144,10 +144,22 @@ namespace SCP.BasicData |
|
|
//查询
|
|
|
//查询
|
|
|
protected void btnSearch_OnClick(object sender, EventArgs e) |
|
|
protected void btnSearch_OnClick(object sender, EventArgs e) |
|
|
{ |
|
|
{ |
|
|
BindData(); |
|
|
BindData1(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void SearchV_TB_PRICEData(Action<IQueryable<V_TB_PRICE>> p_action) |
|
|
public void BindData1() |
|
|
|
|
|
{ |
|
|
|
|
|
highlightRows.Text = ""; |
|
|
|
|
|
SearchV_TB_PRICEData1((result) => |
|
|
|
|
|
{ |
|
|
|
|
|
Grid1.RecordCount = result.Count(); |
|
|
|
|
|
var list = SortAndPage(result, Grid1); |
|
|
|
|
|
|
|
|
|
|
|
Grid1.DataSource = list; |
|
|
|
|
|
Grid1.DataBind(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
public void SearchV_TB_PRICEData1(Action<IQueryable<V_TB_PRICE>> p_action) |
|
|
{ |
|
|
{ |
|
|
V_TB_PRICE _entity = new V_TB_PRICE(); |
|
|
V_TB_PRICE _entity = new V_TB_PRICE(); |
|
|
if (!string.IsNullOrEmpty(textVendId.Text)) |
|
|
if (!string.IsNullOrEmpty(textVendId.Text)) |
|
@ -157,6 +169,88 @@ namespace SCP.BasicData |
|
|
if (!string.IsNullOrEmpty(textPartCode.Text)) |
|
|
if (!string.IsNullOrEmpty(textPartCode.Text)) |
|
|
{ |
|
|
{ |
|
|
_entity.PartCode = textPartCode.Text; |
|
|
_entity.PartCode = textPartCode.Text; |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(textVendName.Text)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.Extend3 = textVendName.Text; |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(textPartName.Text)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.PartName = textPartName.Text; |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(textCreator.Text)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.Creator = textCreator.Text; |
|
|
|
|
|
} |
|
|
|
|
|
if (DP_StartDate.SelectedDate != null) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.StartTime = DP_StartDate.SelectedDate; |
|
|
|
|
|
} |
|
|
|
|
|
if (DP_StartDate.SelectedDate != null && Date_EndDate.SelectedDate == null) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.EndTime = DateTime.Now; |
|
|
|
|
|
} |
|
|
|
|
|
if (DP_StartDate.SelectedDate == null && Date_EndDate.SelectedDate != null) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.StartTime = DateTime.Now; |
|
|
|
|
|
} |
|
|
|
|
|
if (Date_EndDate.SelectedDate != null) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.EndTime = Date_EndDate.SelectedDate; |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(DDL_State.SelectedValue)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.State = int.Parse(DDL_State.SelectedValue); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(NB_Amt.Text)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.Amt = decimal.Parse(NB_Amt.Text); |
|
|
|
|
|
} |
|
|
|
|
|
//_entity.Extend2 = !string.IsNullOrEmpty(DDL_Extend2.SelectedValue) ? DDL_Extend2.SelectedValue : string.Empty;
|
|
|
|
|
|
if (!string.IsNullOrEmpty(NB_Extend2.Text)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.Extend2 = NB_Extend2.Text; |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(NB_TemporaryPrice.Text)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.TemporaryPrice = int.Parse(NB_TemporaryPrice.Text); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(NB_SharingPrice.Text)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.SharingPrice = decimal.Parse(NB_SharingPrice.Text); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(factoryList.SelectedValue)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.SubSite = factoryList.SelectedValue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_entity.UserInAddress = CurrentUser.FactoryList; |
|
|
|
|
|
_entity.UserInVendIds = CurrentUser.VenderList; |
|
|
|
|
|
|
|
|
|
|
|
//_entity.UserInSubSite = CurrentUser.SubSiteList;
|
|
|
|
|
|
if (CurrentUser.RoleList.Contains("供应商") && CurrentUser.VenderList.Count == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
SCP_TB_PRICE_CONTROLLER.Get_TB_PRICE_List(ckb_Priec.Checked, _entity, (_ret) => |
|
|
|
|
|
{ |
|
|
|
|
|
if (_ret.State == ReturnStatus.Succeed) |
|
|
|
|
|
{ |
|
|
|
|
|
p_action(_ret.Result); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
Session["PriceSelect"] = "true"; |
|
|
|
|
|
} |
|
|
|
|
|
public void SearchV_TB_PRICEData(Action<IQueryable<V_TB_PRICE>> p_action) |
|
|
|
|
|
{ |
|
|
|
|
|
V_TB_PRICE _entity = new V_TB_PRICE(); |
|
|
|
|
|
if (!string.IsNullOrEmpty(textVendId.Text)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.VendId = textVendId.Text; |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(textPartCode.Text)) |
|
|
|
|
|
{ |
|
|
|
|
|
_entity.PartCode = textPartCode.Text; |
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrEmpty(textVendName.Text)) |
|
|
if (!string.IsNullOrEmpty(textVendName.Text)) |
|
|
{ |
|
|
{ |
|
@ -426,79 +520,154 @@ namespace SCP.BasicData |
|
|
public void BtnOutPut_OnClick(object sender, EventArgs e) |
|
|
public void BtnOutPut_OnClick(object sender, EventArgs e) |
|
|
{ |
|
|
{ |
|
|
// _list = SCP_TB_PRICE_CONTROLLER.Getlist();
|
|
|
// _list = SCP_TB_PRICE_CONTROLLER.Getlist();
|
|
|
SearchV_TB_PRICEData((result) => |
|
|
if (Session["PriceSelect"].ToString() == "true") |
|
|
{ |
|
|
{ |
|
|
var list = result.ToList(); |
|
|
SearchV_TB_PRICEData1((result) => |
|
|
Dictionary<string, string> cellheader = new Dictionary<string, string>(); |
|
|
|
|
|
string[] values = ckb1.SelectedValueArray; |
|
|
|
|
|
if (values.Contains("14")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Extend1", "状态"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("1")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("VendId", "供应商编号"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("2")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Extend3", "供应商名称"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("3")) |
|
|
|
|
|
{ |
|
|
{ |
|
|
cellheader.Add("PartCode", "零件编号"); |
|
|
var list = result.ToList(); |
|
|
} |
|
|
Dictionary<string, string> cellheader = new Dictionary<string, string>(); |
|
|
if (values.Contains("4")) |
|
|
string[] values = ckb1.SelectedValueArray; |
|
|
{ |
|
|
if (values.Contains("14")) |
|
|
cellheader.Add("PartName", "零件名称"); |
|
|
{ |
|
|
} |
|
|
cellheader.Add("Extend1", "状态"); |
|
|
if (values.Contains("5")) |
|
|
} |
|
|
{ |
|
|
if (values.Contains("1")) |
|
|
cellheader.Add("SubSite", "地点"); |
|
|
{ |
|
|
} |
|
|
cellheader.Add("VendId", "供应商编号"); |
|
|
if (values.Contains("6")) |
|
|
} |
|
|
{ |
|
|
if (values.Contains("2")) |
|
|
cellheader.Add("StartTime", "开始时间"); |
|
|
{ |
|
|
} |
|
|
cellheader.Add("Extend3", "供应商名称"); |
|
|
if (values.Contains("7")) |
|
|
} |
|
|
{ |
|
|
if (values.Contains("3")) |
|
|
cellheader.Add("EndTime", "结束时间"); |
|
|
{ |
|
|
} |
|
|
cellheader.Add("PartCode", "零件编号"); |
|
|
if (values.Contains("8")) |
|
|
} |
|
|
{ |
|
|
if (values.Contains("4")) |
|
|
cellheader.Add("Curr", "币种"); |
|
|
{ |
|
|
} |
|
|
cellheader.Add("PartName", "零件名称"); |
|
|
if (values.Contains("9")) |
|
|
} |
|
|
{ |
|
|
if (values.Contains("5")) |
|
|
cellheader.Add("Unit", "单位"); |
|
|
{ |
|
|
} |
|
|
cellheader.Add("SubSite", "地点"); |
|
|
if (values.Contains("10")) |
|
|
} |
|
|
{ |
|
|
if (values.Contains("6")) |
|
|
cellheader.Add("Amt", "零件基础价格"); |
|
|
{ |
|
|
} |
|
|
cellheader.Add("StartTime", "开始时间"); |
|
|
if (values.Contains("11")) |
|
|
} |
|
|
{ |
|
|
if (values.Contains("7")) |
|
|
cellheader.Add("Extend2", "是否临时价格"); |
|
|
{ |
|
|
} |
|
|
cellheader.Add("EndTime", "结束时间"); |
|
|
//if (values.Contains("12"))
|
|
|
} |
|
|
//{
|
|
|
if (values.Contains("8")) |
|
|
// cellheader.Add("Remarks", "备注");
|
|
|
{ |
|
|
//}
|
|
|
cellheader.Add("Curr", "币种"); |
|
|
if (values.Contains("13")) |
|
|
} |
|
|
{ |
|
|
if (values.Contains("9")) |
|
|
cellheader.Add("SharingPrice", "零件分摊单价"); |
|
|
{ |
|
|
} |
|
|
cellheader.Add("Unit", "单位"); |
|
|
if (values.Contains("15")) |
|
|
} |
|
|
|
|
|
if (values.Contains("10")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Amt", "零件基础价格"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("11")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Extend2", "是否临时价格"); |
|
|
|
|
|
} |
|
|
|
|
|
//if (values.Contains("12"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// cellheader.Add("Remarks", "备注");
|
|
|
|
|
|
//}
|
|
|
|
|
|
if (values.Contains("13")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("SharingPrice", "零件分摊单价"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("15")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Creator", "导入人员"); |
|
|
|
|
|
} |
|
|
|
|
|
string url = EntityListToExcel2003(cellheader, list, "价格信息"); |
|
|
|
|
|
}); |
|
|
|
|
|
// var list = Sort<TB_PRICE>(_list.AsQueryable(), Grid1).ToList();
|
|
|
|
|
|
// 2.设置单元格抬头
|
|
|
|
|
|
// key:实体对象属性名称,可通过反射获取值
|
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
SearchV_TB_PRICEData((result) => |
|
|
{ |
|
|
{ |
|
|
cellheader.Add("Creator", "导入人员"); |
|
|
var list = result.ToList(); |
|
|
} |
|
|
Dictionary<string, string> cellheader = new Dictionary<string, string>(); |
|
|
string url = EntityListToExcel2003(cellheader, list, "价格信息"); |
|
|
string[] values = ckb1.SelectedValueArray; |
|
|
}); |
|
|
if (values.Contains("14")) |
|
|
// var list = Sort<TB_PRICE>(_list.AsQueryable(), Grid1).ToList();
|
|
|
{ |
|
|
// 2.设置单元格抬头
|
|
|
cellheader.Add("Extend1", "状态"); |
|
|
// key:实体对象属性名称,可通过反射获取值
|
|
|
} |
|
|
// value:Excel列的名称
|
|
|
if (values.Contains("1")) |
|
|
|
|
|
{ |
|
|
} |
|
|
cellheader.Add("VendId", "供应商编号"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("2")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Extend3", "供应商名称"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("3")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("PartCode", "零件编号"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("4")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("PartName", "零件名称"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("5")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("SubSite", "地点"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("6")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("StartTime", "开始时间"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("7")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("EndTime", "结束时间"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("8")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Curr", "币种"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("9")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Unit", "单位"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("10")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Amt", "零件基础价格"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("11")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Extend2", "是否临时价格"); |
|
|
|
|
|
} |
|
|
|
|
|
//if (values.Contains("12"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// cellheader.Add("Remarks", "备注");
|
|
|
|
|
|
//}
|
|
|
|
|
|
if (values.Contains("13")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("SharingPrice", "零件分摊单价"); |
|
|
|
|
|
} |
|
|
|
|
|
if (values.Contains("15")) |
|
|
|
|
|
{ |
|
|
|
|
|
cellheader.Add("Creator", "导入人员"); |
|
|
|
|
|
} |
|
|
|
|
|
string url = EntityListToExcel2003(cellheader, list, "价格信息"); |
|
|
|
|
|
// var list = Sort<TB_PRICE>(_list.AsQueryable(), Grid1).ToList();
|
|
|
|
|
|
// 2.设置单元格抬头
|
|
|
|
|
|
// key:实体对象属性名称,可通过反射获取值
|
|
|
|
|
|
// value:Excel列的名称
|
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 确认
|
|
|
/// 确认
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
@ -590,12 +759,27 @@ namespace SCP.BasicData |
|
|
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e) |
|
|
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e) |
|
|
{ |
|
|
{ |
|
|
Grid1.PageIndex = e.NewPageIndex; |
|
|
Grid1.PageIndex = e.NewPageIndex; |
|
|
BindData(); |
|
|
if (Session["PriceSelect"].ToString() == "true") |
|
|
|
|
|
{ |
|
|
|
|
|
BindData1(); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
BindData(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e) |
|
|
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e) |
|
|
{ |
|
|
{ |
|
|
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|
|
|
|
|
BindData(); |
|
|
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
|
|
|
|
|
if (Session["PriceSelect"].ToString() == "true") |
|
|
|
|
|
{ |
|
|
|
|
|
BindData1(); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
BindData(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
protected void Grid1_OnSort(object sender, GridSortEventArgs e) |
|
|
protected void Grid1_OnSort(object sender, GridSortEventArgs e) |
|
|
{ |
|
|
{ |
|
|