|
|
@ -36,18 +36,19 @@ namespace SCP.SupplierData |
|
|
|
} |
|
|
|
} |
|
|
|
private void SetRoleRule() |
|
|
|
{ |
|
|
|
{ |
|
|
|
IsPriceVisible(Grid_V_TB_ASN_DETAIL, "价格"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void SearchV_TB_ASN_DETAILData(Action<IQueryable<V_TB_ASN_DETAIL>> p_action) |
|
|
|
{ |
|
|
|
V_TB_ASN_DETAIL _entity = new V_TB_ASN_DETAIL(); |
|
|
|
_entity.UserInAddress = CurrentUser.FactoryList; |
|
|
|
_entity.AsnBillNum= Request["AsnBillNum"]; |
|
|
|
SCP_ASN_CONTROLLER.Get_V_TB_ASN_DETAIL_List(_entity, (_ret) => { |
|
|
|
_entity.AsnBillNum = Request["AsnBillNum"]; |
|
|
|
SCP_ASN_CONTROLLER.Get_V_TB_ASN_DETAIL_List(_entity, (_ret) => |
|
|
|
{ |
|
|
|
if (_ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
p_action(_ret.Result); |
|
|
@ -60,7 +61,7 @@ namespace SCP.SupplierData |
|
|
|
V_TB_ASN _entity = new V_TB_ASN(); |
|
|
|
_entity.AsnBillNum = Request["AsnBillNum"]; |
|
|
|
_entity.UserInVendIds = CurrentUser.VenderList; |
|
|
|
_entity.UserInAddress= CurrentUser.FactoryList; |
|
|
|
_entity.UserInAddress = CurrentUser.FactoryList; |
|
|
|
SCP_ASN_CONTROLLER.Get_V_TB_ASN_List(_entity, (_ret) => |
|
|
|
{ |
|
|
|
if (_ret.State == ReturnStatus.Succeed) |
|
|
@ -76,7 +77,7 @@ namespace SCP.SupplierData |
|
|
|
TXT_VendName.Text = _result.VendName; |
|
|
|
DP_ReceiveTime.SelectedDate = _result.ReceiveTime; |
|
|
|
DP_ShipTime.SelectedDate = _result.ShipTime; |
|
|
|
TXT_StateDesc.Text = _result.State_DESC; |
|
|
|
TXT_StateDesc.Text = GetResourceKey(_result.State_DESC); |
|
|
|
if (_result.State == (int)AsnState.Ship) |
|
|
|
{ |
|
|
|
string la = GetCurrentLanguage(); |
|
|
@ -99,7 +100,8 @@ namespace SCP.SupplierData |
|
|
|
btnException2.Hidden = true; |
|
|
|
} |
|
|
|
} |
|
|
|
SCP_BARCODE_CONTROLLER.Get_TS_BARCODE_List(new TS_BARCODE() { BillNum= TXT_AsnBillNum.Text.Trim() }, retobj => { |
|
|
|
SCP_BARCODE_CONTROLLER.Get_TS_BARCODE_List(new TS_BARCODE() { BillNum = TXT_AsnBillNum.Text.Trim() }, retobj => |
|
|
|
{ |
|
|
|
if (retobj.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
if (retobj.Result.Count() > 0) |
|
|
@ -108,9 +110,9 @@ namespace SCP.SupplierData |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
this.btnCreateBarCode.Enabled = true; |
|
|
|
this.btnCreateBarCode.Enabled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
@ -118,7 +120,7 @@ namespace SCP.SupplierData |
|
|
|
public void BindDetail() |
|
|
|
{ |
|
|
|
string la = GetCurrentLanguage(); |
|
|
|
if (la =="CH") |
|
|
|
if (la == "CH") |
|
|
|
{ |
|
|
|
Button1.Hidden = true; |
|
|
|
btnCance2.Hidden = true; |
|
|
@ -128,7 +130,8 @@ namespace SCP.SupplierData |
|
|
|
btnSend.Hidden = true; |
|
|
|
btnCancel.Hidden = true; |
|
|
|
} |
|
|
|
SearchV_TB_ASN_DETAILData((ret) => { |
|
|
|
SearchV_TB_ASN_DETAILData((ret) => |
|
|
|
{ |
|
|
|
Grid_V_TB_ASN_DETAIL.RecordCount = ret.Count(); |
|
|
|
var list = SortAndPage<V_TB_ASN_DETAIL>(ret, Grid_V_TB_ASN_DETAIL); |
|
|
|
Grid_V_TB_ASN_DETAIL.DataSource = list; |
|
|
@ -142,7 +145,7 @@ namespace SCP.SupplierData |
|
|
|
for (int i = 0, count = Grid_V_TB_ASN_DETAIL.Rows.Count; i < count; i++) |
|
|
|
{ |
|
|
|
V_TB_ASN_DETAIL inv = new V_TB_ASN_DETAIL(); |
|
|
|
object[] rowDataKeys = Grid_V_TB_ASN_DETAIL.DataKeys[i]; |
|
|
|
object[] rowDataKeys = Grid_V_TB_ASN_DETAIL.DataKeys[i]; |
|
|
|
|
|
|
|
if (rowDataKeys[24] != null) |
|
|
|
{ |
|
|
@ -182,15 +185,15 @@ namespace SCP.SupplierData |
|
|
|
// inv.EndTime = DateTime.Parse(rowDataKeys[34].ToString());//到货截至日期
|
|
|
|
//}
|
|
|
|
inv.PoUnit = rowDataKeys[4].ToString();//采购单位
|
|
|
|
// if (rowDataKeys[6] != null)
|
|
|
|
// {
|
|
|
|
// inv.Price = decimal.Parse(rowDataKeys[6].ToString());//价格
|
|
|
|
// }
|
|
|
|
// if (rowDataKeys[34] != null)
|
|
|
|
//{
|
|
|
|
// inv.ReceivedPort_Desc = rowDataKeys[34].ToString();//收货口
|
|
|
|
//}
|
|
|
|
_ls.Add(inv); |
|
|
|
// if (rowDataKeys[6] != null)
|
|
|
|
// {
|
|
|
|
// inv.Price = decimal.Parse(rowDataKeys[6].ToString());//价格
|
|
|
|
// }
|
|
|
|
// if (rowDataKeys[34] != null)
|
|
|
|
//{
|
|
|
|
// inv.ReceivedPort_Desc = rowDataKeys[34].ToString();//收货口
|
|
|
|
//}
|
|
|
|
_ls.Add(inv); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -213,17 +216,17 @@ namespace SCP.SupplierData |
|
|
|
|
|
|
|
protected void btnCreate_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BindDetail(); |
|
|
|
} |
|
|
|
|
|
|
|
protected void btnEdit_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
var _asn=Session["Asn"] as V_TB_ASN; |
|
|
|
var _asn = Session["Asn"] as V_TB_ASN; |
|
|
|
if (_asn == null) |
|
|
|
{ |
|
|
|
Alert.Show(GetResourceKey("发货订单信息不能为空!")); |
|
|
|
Alert.Show(GetResourceKey("发货订单信息不能为空!")); |
|
|
|
} |
|
|
|
List<V_TB_ASN_DETAIL> _list = new List<V_TB_ASN_DETAIL>(); |
|
|
|
for (int i = 0, count = Grid_V_TB_ASN_DETAIL.Rows.Count; i < count; i++) |
|
|
@ -257,16 +260,16 @@ namespace SCP.SupplierData |
|
|
|
_entity.PartDesc2 = rowDataKeys[23] as string; |
|
|
|
_entity.AsnBillNum = rowDataKeys[24] as string; |
|
|
|
_entity.Qty = ConvertHelper.To<Decimal>(rowDataKeys[25]); |
|
|
|
_entity.VendBatch = rowDataKeys[26] as string; |
|
|
|
_entity.VendBatch = rowDataKeys[26] as string; |
|
|
|
_entity.Batch = rowDataKeys[28] as string; |
|
|
|
_entity.VendId = rowDataKeys[29] as string; |
|
|
|
System.Web.UI.WebControls.TextBox TXT_VenBatch = (System.Web.UI.WebControls.TextBox)row.FindControl("TXT_VenBatch"); |
|
|
|
System.Web.UI.WebControls.TextBox TXT_PackQty = (System.Web.UI.WebControls.TextBox)row.FindControl("TXT_PackQty"); |
|
|
|
System.Web.UI.WebControls.TextBox TXT_Qty = (System.Web.UI.WebControls.TextBox)row.FindControl("TXT_Qty"); |
|
|
|
System.Web.UI.WebControls.TextBox TXT_ProduceDate = (System.Web.UI.WebControls.TextBox)row.FindControl("TXT_ProduceDate"); |
|
|
|
_entity.VendBatch= TXT_VenBatch.Text; |
|
|
|
|
|
|
|
|
|
|
|
_entity.VendBatch = TXT_VenBatch.Text; |
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(TXT_ProduceDate.Text)) |
|
|
|
{ |
|
|
|
Alert.Show(GetResourceKey("包装量填写错误!")); |
|
|
@ -274,7 +277,7 @@ namespace SCP.SupplierData |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_entity.ProduceDate =DateTime.Parse(TXT_ProduceDate.Text); |
|
|
|
_entity.ProduceDate = DateTime.Parse(TXT_ProduceDate.Text); |
|
|
|
} |
|
|
|
_list.Add(_entity); |
|
|
|
} |
|
|
@ -285,14 +288,14 @@ namespace SCP.SupplierData |
|
|
|
{ |
|
|
|
Alert.Show(GetResourceKey("不是新建状态,不能保存信息!")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void btnRefresh_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -335,7 +338,7 @@ namespace SCP.SupplierData |
|
|
|
_entity.ProduceDate = ConvertHelper.To<DateTime>(rowDataKeys[27]); |
|
|
|
_entity.Batch = rowDataKeys[28] as string; |
|
|
|
_entity.VendId = rowDataKeys[29] as string; |
|
|
|
_entity.Guid=ConvertHelper.To<Guid>(rowDataKeys[29]); |
|
|
|
_entity.Guid = ConvertHelper.To<Guid>(rowDataKeys[29]); |
|
|
|
|
|
|
|
_list.Add(_entity); |
|
|
|
} |
|
|
@ -360,7 +363,7 @@ namespace SCP.SupplierData |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var result=SCP_BARCODE_CONTROLLER.Get_TB_PRINT_COUNT_List(new TB_PRINT_COUNT() { BillNo=_asn.AsnBillNum }); |
|
|
|
var result = SCP_BARCODE_CONTROLLER.Get_TB_PRINT_COUNT_List(new TB_PRINT_COUNT() { BillNo = _asn.AsnBillNum }); |
|
|
|
if (result.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
//if (result.Result.Count(p => p.PrintType == (int)PrintType.ASN) == 0)
|
|
|
@ -374,16 +377,16 @@ namespace SCP.SupplierData |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var check = SCP_ASN_CONTROLLER.Get_TS_UNI_API(_asn); |
|
|
|
if(check.State == ReturnStatus.Failed) |
|
|
|
if (check.State == ReturnStatus.Failed) |
|
|
|
{ |
|
|
|
Alert.Show(_asn.AsnBillNum + GetResourceKey("请勿重复提交数据!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
var ret = SCP_ASN_CONTROLLER.Save_TB_ASN_DETAIL(_asn, _list); |
|
|
|
if (ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
{ |
|
|
|
SET_ASN_STATE("发货成功", AsnState.Ship); |
|
|
|
GetV_TB_ASNData(); |
|
|
|
BindDetail(); |
|
|
@ -408,14 +411,14 @@ namespace SCP.SupplierData |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
private void SET_ASN_STATE(string p_msg, AsnState p_state) |
|
|
|
{ |
|
|
|
if (Session["Asn"] != null) |
|
|
|
{ |
|
|
|
var _ask = Session["Asn"] as V_TB_ASN; |
|
|
|
var ret = SCP_ASN_CONTROLLER.Save_TB_ASN_STATE(new List<string>() { _ask.AsnBillNum },p_state); |
|
|
|
var ret = SCP_ASN_CONTROLLER.Save_TB_ASN_STATE(new List<string>() { _ask.AsnBillNum }, p_state); |
|
|
|
if (ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
Alert.Show(GetResourceKey(p_msg)); |
|
|
@ -430,7 +433,7 @@ namespace SCP.SupplierData |
|
|
|
{ |
|
|
|
|
|
|
|
SET_ASN_STATE(GetResourceKey("发货单作废成功"), AsnState.Reject); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
|
|
@ -448,10 +451,10 @@ namespace SCP.SupplierData |
|
|
|
protected void CreateBarCode_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
btnCreateBarCode.Enabled = false; |
|
|
|
var _list=GetSelectedList(); |
|
|
|
var _list = GetSelectedList(); |
|
|
|
if (_list.Count > 0) |
|
|
|
{ |
|
|
|
var ret=SCP_ASN_CONTROLLER.Save_TB_CREATE_BARCODE(_list); |
|
|
|
var ret = SCP_ASN_CONTROLLER.Save_TB_CREATE_BARCODE(_list); |
|
|
|
if (ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
Alert.Show(GetResourceKey("条码创建成功!")); |
|
|
@ -460,8 +463,8 @@ namespace SCP.SupplierData |
|
|
|
{ |
|
|
|
btnCreateBarCode.Enabled = true; |
|
|
|
Alert.Show(string.Join("<BR>", ret.MessageList.ToArray())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected void btnBarCodeList_Click(object sender, EventArgs e) |
|
|
@ -479,28 +482,28 @@ namespace SCP.SupplierData |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void SelectedBarCode_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void btnPrint_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
string AsnBillNum = Request["AsnBillNum"]; |
|
|
|
var result = SCP_BARCODE_CONTROLLER.Get_TB_PRINT_COUNT_List(new TB_PRINT_COUNT() { BillNo = AsnBillNum }); |
|
|
|
if (result.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (result.Result.Count(p => p.PrintType == (int)PrintType.BAR_CODE) == 0) |
|
|
|
{ |
|
|
|
Alert.Show(AsnBillNum + GetResourceKey("标签未打印!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
var SubSite = SCP_BARCODE_CONTROLLER.GetBillNum(AsnBillNum); |
|
|
|
if (SubSite.State < 3) |
|
|
|
{ |
|
|
@ -517,21 +520,21 @@ namespace SCP.SupplierData |
|
|
|
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=SendBill&data=102&type=pdf&filename=SendBill.pdf&AsnBillNum={0}&open=\")", AsnBillNum); |
|
|
|
PageContext.RegisterStartupScript(str); |
|
|
|
} |
|
|
|
|
|
|
|
SCP_BARCODE_CONTROLLER.Save_TB_PRINT_COUNT(new TB_PRINT_COUNT() { BillNo = AsnBillNum, PrintType = (int)PrintType.ASN}); |
|
|
|
|
|
|
|
SCP_BARCODE_CONTROLLER.Save_TB_PRINT_COUNT(new TB_PRINT_COUNT() { BillNo = AsnBillNum, PrintType = (int)PrintType.ASN }); |
|
|
|
} |
|
|
|
|
|
|
|
protected void btnSelectedBarCode_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
string AsnBillNum = Request["AsnBillNum"]; |
|
|
|
var bacode= SCP_BARCODE_CONTROLLER.GetBacode(AsnBillNum); |
|
|
|
var bacode = SCP_BARCODE_CONTROLLER.GetBacode(AsnBillNum); |
|
|
|
if (bacode.Count() == 0) |
|
|
|
{ |
|
|
|
Alert.Show(AsnBillNum + GetResourceKey("标签未创建!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
var SubSite = SCP_BARCODE_CONTROLLER.GetBillNum(AsnBillNum); |
|
|
|
if (!string.IsNullOrEmpty(AsnBillNum)&&SubSite.Site=="CQBMPT") |
|
|
|
var SubSite = SCP_BARCODE_CONTROLLER.GetBillNum(AsnBillNum); |
|
|
|
if (!string.IsNullOrEmpty(AsnBillNum) && SubSite.Site == "CQBMPT") |
|
|
|
{ |
|
|
|
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=Material_CQ&data=101&type=pdf&filename=标签.pdf&AsnBillNum={0}&open=\")", AsnBillNum); |
|
|
|
PageContext.RegisterStartupScript(str); |
|
|
@ -542,15 +545,16 @@ namespace SCP.SupplierData |
|
|
|
PageContext.RegisterStartupScript(str); |
|
|
|
} |
|
|
|
SCP_BARCODE_CONTROLLER.Save_TB_PRINT_COUNT(new TB_PRINT_COUNT() { BillNo = AsnBillNum, PrintType = (int)PrintType.BAR_CODE }); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected void btnOutputPallet_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
#region 计算托盘数量和发货数量是否相等
|
|
|
|
|
|
|
|
SearchV_TB_ASN_DETAILData((ret) => { |
|
|
|
SearchV_TB_ASN_DETAILData((ret) => |
|
|
|
{ |
|
|
|
|
|
|
|
var _asn = Session["Asn"] as V_TB_ASN; |
|
|
|
if (_asn == null) |
|
|
@ -560,12 +564,13 @@ namespace SCP.SupplierData |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var _ls=SCP_ASN_CONTROLLER.Get_CAN_PALLET_QTY(ret.ToList()); |
|
|
|
var _ls = SCP_ASN_CONTROLLER.Get_CAN_PALLET_QTY(ret.ToList()); |
|
|
|
var _errList = new List<string>(); |
|
|
|
_ls.ForEach(p => { |
|
|
|
if(p.CanQty>0) |
|
|
|
_ls.ForEach(p => |
|
|
|
{ |
|
|
|
if (p.CanQty > 0) |
|
|
|
{ |
|
|
|
_errList.Add(string.Format("编号:{0}名称:{1},托盘数量总和小于发货单数量",p.PartCode,(p.PartDesc1+p.PartDesc2))); |
|
|
|
_errList.Add(string.Format("编号:{0}名称:{1},托盘数量总和小于发货单数量", p.PartCode, (p.PartDesc1 + p.PartDesc2))); |
|
|
|
} |
|
|
|
}); |
|
|
|
if (_errList.Count > 0) |
|
|
@ -627,7 +632,7 @@ namespace SCP.SupplierData |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void btnRepeat_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
var _asn = Session["Asn"] as V_TB_ASN; |
|
|
@ -677,11 +682,11 @@ namespace SCP.SupplierData |
|
|
|
GetV_TB_ASNData(); |
|
|
|
BindDetail(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Alert.Show(GetResourceKey( string.Join("\n\r", ret.MessageList.ToArray()))); |
|
|
|
Alert.Show(GetResourceKey(string.Join("\n\r", ret.MessageList.ToArray()))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|