Browse Source

沈阳代码合并

master
lvzb 4 years ago
parent
commit
106c31a7f0
  1. 1
      Controller/CK.SCP.Controller.csproj
  2. 667
      Controller/SCP_ASK_CONTROLLER.cs
  3. 477
      Controller/SCP_ASN_CONTROLLER.cs
  4. 7
      Controller/SCP_BARCODE_CONTROLLER.cs
  5. 9
      Controller/SCP_BILLCODE_CONTROLLER.cs
  6. 84
      Controller/SCP_EXCEL_CONTROLLER.cs
  7. 164
      Controller/SCP_FORECAST_CONTROLLER.cs
  8. 388
      Controller/SCP_INVOICE_CONTROLLER.cs
  9. 524
      Controller/SCP_MoldSharing_Controller.cs
  10. 158
      Controller/SCP_PO_CONTROLLER.cs
  11. 403
      Controller/SCP_RECEIVE_CONTROLLER.cs
  12. 117
      Controller/SCP_REJECT_CONTROLLER.cs
  13. 236
      Controller/SCP_REPORT_CONTROLLER.cs
  14. 1
      Controller/SCP_TB_PRICE_CONTROLLER.cs
  15. 82
      Controller/SCP_TB_VENDER_CONTROLLER.cs
  16. 105
      Controller/SCP_TS_BARCODE_CONTROLLER.cs
  17. 92
      Controller/SCP_WMS_CONTROLLER.cs
  18. 49
      Controller/UniApiController.cs
  19. 7
      Models/CK.SCP.Models.csproj
  20. 20
      Models/ScpEntities.cs
  21. 9
      Models/ScpEntity/ExcelExportEnttity/SCP_FORECAST_EXPORT.cs
  22. 17
      Models/ScpEntity/ExcelExportEnttity/SCP_MOLDSHARING_EXPORT.cs
  23. 22
      Models/ScpEntity/ExcelExportEnttity/SCP_OTD_VendId_REPORT_EXPORT.cs
  24. 23
      Models/ScpEntity/ExcelImportEntity/SCP_ASN_EXCEL.cs
  25. 10
      Models/ScpEntity/ExcelImportEntity/SCP_PO_EXCEL.cs
  26. 31
      Models/ScpEntity/TA_MOLDSHARING_INVOICE.cs
  27. 34
      Models/ScpEntity/TA_MoldSharing.cs
  28. 49
      Models/ScpEntity/TB_FORECAST.cs
  29. 2
      Models/ScpEntity/TB_INVOICE_DETAIL.cs
  30. 5
      Models/ScpEntity/TS_BARCODE.cs
  31. 4
      Models/ScpEntity/V_TB_ASK.cs
  32. 5
      Models/ScpEntity/V_TB_ASN_DETAIL.cs
  33. 28
      Models/ScpEntity/V_TB_FORECAST.cs
  34. 1
      Models/ScpEntity/V_TB_INCOMPLETE_ASK.cs
  35. 2
      Models/ScpEntity/V_TB_INVOICE.cs
  36. 2
      Models/ScpEntity/V_TB_INVOICE_DETAIL.cs
  37. 6
      Models/ScpEntity/V_TB_RECEIVE.cs
  38. 2
      Models/ScpEntity/V_TB_RECEIVE_DETAIL.cs
  39. 1
      Models/ScpEntity/V_TB_RECEIVE_LIST.cs
  40. 48
      Models/ScpEntity/V_TS_BARCODE.cs
  41. 37
      Models/WmsEntity/VIEW_STOCK_REPORT.cs
  42. 1
      Models/WmsEntity/WmsEntities.cs
  43. 54
      SCP/Admin/UNIAPI.aspx
  44. 88
      SCP/Admin/UNIAPI.aspx.cs
  45. 78
      SCP/Admin/UNIAPI.aspx.designer.cs
  46. 15
      SCP/Business/PageBase.cs
  47. 60
      SCP/Common/MailHelper.cs
  48. 140
      SCP/SCP.csproj
  49. 76
      SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx
  50. 88
      SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx.cs
  51. 134
      SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx.designer.cs
  52. 92
      SCP/Views/BasicData/SCP_MoldSharing.aspx
  53. 175
      SCP/Views/BasicData/SCP_MoldSharing.aspx.cs
  54. 73
      SCP/Views/BasicData/SCP_MoldSharing.aspx.designer.cs
  55. 17
      SCP/Views/BasicData/Supplier.aspx
  56. 44
      SCP/Views/BasicData/Supplier.aspx.cs
  57. 33
      SCP/Views/BasicData/Supplier.aspx.designer.cs
  58. 9
      SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx
  59. 39
      SCP/Views/PlanData/SCP_PO.aspx
  60. 2
      SCP/Views/PlanData/SCP_PO.aspx.cs
  61. 12
      SCP/Views/PlanData/SCP_PO.aspx.designer.cs
  62. 1
      SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx
  63. 8
      SCP/Views/PlanData/SCP_PO_DETAIL_OUT.aspx
  64. 3
      SCP/Views/SupplierData/SCP_INVOICE.aspx
  65. 16
      SCP/Views/SupplierData/SCP_INVOICE.aspx.cs
  66. 32
      SCP/Views/SupplierData/SCP_INVOICE_CREATE.aspx.cs
  67. 35
      SCP/Views/SupplierData/SCP_INVOICE_EDIT.aspx.cs
  68. 26
      SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx
  69. 19
      SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.cs
  70. 60
      SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.designer.cs
  71. 35
      SCP/Views/SupplierData/SCP_TS_BARCODE.aspx
  72. 63
      SCP/Views/SupplierData/SCP_TS_BARCODE.aspx.cs
  73. 42
      SCP/Views/SupplierData/SCP_TS_BARCODE.aspx.designer.cs
  74. 3
      SCP/Views/WarehouseData/SCP_INVOICE.aspx
  75. 2
      SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM.aspx
  76. 4
      SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM.aspx.cs
  77. 2
      SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx
  78. 9
      SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx.cs
  79. 4
      SCP/Views/WarehouseData/SCP_INVOICE_DELTAIL.aspx
  80. 25
      SCP/Views/WarehouseData/SCP_RECEIVE.aspx
  81. 12
      SCP/Views/WarehouseData/SCP_RECEIVE.aspx.cs
  82. 42
      SCP/Views/WarehouseData/SCP_RECEIVE.aspx.designer.cs
  83. 21
      SCP/Views/WarehouseData/SCP_RECEIVE_DETAIL.aspx
  84. 63
      SCP/Views/沈阳金杯/PlanData/SCP_ASK.aspx
  85. 77
      SCP/Views/沈阳金杯/PlanData/SCP_ASK.aspx.cs
  86. 54
      SCP/Views/沈阳金杯/PlanData/SCP_ASK.aspx.designer.cs
  87. 61
      SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL.aspx
  88. 180
      SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL.aspx.cs
  89. 63
      SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL.aspx.designer.cs
  90. 91
      SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL_PARTCODE.aspx
  91. 244
      SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL_PARTCODE.aspx.cs
  92. 125
      SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL_PARTCODE.aspx.designer.cs
  93. 55
      SCP/Views/沈阳金杯/PlanData/SCP_ASN.aspx
  94. 48
      SCP/Views/沈阳金杯/PlanData/SCP_ASN.aspx.cs
  95. 36
      SCP/Views/沈阳金杯/PlanData/SCP_ASN.aspx.designer.cs
  96. 101
      SCP/Views/沈阳金杯/PlanData/SCP_FORECAST.aspx
  97. 245
      SCP/Views/沈阳金杯/PlanData/SCP_FORECAST.aspx.cs
  98. 82
      SCP/Views/沈阳金杯/PlanData/SCP_FORECAST.aspx.designer.cs
  99. 52
      SCP/Views/沈阳金杯/PlanData/SCP_PRODUCT_DETAIL.aspx
  100. 102
      SCP/Views/沈阳金杯/PlanData/SCP_PRODUCT_DETAIL.aspx.cs

1
Controller/CK.SCP.Controller.csproj

@ -59,6 +59,7 @@
<Compile Include="SCP_BARCODE_CONTROLLER _SYJB.cs" /> <Compile Include="SCP_BARCODE_CONTROLLER _SYJB.cs" />
<Compile Include="SCP_DC_UNI_CONTROLLER.cs" /> <Compile Include="SCP_DC_UNI_CONTROLLER.cs" />
<Compile Include="SCP_FORECAST_CONTROLLER.cs" /> <Compile Include="SCP_FORECAST_CONTROLLER.cs" />
<Compile Include="SCP_MoldSharing_Controller.cs" />
<Compile Include="SCP_PALLET_CONTROLLER.cs" /> <Compile Include="SCP_PALLET_CONTROLLER.cs" />
<Compile Include="SCP_PLAN_CONTROLLER.cs" /> <Compile Include="SCP_PLAN_CONTROLLER.cs" />
<Compile Include="SCP_QUALITY_CONTROLLER.cs" /> <Compile Include="SCP_QUALITY_CONTROLLER.cs" />

667
Controller/SCP_ASK_CONTROLLER.cs

File diff suppressed because it is too large

477
Controller/SCP_ASN_CONTROLLER.cs

@ -14,6 +14,7 @@ using System.Data.Entity.Core;
using CK.SCP.Models.AppBoxEntity; using CK.SCP.Models.AppBoxEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity; using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using System.Data.SqlClient; using System.Data.SqlClient;
using CK.SCP.Models.ScpEntity.ExcelImportEntity;
namespace CK.SCP.Controller namespace CK.SCP.Controller
{ {
@ -308,6 +309,72 @@ namespace CK.SCP.Controller
throw e; throw e;
} }
} }
public static void Get_V_TB_ASN_DETAIL_MODIFY(V_TB_ASN_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_ASN_DETAIL>>> p_action)
{
ResultObject<IQueryable<V_TB_ASN_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_ASN_DETAIL>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TB_ASN_DETAIL> q = db.V_TB_ASN_DETAIL;
if (p_entity.UID!=0)
{
q = q.Where(p => p.UID==p_entity.UID);
}
if (p_entity.IsDeleted != false)
{
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
}
_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_ASN_CONTROLLER), "Get_V_TB_ASN_DETAIL_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_ASN_CONTROLLER), "Get_V_TB_ASN_DETAIL_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_ASN_CONTROLLER), "Get_V_TB_ASN_DETAIL_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_ASN_CONTROLLER), "Get_V_TB_ASN_DETAIL_List", e.Message);
throw e;
}
}
public static void Get_V_TB_ASN_DETAIL_List(V_TB_ASN_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_ASN_DETAIL>>> p_action) public static void Get_V_TB_ASN_DETAIL_List(V_TB_ASN_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_ASN_DETAIL>>> p_action)
{ {
ResultObject<IQueryable<V_TB_ASN_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_ASN_DETAIL>>(); ResultObject<IQueryable<V_TB_ASN_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_ASN_DETAIL>>();
@ -471,6 +538,112 @@ namespace CK.SCP.Controller
} }
public static ResultObject<bool> Save_TB_ASN_DETAIL_MODIFY(V_TB_ASN_DETAIL p_asn,string p_state)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var _ls = db.TB_ASN_DETAIL.FirstOrDefault(p => p.UID==p_asn.UID);
if (p_state == "Modify")
{
if (_ls != null)
{
_ls.ProduceDate = p_asn.ProduceDate;
_ls.PackQty = p_asn.PackQty;
_ls.Qty = p_asn.Qty;
_ls.VendBatch = p_asn.VendBatch;
db.TB_ASN_DETAIL.AddOrUpdate(_ls);
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "数据不存在!";
}
}
if (p_state == "Delete")
{
if (_ls != null)
{
_ls.State =(int)AsnState.Reject;
_ls.IsDeleted = true;
db.TB_ASN_DETAIL.AddOrUpdate(_ls);
}
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_ASN_CONTROLLER), "Save_TB_ASN_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_ASN_CONTROLLER), "Save_TB_ASN_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_ASN_CONTROLLER), "Save_TB_ASN_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_ASN_CONTROLLER), "Save_TB_ASN_STATE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
public static ResultObject<bool> Save_TB_ASN_STATE(List<string> p_list, AsnState p_state) public static ResultObject<bool> Save_TB_ASN_STATE(List<string> p_list, AsnState p_state)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
@ -817,7 +990,8 @@ namespace CK.SCP.Controller
List<V_ARRIVE_PRINT_DETAIL> _lsDetail = new List<V_ARRIVE_PRINT_DETAIL>(); List<V_ARRIVE_PRINT_DETAIL> _lsDetail = new List<V_ARRIVE_PRINT_DETAIL>();
var _ls = retobj.Result.ToList(); var _ls = retobj.Result.ToList();
_ls.ForEach(p => { _ls.ForEach(p => {
if (p.Qty > 0)
{
V_ARRIVE_PRINT_DETAIL _detail = new V_ARRIVE_PRINT_DETAIL(); V_ARRIVE_PRINT_DETAIL _detail = new V_ARRIVE_PRINT_DETAIL();
_detail.PartNo = p.PartCode; _detail.PartNo = p.PartCode;
_detail.PartDesc = p.PartDesc1; _detail.PartDesc = p.PartDesc1;
@ -826,7 +1000,14 @@ namespace CK.SCP.Controller
_detail.Boxes = (Math.Truncate((p.Qty / p.PackQty)) + (((p.Qty % p.PackQty) > 0) ? 1 : 0)).ToString(); _detail.Boxes = (Math.Truncate((p.Qty / p.PackQty)) + (((p.Qty % p.PackQty) > 0) ? 1 : 0)).ToString();
_detail.DeliverQty = p.Qty.ToString(); _detail.DeliverQty = p.Qty.ToString();
_detail.ReceiveQty = p.Qty.ToString(); _detail.ReceiveQty = p.Qty.ToString();
_detail.PoNo = _print.DeliveryNo+"("+p.PoBillNum+")"; if (p.Site == "0210")
{
_detail.PoNo = p.AskBillNum + "(" + p.PoBillNum + ")";
}
else
{
_detail.PoNo = _print.DeliveryNo + "(" + p.PoBillNum + ")";
}
_detail.LineNO = p.PoLine.ToString(); _detail.LineNO = p.PoLine.ToString();
_detail.Memo = p.Remark; _detail.Memo = p.Remark;
_detail.DockCode = p.DockCode; _detail.DockCode = p.DockCode;
@ -844,6 +1025,7 @@ namespace CK.SCP.Controller
// stdtemp +=_detail.Boxes; // stdtemp +=_detail.Boxes;
stdtemp += Convert.ToDecimal( _detail.Boxes); stdtemp += Convert.ToDecimal( _detail.Boxes);
_lsDetail.Add(_detail); _lsDetail.Add(_detail);
}
}); });
ds.Tables[0].Rows[0]["STDCOUNT"] = stdtemp.ToString(); ds.Tables[0].Rows[0]["STDCOUNT"] = stdtemp.ToString();
var tb = ConvertHelper.ToDataTable(_lsDetail); var tb = ConvertHelper.ToDataTable(_lsDetail);
@ -2589,10 +2771,293 @@ namespace CK.SCP.Controller
} }
return _ret; return _ret;
} }
/// <summary>
/// 数据导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="p_creator"></param>
/// <param name="p_buyer"></param>
/// <param name="p_site"></param>
/// <param name="p_time"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_ASN(List<SCP_ASN_EXCEL> p_order_list, string p_creator, string p_buyer, string p_site, DateTime p_time)
{
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>();
p_order_list.ForEach
(p =>
{
var _ls = CheckExcel(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
{
var GroupList = p_order_list.GroupBy(p => new { p., p., p., p., p., p. }).Select(p => new { = p.Sum(itm => decimal.Parse(itm.)), = p.Key., = p.Key., p.Key., p.Key., p.Key., p.Key. }).ToList();
var OrderList = GroupList.GroupBy(p => p.).ToList();
OrderList.ForEach((p) =>
{
var list_distinct = p.GroupBy(t => new { t., t. }).ToList();
var list = p.ToList();
if (list_distinct.Count < list.Count)
{
_ret.MessageList.Add("相同组号,存在同一编号、行号的数据");
return;
}
if (list.Count > 0)
{
var _entity = list.FirstOrDefault();
TB_ASK _ask = new TB_ASK();
_ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode();
_ask.State = (int)AskState.Receive;
_ask.PoBillNum = _entity..ToUpper();
_ask.ModType = (int)BillModType.Contract;
_ask.Site = p_site;
_ask.BeginTime = p_time;
_ask.Buyer = p_creator;
_ask.BuyerPhone = "";
_ask.ErpBillNum = _entity..ToUpper();
_ask.EndTime = p_time;
_ask.CreateTime = p_time;
_ask.CreateUser = p_creator;
_ask.VendId = _entity..ToUpper();
_ask.GUID = Guid.NewGuid();
_ask.IsDeleted = false;
db.TB_ASK.Add(_ask);
TB_ASN _asn = new TB_ASN();
_asn.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode();
_asn.AskBillNum = _ask.AskBillNum;
_asn.VendId = _entity..ToUpper(); ;
_asn.State = (int)AsnState.Receive;
_asn.PoBillNum = _entity..ToUpper();
_asn.Site = p_site;
_asn.CreateTime = p_time;
_asn.CreateUser = p_creator;
_asn.UpdateTime = p_time;
_asn.UpdateUser = p_creator;
_asn.ShipTime = p_time;
_asn.ShipUser = p_creator;
_asn.ReceiveTime = p_time;
_asn.ReceiveUser = p_creator;
_asn.GUID = Guid.NewGuid();
_asn.IsDeleted = false;
db.TB_ASN.Add(_asn);
list.ForEach((itm) =>
{
TB_ASK_DETAIL _t_ASK_Detail = new TB_ASK_DETAIL();
_t_ASK_Detail.PoLine = Int32.Parse(itm.);
_t_ASK_Detail.Currency = "";
_t_ASK_Detail.AskBillNum = _ask.AskBillNum;
_t_ASK_Detail.PoBillNum = _ask.PoBillNum;
_t_ASK_Detail.PoUnit = itm.;
_t_ASK_Detail.CreateTime = DateTime.Now;
_t_ASK_Detail.CreateUser = _ask.CreateUser;
_t_ASK_Detail.PartCode = itm..ToUpper();
_t_ASK_Detail.BeginTime = p_time;
_t_ASK_Detail.EndTime = p_time;
_t_ASK_Detail.TempQty = itm.;
_t_ASK_Detail.AskQty = itm.;
_t_ASK_Detail.IsDeleted = false;
_t_ASK_Detail.LocUnit = itm.;
_t_ASK_Detail.UnConv = 1;
_t_ASK_Detail.State = _ask.State;
_t_ASK_Detail.Price = string.IsNullOrEmpty(itm.) ? 0 : decimal.Parse(itm.);
_t_ASK_Detail.GUID = Guid.NewGuid();
db.TB_ASK_DETAIL.Add(_t_ASK_Detail);
TB_ASN_DETAIL _t_ASN_Detail = new TB_ASN_DETAIL();
_t_ASN_Detail.AsnBillNum = _asn.AsnBillNum;
_t_ASN_Detail.PoLine = Int32.Parse(itm.);
_t_ASN_Detail.Currency = "";
_t_ASN_Detail.PoBillNum = _asn.PoBillNum;
_t_ASN_Detail.PoUnit = itm.;
_t_ASN_Detail.CreateTime = DateTime.Now;
_t_ASN_Detail.CreateUser = _asn.CreateUser;
_t_ASN_Detail.PartCode = itm..ToUpper();
_t_ASN_Detail.Batch = p_time.ToString("yyyyMMdd");
_t_ASN_Detail.VendBatch = p_time.ToString("yyyyMMdd");
_t_ASN_Detail.Qty = itm.;
_t_ASN_Detail.State = (int)AsnState.Receive;
_t_ASN_Detail.CreateTime = p_time;
_t_ASN_Detail.CreateUser = p_creator;
_t_ASN_Detail.IsDeleted = false;
_t_ASN_Detail.GUID = Guid.NewGuid();
_t_ASN_Detail.PoUnit = itm.;
_t_ASN_Detail.ProduceDate = p_time;
db.TB_ASN_DETAIL.Add(_t_ASN_Detail);
var _reclist = p_order_list.Where(t => t. == itm. && t. == itm. && t. == itm.).GroupBy(t => t.).ToList();
_reclist.ForEach((q) =>
{
var reclist = q.FirstOrDefault();
TB_RECEIVE _rec = new TB_RECEIVE();
_rec.RecvBillNum = reclist.;
_rec.State = (int)FormState.;
_rec.Remark = _ask.AskBillNum;
_rec.CreateTime = p_time;
_rec.CreateUser = p_creator;
_rec.IsDeleted = false;
_rec.GUID = System.Guid.NewGuid();
_rec.BillType = 0;
_rec.PoBillNum = reclist..ToUpper();
_rec.AsnBillNum = reclist..ToUpper();
_rec.Site = p_site;
_rec.VendId = reclist..ToUpper();
_rec.ShipTime = p_time;
db.TB_RECEIVE.Add(_rec);
var _recdetaillist = p_order_list.Where(f => f. == reclist.).ToList();
_recdetaillist.ForEach((n) =>
{
TB_RECEIVE_DETAIL _t_RECEIVE_Detail = new TB_RECEIVE_DETAIL();
_t_RECEIVE_Detail.RecvBillNum = n.;
_t_RECEIVE_Detail.PoBillNum = n..ToUpper();
_t_RECEIVE_Detail.PoLine = Int32.Parse(n.);
_t_RECEIVE_Detail.PartCode = n..ToUpper();
_t_RECEIVE_Detail.Batch = n.;
_t_RECEIVE_Detail.VendBatch = n.;
_t_RECEIVE_Detail.PoUnit = n.;
_t_RECEIVE_Detail.LocUnit = "";
_t_RECEIVE_Detail.Qty = decimal.Parse(n.);
_t_RECEIVE_Detail.State = (int)FormState.;
_t_RECEIVE_Detail.Remark = _ask.AskBillNum;
_t_RECEIVE_Detail.CreateTime = p_time;
_t_RECEIVE_Detail.CreateUser = p_creator;
_t_RECEIVE_Detail.IsDeleted = false;
_t_RECEIVE_Detail.GUID = System.Guid.NewGuid();
_t_RECEIVE_Detail.BillType = 0;
db.TB_RECEIVE_DETAIL.Add(_t_RECEIVE_Detail);
});
});
});
} }
else
{
_ret.MessageList.Add("请检查数据后,重新导入!");
return;
}
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_ASN_CONTROLLER), "EXCEL_ASN", 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_ASN_CONTROLLER), "EXCEL_ASN", 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_ASN_CONTROLLER), "EXCEL_ASN", 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_ASN_CONTROLLER), "EXCEL_ASN", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
private static List<string> CheckExcel(ScpEntities db, SCP_ASN_EXCEL p_excel)
{
List<string> ErrorList = new List<string>();
if (!string.IsNullOrEmpty(p_excel.))
{
int count = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel.&&p.PartCode== p_excel.&&p.PoLine== Int32.Parse( p_excel.));
if (count == 0)
{
ErrorList.Add(string.Format("订单编号{0}零件号{1}行号{2}不存在!", p_excel.,p_excel., p_excel.));
}
}
else
{
ErrorList.Add(string.Format("订单编号为空!"));
}
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.))
{
ErrorList.Add(string.Format("收货单号【{1}】零件号【{0}】有填写为空!", p_excel., p_excel.));
}
return ErrorList;
}
}
} }

7
Controller/SCP_BARCODE_CONTROLLER.cs

@ -267,6 +267,10 @@ namespace CK.SCP.Controller
{ {
q = q.Where(p => p.LocUnit.Contains(p_entity.LocUnit)); q = q.Where(p => p.LocUnit.Contains(p_entity.LocUnit));
} }
if (p_entity.IsScanned)
{
q = q.Where(p => p.IsScanned==false);
}
//if (!string.IsNullOrEmpty(p_entity.PartName)) //if (!string.IsNullOrEmpty(p_entity.PartName))
//{ //{
// q = q.Where(p => p.PartName.Contains(p_entity.PartName)); // q = q.Where(p => p.PartName.Contains(p_entity.PartName));
@ -648,7 +652,8 @@ namespace CK.SCP.Controller
State = 0, State = 0,
Remark = p_entity.UpdateInfo, Remark = p_entity.UpdateInfo,
PackQty = p_entity.PackQty, PackQty = p_entity.PackQty,
Site = p_entity.Site Site = p_entity.Site,
IsScanned = false
}; };

9
Controller/SCP_BILLCODE_CONTROLLER.cs

@ -66,7 +66,16 @@ namespace CK.SCP.Controller
return GetTablePK("E", "TB_ASK", "AskBillNum", "yyMMdd", 4); return GetTablePK("E", "TB_ASK", "AskBillNum", "yyMMdd", 4);
} }
/// <summary>
/// 生成收货单码
/// </summary>
/// <returns></returns>
public static string MakeReviceCode_ASN()
{
return GetTablePK("C", "TB_RECEIVE", "RecvBillNum", "yyMMdd", 4);
}
public static string MakePLAN_EXTEND_ASKCode() public static string MakePLAN_EXTEND_ASKCode()
{ {

84
Controller/SCP_EXCEL_CONTROLLER.cs

@ -161,8 +161,62 @@ namespace CK.SCP.Controller
} }
public static DataSet GET_OTD_VendId_REPORT_EXECEL(List<SCP_OTD_EXPORT> p_lst)
{
DataSet _ds = new DataSet();
var _exportList = new List<SCP_OTD_VendId_REPORT_EXPORT>();
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
p_lst.ForEach(itm =>
{
SCP_OTD_VendId_REPORT_EXPORT _entity = new SCP_OTD_VendId_REPORT_EXPORT();
_entity. = itm.AskBillNum;
_entity. = itm.VendId;
_entity. = itm.VendName;
_entity. = Convert.ToDateTime(itm.EndTime).ToString("yyyy/MM/dd");
_entity. = itm.AskQty.ToString();
_entity. = itm.ArriveQty.ToString();
_entity. = itm.Qty.ToString();
_entity. = itm.NntimelyQty.ToString();
_entity. = itm.OTD.ToString();
_entity. = itm.ArriveOTD.ToString();
_exportList.Add(_entity);
});
var _dt = ConvertHelper.ToDataTable(_exportList);
_ds.Tables.Add(_dt);
}
return _ds;
}
public static DataSet GET_OTD_REPORT_EXECEL(List<SCP_OTD_EXPORT> p_lst)
{
DataSet _ds = new DataSet();
var _exportList = new List<SCP_OTD_REPORT_EXPORT>();
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
p_lst.ForEach(itm =>
{
SCP_OTD_REPORT_EXPORT _entity = new SCP_OTD_REPORT_EXPORT();
_entity. = itm.VendId;
_entity. = itm.VendName;
_entity. = itm.AskBillNum;
_entity. = itm.PartCode;
_entity. = itm.PartName;
_entity. = Convert.ToDateTime(itm.EndTime).ToString("yyyy/MM/dd");
_entity. = itm.AskQty.ToString();
_entity. = itm.ArriveQty.ToString();
_entity. = itm.Qty.ToString();
_entity. = itm.NntimelyQty.ToString();
_entity. = itm.OTD.ToString();
_entity. = itm.ArriveOTD.ToString();
_exportList.Add(_entity);
});
var _dt = ConvertHelper.ToDataTable(_exportList);
_ds.Tables.Add(_dt);
}
return _ds;
}
public static DataSet GET_ASK_EXECEL(List<string> p_lst) public static DataSet GET_ASK_EXECEL(List<string> p_lst)
{ {
@ -327,35 +381,5 @@ namespace CK.SCP.Controller
} }
return _ds; return _ds;
} }
public static DataSet GET_OTD_REPORT_EXECEL(List<SCP_OTD_EXPORT> p_lst)
{
DataSet _ds = new DataSet();
var _exportList = new List<SCP_OTD_REPORT_EXPORT>();
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
p_lst.ForEach(itm =>
{
SCP_OTD_REPORT_EXPORT _entity = new SCP_OTD_REPORT_EXPORT();
_entity. = itm.VendId;
_entity. = itm.VendName;
_entity. = itm.AskBillNum;
_entity. = itm.PartCode;
_entity. = itm.PartName;
_entity. = Convert.ToDateTime(itm.EndTime).ToString("yyyy/MM/dd");
_entity. = itm.AskQty.ToString();
_entity. = itm.ArriveQty.ToString();
_entity. = itm.Qty.ToString();
_entity. = itm.NntimelyQty.ToString();
_entity. = itm.OTD.ToString();
_entity. = itm.ArriveOTD.ToString();
_exportList.Add(_entity);
});
var _dt = ConvertHelper.ToDataTable(_exportList);
_ds.Tables.Add(_dt);
}
return _ds;
}
} }
} }

164
Controller/SCP_FORECAST_CONTROLLER.cs

@ -45,10 +45,10 @@ namespace CK.SCP.Controller
{ {
q = q.Where(p => p.State_DESC.Contains(p_entity.State_DESC)); q = q.Where(p => p.State_DESC.Contains(p_entity.State_DESC));
} }
//if (!string.IsNullOrEmpty(p_entity.Month)) if (!string.IsNullOrEmpty(p_entity.Month))
//{ {
// q = q.Where(p => p.Month == p_entity.Month); q = q.Where(p => p.Month == p_entity.Month);
//} }
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0) if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
{ {
@ -288,7 +288,163 @@ namespace CK.SCP.Controller
} }
return ErrorList; return ErrorList;
} }
/// <summary>
/// EXCEL导入(沈阳金杯)
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="p_creator"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_FORECAST_MOD_SYJB(List<SCP_FORECAST_EXPORT_SYJB> 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_SYJB(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.&&t.State!=(int)ForecastState.Reject) ??
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_SYJB(ScpEntities db, SCP_FORECAST_EXPORT_SYJB p_excel)
{
List<string> ErrorList = new List<string>();
var _item = db.TB_FORECAST.SingleOrDefault(t => t.PartCode == p_excel..ToUpper() && t.VendId == p_excel. && t.Month == p_excel. && t.State == (int)ForecastState.Confirm);
if (_item != null)
{
ErrorList.Add(string.Format("零件编号【{0}】,月份【{1}】,供应商【{2}】的数据供应商已确认无法修改", p_excel., p_excel., p_excel.));
}
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) public static ResultObject<bool> Save_TB_FORECAST_STATE(List<long> p_list, string p_user, ForecastState State)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();

388
Controller/SCP_INVOICE_CONTROLLER.cs

@ -167,9 +167,6 @@ namespace CK.SCP.Controller
} }
public static List<string> Get_V_TB_INVOICE_BY_TIME(string p_begin,string p_end,string p_po,string p_asn) public static List<string> Get_V_TB_INVOICE_BY_TIME(string p_begin,string p_end,string p_po,string p_asn)
{ {
List<string> _list = new List<string>(); List<string> _list = new List<string>();
@ -201,7 +198,6 @@ namespace CK.SCP.Controller
return _list; return _list;
} }
public static void Get_V_TB_INVOICE_List(V_TB_INVOICE p_entity, Action<ResultObject<IQueryable<V_TB_INVOICE>>> p_action) public static void Get_V_TB_INVOICE_List(V_TB_INVOICE p_entity, Action<ResultObject<IQueryable<V_TB_INVOICE>>> p_action)
{ {
ResultObject<IQueryable<V_TB_INVOICE>> _ret = new ResultObject<IQueryable<V_TB_INVOICE>>(); ResultObject<IQueryable<V_TB_INVOICE>> _ret = new ResultObject<IQueryable<V_TB_INVOICE>>();
@ -272,6 +268,10 @@ namespace CK.SCP.Controller
{ {
q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser)); q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser));
} }
if (!string.IsNullOrEmpty(p_entity.AskCreateUser))
{
q = q.Where(p => p.AskCreateUser==p_entity.AskCreateUser);
}
if (p_entity.InvoiceList!=null && p_entity.InvoiceList.Count>0) if (p_entity.InvoiceList!=null && p_entity.InvoiceList.Count>0)
{ {
q = q.Where(p => p_entity.InvoiceList.Contains(p.InvcBillNum)); q = q.Where(p => p_entity.InvoiceList.Contains(p.InvcBillNum));
@ -335,11 +335,8 @@ namespace CK.SCP.Controller
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", e.Message); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", e.Message);
throw e; throw e;
} }
} }
public static void Get_V_TB_INVOICE_ERP_List(V_TB_INVOICE p_entity, Action<ResultObject<IQueryable<V_TB_INVOICE>>> p_action) public static void Get_V_TB_INVOICE_ERP_List(V_TB_INVOICE p_entity, Action<ResultObject<IQueryable<V_TB_INVOICE>>> p_action)
{ {
ResultObject<IQueryable<V_TB_INVOICE>> _ret = new ResultObject<IQueryable<V_TB_INVOICE>>(); ResultObject<IQueryable<V_TB_INVOICE>> _ret = new ResultObject<IQueryable<V_TB_INVOICE>>();
@ -940,7 +937,6 @@ namespace CK.SCP.Controller
} }
public static ResultObject<bool> CREATE_TB_INVOICE(V_TB_INVOICE p_entity,List<V_TB_RECEIVE_LIST> p_list) public static ResultObject<bool> CREATE_TB_INVOICE(V_TB_INVOICE p_entity,List<V_TB_RECEIVE_LIST> p_list)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
@ -1090,6 +1086,166 @@ namespace CK.SCP.Controller
return _ret; return _ret;
} }
/// <summary>
/// 创建发票(模具分摊计数)
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_list"></param>
/// <param name="p_quota">是否限额验证</param>
/// <returns></returns>
public static ResultObject<bool> CREATE_TB_INVOICE_MOLDSHARING(V_TB_INVOICE p_entity, List<V_TB_RECEIVE_LIST> p_list)
{
ResultObject<bool> _ret = new ResultObject<bool>();
List<string> _list = new List<string>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
decimal _total = 0;
TB_INVOICE invoice = new TB_INVOICE();
invoice.InvcBillNum = SCP_BILLCODE_CONTROLLER.MakeInvoiceCode();
invoice.VendId = p_entity.VendId;
invoice.CreateTime = DateTime.Now;
invoice.InvoiceNum = "";
invoice.ExpressNum = "";
invoice.Remark = p_entity.Remark;
invoice.CreateUser = p_entity.CreateUser;
invoice.CreateTime = DateTime.Now;
invoice.Site = p_entity.Site;
invoice.State = (int)InvoiceState.New;
invoice.IsDeleted = false;
invoice.GUID = Guid.NewGuid();
invoice.Tax = p_entity.Tax;
invoice.IsRed = false;
db.TB_INVOICE.AddOrUpdate(invoice);
p_list.ForEach(p => {
TB_INVOICE_DETAIL invocieDetail = new TB_INVOICE_DETAIL();
invocieDetail.InvcBillNum = invoice.InvcBillNum;
invocieDetail.AsnBillNum = p.AsnBillNum;
invocieDetail.AskBillNum = p.Remark;
invocieDetail.PoBillNum = p.PoBillNum;
invocieDetail.PoLineNum = p.PoLine;
invocieDetail.RecvBillNum = p.RecvBillNum;
invocieDetail.ErpRecvBillNum = p.ErpRecvBillNum;
invocieDetail.CreateUser = invoice.CreateUser;
invocieDetail.CreateTime = invoice.CreateTime;
invocieDetail.PoUnit = p.PoUnit; //自己改数据库
invocieDetail.PartCode = p.PartCode;
invocieDetail.Price = p.Price;//自己改数据库
invocieDetail.Batch = p.Batch;
invocieDetail.VendBatch = p.VendBatch;
invocieDetail.Qty = p.Qty;
invocieDetail.Currency = p.Currency;//自己改数据库
invocieDetail.IsDeleted = false;
invocieDetail.State = (int)InvoiceState.New;
invocieDetail.GUID = Guid.NewGuid();
invocieDetail.Remark ="";
invocieDetail.IsRed = false;
invocieDetail.BlancePrice = p.BlancePrice;//模具分摊价格
invocieDetail.DiscountPrice = p.DiscountPrice;//供应商价格
db.TB_INVOICE_DETAIL.AddOrUpdate(invocieDetail);
var _moldsharing = db.TA_MoldSharing.SingleOrDefault(t =>t.IsDeleted==false&& t.VendId == p.VendId.ToUpper() && t.PartCode == p.PartCode.ToUpper()&&t.Qty!=t.Count);
if(_moldsharing!=null )
{
var _num = _moldsharing.Count + p.Qty;
if (_moldsharing.Qty < _num)
{
string _str ="供应商"+ _moldsharing .VendId+ "零件名称"+ _moldsharing.PartCode+"超过分摊数量"+ (_num- _moldsharing.Qty).ToString();
_list.Add(_str);
}
else
{
_moldsharing.Count = _num;
db.TA_MoldSharing.AddOrUpdate(_moldsharing);
}
TA_MOLDSHARING_INVOICE MoldSharingInvoice = new TA_MOLDSHARING_INVOICE();
MoldSharingInvoice.InvcBillNum = invoice.InvcBillNum;
MoldSharingInvoice.MoldSharingId = _moldsharing.UID;
MoldSharingInvoice.PoLineNum = p.PoLine;
MoldSharingInvoice.PartCode = p.PartCode;
MoldSharingInvoice.Batch = p.Batch;
MoldSharingInvoice.ErpRecvBillNum = p.ErpRecvBillNum;
MoldSharingInvoice.RecvBillNum = p.RecvBillNum;
MoldSharingInvoice.Price = p.Price;
MoldSharingInvoice.Qty = p.Qty;
MoldSharingInvoice.InvcGUID = invocieDetail.GUID;
db.TA_MoldSharing_Invoice.Add(MoldSharingInvoice);
}
_total += Convert.ToDecimal(p.Qty * p.Price);
});
if (_list.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.MessageList = _list;
}
else
{
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
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_INVOICE_CONTROLLER), "CREATE_TB_INVOICE_MOLDSHARING", 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_INVOICE_CONTROLLER), "CREATE_TB_INVOICE_MOLDSHARING", 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_INVOICE_CONTROLLER), "CREATE_TB_INVOICE_MOLDSHARING", 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_INVOICE_CONTROLLER), "CREATE_TB_INVOICE_MOLDSHARING", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
public static ResultObject<bool> SAVE_TB_INVOICE_STATE(string p_billno, InvoiceState p_state) public static ResultObject<bool> SAVE_TB_INVOICE_STATE(string p_billno, InvoiceState p_state)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
@ -1330,10 +1486,7 @@ namespace CK.SCP.Controller
return _ret; return _ret;
} }
public static ResultObject<bool> SAVE_TB_INVOICE_STATE(V_TB_INVOICE invoice, InvoiceState p_state,string p_username="", string p_flag = "")
public static ResultObject<bool> SAVE_TB_INVOICE_STATE(V_TB_INVOICE invoice, InvoiceState p_state,string p_username="")
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
try try
@ -1365,7 +1518,7 @@ namespace CK.SCP.Controller
_entity.ContractPrice = invoice.ContractPrice; _entity.ContractPrice = invoice.ContractPrice;
_entity.BlancePrice = invoice.BlancePrice; _entity.BlancePrice = invoice.BlancePrice;
_entity.DiscountPrice = invoice.DiscountPrice; _entity.DiscountPrice = invoice.DiscountPrice;//问题
} }
if (p_state == InvoiceState.CheckFail) if (p_state == InvoiceState.CheckFail)
{ {
@ -1490,7 +1643,7 @@ namespace CK.SCP.Controller
} }
_entity.ContractPrice = invoice.ContractPrice; _entity.ContractPrice = invoice.ContractPrice;
_entity.BlancePrice = invoice.BlancePrice; _entity.BlancePrice = invoice.BlancePrice;
_entity.DiscountPrice = invoice.DiscountPrice; _entity.DiscountPrice = invoice.DiscountPrice;//问题
} }
var _list = db.TB_INVOICE_DETAIL.Where(p => p.InvcBillNum == invoice.InvcBillNum).ToList(); var _list = db.TB_INVOICE_DETAIL.Where(p => p.InvcBillNum == invoice.InvcBillNum).ToList();
@ -1510,6 +1663,18 @@ namespace CK.SCP.Controller
_list.ForEach(p => { _list.ForEach(p => {
p.State = (int)p_state; p.State = (int)p_state;
p.IsDeleted = true; p.IsDeleted = true;
if (!string.IsNullOrEmpty(p_flag))//修改分摊数量
{
var _moldsharing = db.TA_MoldSharing.SingleOrDefault(t =>t.IsDeleted==false&& t.VendId == invoice.VendId.ToUpper() && t.PartCode == p.PartCode.ToUpper());
var _ms_detail = db.TA_MoldSharing_Invoice.SingleOrDefault(t =>t.InvcGUID==p.GUID);
if (_moldsharing != null&& _ms_detail!=null)
{
db.TA_MoldSharing_Invoice.Remove(_ms_detail);
var _num = _moldsharing.Count - p.Qty;
_moldsharing.Count = _num;
db.TA_MoldSharing.AddOrUpdate(_moldsharing);
}
}
}); });
} }
@ -1673,9 +1838,10 @@ namespace CK.SCP.Controller
return _ret; return _ret;
} }
public static ResultObject<bool> SAVE_TB_INVOICE_APPLY(V_TB_INVOICE p_invoice, List<V_TB_INVOICE_DETAIL> p_list) public static ResultObject<bool> SAVE_TB_INVOICE_APPLY(V_TB_INVOICE p_invoice, List<V_TB_INVOICE_DETAIL> p_list,string p_flag="")
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
List<string> _list = new List<string>();
try try
{ {
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
@ -1697,6 +1863,7 @@ namespace CK.SCP.Controller
db.TB_INVOICE.AddOrUpdate(p => p.InvcBillNum, _bill); db.TB_INVOICE.AddOrUpdate(p => p.InvcBillNum, _bill);
p_list.ForEach(p => { p_list.ForEach(p => {
var _detail=db.TB_INVOICE_DETAIL.Where(itm => itm.UID == p.UID).FirstOrDefault(); var _detail=db.TB_INVOICE_DETAIL.Where(itm => itm.UID == p.UID).FirstOrDefault();
var _qty = _detail.Qty - p.Qty;
_detail.State =(int)p.State; _detail.State =(int)p.State;
_detail.Qty = p.Qty; _detail.Qty = p.Qty;
_detail.Price = p.Price; _detail.Price = p.Price;
@ -1711,6 +1878,26 @@ namespace CK.SCP.Controller
} }
_detail.Remark = p.Remark; _detail.Remark = p.Remark;
db.TB_INVOICE_DETAIL.AddOrUpdate(itm=>itm.UID,_detail); db.TB_INVOICE_DETAIL.AddOrUpdate(itm=>itm.UID,_detail);
if(!string.IsNullOrEmpty(p_flag))//修改发票数量对分摊数修改
{
var _ms = db.TA_MoldSharing.SingleOrDefault(t =>t.IsDeleted==false&& t.PartCode == _detail.PartCode && t.VendId == _bill.VendId);
var _ms_detail= db.TA_MoldSharing_Invoice.SingleOrDefault(t =>t.InvcGUID== _detail.GUID);
if (_ms != null&& _ms_detail!=null)
{
_ms.Count = _ms.Count - _qty;
if (_ms.Count > _ms.Qty)
{
string _str = "供应商" + _ms.VendId + "零件名称" + _ms.PartCode + "超出分摊数量" + (_ms.Count - _ms.Qty).ToString();
_list.Add(_str);
}
else
{
_ms_detail.Qty = p.Qty;
}
db.TA_MoldSharing.AddOrUpdate(_ms);
db.TA_MoldSharing_Invoice.AddOrUpdate(_ms_detail);
}
}
}); });
#region 供应商代办采购退回任务新 #region 供应商代办采购退回任务新
@ -1728,6 +1915,14 @@ namespace CK.SCP.Controller
db.TB_PENING_ITEMS.Add(_item); db.TB_PENING_ITEMS.Add(_item);
#endregion #endregion
if (_list.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.MessageList = _list;
}
else
{
if (db.SaveChanges() != -1) if (db.SaveChanges() != -1)
{ {
_ret.State = ReturnStatus.Succeed; _ret.State = ReturnStatus.Succeed;
@ -1737,6 +1932,7 @@ namespace CK.SCP.Controller
{ {
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.Result = false; _ret.Result = false;
}
} }
} }
} }
@ -1798,6 +1994,7 @@ namespace CK.SCP.Controller
} }
return _ret; return _ret;
} }
public static ResultObject<bool> SAVE_TB_INVOICE_APPLY2(V_TB_INVOICE_RED p_invoice, List<V_TB_INVOICE_DETAIL_RED> p_list) public static ResultObject<bool> SAVE_TB_INVOICE_APPLY2(V_TB_INVOICE_RED p_invoice, List<V_TB_INVOICE_DETAIL_RED> p_list)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
@ -2079,7 +2276,6 @@ namespace CK.SCP.Controller
return _ret; return _ret;
} }
public ResultObject<bool> Del_TB_INVOICE_DETAIL(List<TB_INVOICE_DETAIL> p_entitys) public ResultObject<bool> Del_TB_INVOICE_DETAIL(List<TB_INVOICE_DETAIL> p_entitys)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
@ -2160,7 +2356,6 @@ namespace CK.SCP.Controller
} }
return _ret; return _ret;
} }
public static ResultObject<bool> CaiWu_Return_Reason(string p_InvcBillNum,string p_Memo) public static ResultObject<bool> CaiWu_Return_Reason(string p_InvcBillNum,string p_Memo)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
@ -2279,8 +2474,7 @@ namespace CK.SCP.Controller
} }
return _ret; return _ret;
} }
public static ResultObject<bool> UpdateMemoByInvcBillNum_SYJB(string p_InvcBillNum, string p_Memo, DateTime updatetime, decimal p_blan = 0, decimal p_contranctprice = 0, string p_InvoiceNumber = null)
public static ResultObject<bool> UpdateMemoByInvcBillNum(string p_InvcBillNum, string p_Memo)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
try try
@ -2288,10 +2482,11 @@ namespace CK.SCP.Controller
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{ {
TB_INVOICE invoice = db.TB_INVOICE.Where(p => p.InvcBillNum == p_InvcBillNum).FirstOrDefault(); TB_INVOICE invoice = db.TB_INVOICE.Where(p => p.InvcBillNum == p_InvcBillNum).FirstOrDefault();
invoice.InvoiceNum = p_InvoiceNumber;
invoice.BlancePrice = p_blan;
invoice.ContractPrice = p_contranctprice;
invoice.Remark = p_Memo; invoice.Remark = p_Memo;
invoice.UpdateTime = updatetime;
db.TB_INVOICE.AddOrUpdate(invoice); db.TB_INVOICE.AddOrUpdate(invoice);
if (db.SaveChanges() != -1) if (db.SaveChanges() != -1)
@ -2321,7 +2516,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(dbEx); _ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum", sb.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum_SYJB", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
} }
catch (OptimisticConcurrencyException ex)//并发冲突异常 catch (OptimisticConcurrencyException ex)//并发冲突异常
@ -2330,7 +2525,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(ex); _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum_SYJB", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
} }
catch (ScpException ex) catch (ScpException ex)
@ -2340,7 +2535,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(ex); _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum_SYJB", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{ {
@ -2359,12 +2554,11 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(e); _ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum", e.Message); throw e; LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "UpdateMemoByInvcBillNum_SYJB", e.Message); throw e;
} }
return _ret; return _ret;
} }
public static ResultObject<bool> UpdateMemoByInvcBillNum(string p_InvcBillNum, string p_Memo, decimal p_blan, string p_inv,DateTime p_time) public static ResultObject<bool> UpdateMemoByInvcBillNum(string p_InvcBillNum, string p_Memo, decimal p_blan, string p_inv,DateTime p_time)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
@ -2451,9 +2645,141 @@ namespace CK.SCP.Controller
return _ret; return _ret;
} }
public static ResultObject<bool> SET_INVOICE_STATE_SYJB(string p_InvcBillNum, InvoiceState p_state, string datetime = null)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
TB_INVOICE invoice = db.TB_INVOICE.Where(p => p.InvcBillNum == p_InvcBillNum).FirstOrDefault();
if (invoice != null)
{
invoice.State = (int)p_state;
db.TB_INVOICE.AddOrUpdate(invoice);
if (p_state == InvoiceState.Mail)
{
List<TB_INVOICE_DETAIL> invoicedetail = db.TB_INVOICE_DETAIL.Where(p => p.InvcBillNum == p_InvcBillNum).ToList();
foreach (TB_INVOICE_DETAIL det in invoicedetail)
{
det.State = (int)p_state;
}
}
//财务审核通过,把所有代办信息设为已办状态
if (p_state == InvoiceState.FinanceReceive)
{
if (string.IsNullOrEmpty(datetime))
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "请填写确认收票时间";
return _ret;
}
DateTime updatetime = DateTime.Parse(datetime);
invoice.UpdateTime = updatetime;//确认收票时间
List<TB_PENING_ITEMS> items = db.TB_PENING_ITEMS.Where(p => p.ITEM_NO == p_InvcBillNum).ToList();
foreach (TB_PENING_ITEMS item in items)
{
item.ITEM_STATE = (int)PENDING_STATE.COMPLETED;
}
List<V_TB_INVOICE_DETAIL> _ls = db.V_TB_INVOICE_DETAIL.Where(p => p.InvcBillNum == p_InvcBillNum).ToList();
V_TB_INVOICE _bill = db.V_TB_INVOICE.Where(p => p.InvcBillNum == p_InvcBillNum).FirstOrDefault();
foreach (V_TB_INVOICE_DETAIL itm in _ls)
{
_bill.UpdateTime = updatetime;//确认收票时间
itm.UpdateTime = updatetime;//确认收票时间
TS_UNI_API _api = UniApiController.CreateBy(_bill, itm, UniApiType.Invoice);
_api.State = 1;
db.TS_UNI_API.AddOrUpdate(_api);
itm.State = (int)p_state;
}
}
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
_ret.Message = invoice.VendId;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = invoice.VendId;
}
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = invoice.VendId;
}
}
}
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_INVOICE_CONTROLLER), "SET_INVOICE_STATE_SYJB", 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_INVOICE_CONTROLLER), "SET_INVOICE_STATE_SYJB", 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_INVOICE_CONTROLLER), "SET_INVOICE_STATE_SYJB", 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.Result = false;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "SET_INVOICE_STATE_SYJB", e.Message); throw e;
}
return _ret;
}
public static ResultObject<bool> SET_INVOICE_STATE(string p_InvcBillNum, InvoiceState p_state) public static ResultObject<bool> SET_INVOICE_STATE(string p_InvcBillNum, InvoiceState p_state)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
@ -2689,7 +3015,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(dbEx); _ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE", sb.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Add_New_Red_Invoice", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
} }
catch (OptimisticConcurrencyException ex)//并发冲突异常 catch (OptimisticConcurrencyException ex)//并发冲突异常
@ -2698,7 +3024,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(ex); _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Add_New_Red_Invoice", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
} }
catch (ScpException ex) catch (ScpException ex)
@ -2708,7 +3034,7 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(ex); _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Add_New_Red_Invoice", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{ {
@ -2725,7 +3051,7 @@ namespace CK.SCP.Controller
catch (Exception e) catch (Exception e)
{ {
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "CREATE_TB_INVOICE", e.Message); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Add_New_Red_Invoice", e.Message);
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(e); _ret.ErrorList.Add(e);
throw e; throw e;

524
Controller/SCP_MoldSharing_Controller.cs

@ -0,0 +1,524 @@
using System;
using System.Linq;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using CK.SCP.Models;
using System.Data;
using System.Data.Entity.Core;
using System.Text;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using System.Collections.Generic;
using System.Data.Entity.Migrations;
namespace CK.SCP.Controller
{
public class SCP_MoldSharing_Controller
{
/// <summary>
/// 获取模具分摊列表
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_action"></param>
public static void Get_V_TA_MoldSharing_List(TA_MOLDSHARING p_entity, Action<ResultObject<IQueryable<TA_MOLDSHARING>>> p_action)
{
ResultObject<IQueryable<TA_MOLDSHARING>> _ret = new ResultObject<IQueryable<TA_MOLDSHARING>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<TA_MOLDSHARING> q = db.TA_MoldSharing;
if (p_entity.UID!=0)
{
q = q.Where(p => p.UID == p_entity.UID);
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode == p_entity.PartCode);
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
q = q.Where(p => p.VendId == p_entity.VendId);
}
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
_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_MoldSharing_Controller), "Get_V_TA_MoldSharing_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_MoldSharing_Controller), "Get_V_TA_MoldSharing_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_MoldSharing_Controller), "Get_V_TA_MoldSharing_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_MoldSharing_Controller), "Get_V_TA_MoldSharing_List", e.Message);
throw e;
}
}
public static void Get_V_TA_MOLDSHARING_INVOICE_List(TA_MOLDSHARING_INVOICE p_entity, Action<ResultObject<IQueryable<TA_MOLDSHARING_INVOICE>>> p_action)
{
ResultObject<IQueryable<TA_MOLDSHARING_INVOICE>> _ret = new ResultObject<IQueryable<TA_MOLDSHARING_INVOICE>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<TA_MOLDSHARING_INVOICE> q = db.TA_MoldSharing_Invoice;
if (p_entity.MoldSharingId != 0)
{
q = q.Where(p => p.MoldSharingId == p_entity.MoldSharingId);
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode == p_entity.PartCode);
}
_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_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_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_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_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_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_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_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_List", e.Message);
throw e;
}
}
/// <summary>
/// 模具分摊导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="site"></param>
/// <param name="p_creator"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_MOLDSHARING_MOD(List<SCP_MOLDSHARING_EXPORT> p_order_list, string site, string p_creator)
{
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_MoldSharing(db, p, site);
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 _moldsharing = db.TA_MoldSharing.SingleOrDefault(t => t.VendId == p..ToUpper() && t.PartCode == p..ToUpper()) ??
new TA_MOLDSHARING
{
VendId = p..ToUpper(),
PartCode = p..ToUpper(),
CreateTime = DateTime.Now,
CreateUser = p_creator,
IsDeleted = false,
Count = 0,
};
_moldsharing.Price = decimal.Parse(p.);
_moldsharing.TotalCount = decimal.Parse(p.);
_moldsharing.InitialQty = decimal.Parse(p.);
_moldsharing.Qty = (_moldsharing.TotalCount - _moldsharing.InitialQty);
_moldsharing.UpdateTime = DateTime.Now;
_moldsharing.UpdateUser = p_creator;
_moldsharing.Site = site;
if(_moldsharing.Qty< _moldsharing.Count)
{
_ret.MessageList.Add(string.Format("零件号{0}(分摊总量-初始已分摊数量)小于已累计数量!", _moldsharing.PartCode));
}
else
{
db.TA_MoldSharing.AddOrUpdate(_moldsharing);
}
});
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_MoldSharing_Controller), "EXCEL_MOLDSHARING_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_MoldSharing_Controller), "EXCEL_MOLDSHARING_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_MoldSharing_Controller), "EXCEL_MOLDSHARING_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_MoldSharing_Controller), "EXCEL_MOLDSHARING_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>
/// <param name="site"></param>
/// <returns></returns>
public static List<string> CheckExcelMode_MoldSharing(ScpEntities db, SCP_MOLDSHARING_EXPORT p_excel, string site)
{
List<string> ErrorList = new List<string>();
if (!string.IsNullOrEmpty(p_excel.))
{
int count = db.TA_VENDER.Count(p => p.VendId == p_excel. && p.Site == site);
if (count <= 0)
{
ErrorList.Add(string.Format("供应商{0}不存在!", p_excel.));
}
}
else
{
ErrorList.Add(string.Format("供应商代码为空!"));
}
if (!string.IsNullOrEmpty(p_excel.))
{
int count = db.TA_PART.Count(p => p.PartCode == p_excel. && p.Site == site);
if (count <= 0)
{
ErrorList.Add(string.Format("零件编号{0}不存在!", p_excel.));
}
}
else
{
ErrorList.Add(string.Format("零件号为空!"));
}
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.)||
string.IsNullOrEmpty(p_excel.))
{
ErrorList.Add(string.Format("供应商代码【{0}】零件编号【{1}】有填写为空!", p_excel., p_excel.));
}
return ErrorList;
}
/// <summary>
/// 获取模具分摊价格(沈阳模具分摊)
/// </summary>
/// <param name="p_list"></param>
/// <returns></returns>
public static List<V_TB_RECEIVE_LIST> GET_MoldSharing_LIST_SYJB(List<V_TB_RECEIVE_LIST> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_list.Count > 0)
{
p_list.ForEach(p =>
{
//var entity_price = db.V_TB_PRICE.Where(t => t.VendId == p.VendId && t.PartCode == p.PartCode && t.StartTime <= DateTime.Now).FirstOrDefault();
//if (entity_price != null)
//{
// p.Price = entity_price.Amt;
//}
var _entity = db.TA_MoldSharing.Where(itm => itm.Qty!= itm.Count && itm.PartCode == p.PartCode && itm.VendId == p.VendId &&itm.IsDeleted==false).FirstOrDefault();
if (_entity != null)
{
p.Price += decimal.Parse(_entity.Price.ToString());
}
});
}
}
return p_list;
}
/// <summary>
/// 获取模具分摊价格
/// </summary>
/// <param name="p_list"></param>
/// <returns></returns>
public static List<V_TB_RECEIVE_LIST> GET_MoldSharing_LIST(List<V_TB_RECEIVE_LIST> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_list.Count > 0)
{
p_list.ForEach(p =>
{
var _entity = db.TA_MoldSharing.Where(itm => itm.Qty > itm.Count && itm.PartCode == p.PartCode && itm.VendId == p.VendId &&itm.IsDeleted==false).FirstOrDefault();
if (_entity != null)
{
p.BlancePrice = decimal.Parse(_entity.Price.ToString());
}
else
{
p.BlancePrice = 0;
}
});
}
}
return p_list;
}
public static ResultObject<bool> Save_TA_MOLDSHARING_STATE (List<long> p_list, string p_user, bool p_isdelete)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_isdelete == true)
{
var _ls = db.TA_MoldSharing.Where(p => p_list.Contains(p.UID)&& p.Count <= 0).ToList();
if (_ls.Count > 0)
{
_ls.ForEach(p =>
{
p.IsDeleted = true;
p.UpdateTime = DateTime.Now;
p.UpdateUser = p_user;
}
);
db.TA_MoldSharing.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_MoldSharing_Controller), "Save_TA_MOLDSHARING_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_MoldSharing_Controller), "Save_TA_MOLDSHARING_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_MoldSharing_Controller), "Save_TA_MOLDSHARING_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_MoldSharing_Controller), "Save_TA_MOLDSHARING_STATE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
}
}

158
Controller/SCP_PO_CONTROLLER.cs

@ -32,7 +32,7 @@ namespace CK.SCP.Controller
} }
if (!string.IsNullOrEmpty(p_entity.PoBillNum)) if (!string.IsNullOrEmpty(p_entity.PoBillNum))
{ {
q = q.Where(p => p.PoBillNum.Contains( p_entity.PoBillNum)); q = q.Where(p => p.PoBillNum == p_entity.PoBillNum);
} }
if (!string.IsNullOrEmpty(p_entity.ErpBillNum)) if (!string.IsNullOrEmpty(p_entity.ErpBillNum))
{ {
@ -607,28 +607,29 @@ namespace CK.SCP.Controller
} }
var _count = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel.QAD订单号 && p.PartCode == p_excel. && p.PoLine.ToString() == p_excel.); var _list = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.QAD订单号 && p.PartCode == p_excel.).ToList();
if ( if (
string.IsNullOrEmpty(p_excel.) || string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.QAD订单号) || string.IsNullOrEmpty(p_excel.QAD订单号) ||
string.IsNullOrEmpty(p_excel.) || string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) || string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) || string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) || string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) || string.IsNullOrEmpty(p_excel.))
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.))
{ {
ErrorList.Add(string.Format("分组【{1}】零件号【{0}】有填写为空!", p_excel., p_excel.)); ErrorList.Add(string.Format("分组【{1}】零件号【{0}】有填写为空!", p_excel., p_excel.));
} }
if (_count == 0) if (_list.Count == 0)
{ {
ErrorList.Add(string.Format("分组【{2}】零件号【{0}】行号【{1}】不存在!", p_excel., p_excel., p_excel.)); ErrorList.Add(string.Format("分组【{2}】零件号【{0}】行号【{1}】不存在!", p_excel., p_excel., p_excel.));
} }
else
{
p_excel. = _list[0].PoLine.ToString();
p_excel.= _list[0].Price.ToString();
p_excel. = _list[0].PoUnit.ToString();
p_excel. = _list[0].Currency.ToString();
}
return ErrorList; return ErrorList;
@ -1895,7 +1896,7 @@ namespace CK.SCP.Controller
} }
return ErrorList; return ErrorList;
} }
public static ResultObject<bool> EXCEL_PO_TO_ASK(List<SCP_PO_EXCEL> p_order_list, string p_creator, string p_buyer, DateTime p_time, BillModType p_modtype, bool IsAutoPublish = false) public static ResultObject<bool> EXCEL_PO_TO_ASK(List<SCP_PO_EXCEL> p_order_list, string p_creator, string p_buyer, DateTime p_time, BillModType p_modtype, string p_site, bool IsAutoPublish = false)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
try try
@ -1928,9 +1929,9 @@ namespace CK.SCP.Controller
p_order_list = p_order_list.Where(p => int.Parse(p.) != 0).ToList(); p_order_list = p_order_list.Where(p => int.Parse(p.) != 0).ToList();
var VenderList = p_order_list.Select(p => p.).Distinct(); //var VenderList = p_order_list.Select(p => p.供应商编号).Distinct();
var PartCodeList = p_order_list.Select(p => p.).Distinct(); //var PartCodeList = p_order_list.Select(p => p.零件号).Distinct();
var OrderList = p_order_list.GroupBy(p => p.).ToList(); var OrderList = p_order_list.GroupBy(p =>new { p., p. }).ToList();
OrderList.ForEach((p) => OrderList.ForEach((p) =>
{ {
var list_distinct = p.GroupBy(t => new { t., t. }).ToList(); var list_distinct = p.GroupBy(t => new { t., t. }).ToList();
@ -1946,11 +1947,10 @@ namespace CK.SCP.Controller
var _entity = list.FirstOrDefault(); var _entity = list.FirstOrDefault();
TB_ASK _ask = new TB_ASK(); TB_ASK _ask = new TB_ASK();
_ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode(); _ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode();
_ask.VendId = _entity.;
_ask.State = (int)AskState.New; _ask.State = (int)AskState.New;
_ask.PoBillNum = _entity.QAD订单号.ToUpper(); _ask.PoBillNum = _entity.QAD订单号.ToUpper();
_ask.ModType = (int)BillModType.Contract; _ask.ModType = (int)BillModType.Contract;
_ask.Site = _entity.; _ask.Site = p_site;
if (IsAutoPublish) if (IsAutoPublish)
{ {
_ask.State = (int)AskState.Release; _ask.State = (int)AskState.Release;
@ -1959,12 +1959,12 @@ namespace CK.SCP.Controller
{ {
_ask.State = (int)AskState.New; _ask.State = (int)AskState.New;
} }
_ask.BeginTime = DateTime.Parse(_entity.); _ask.BeginTime = DateTime.Now;
_ask.Buyer = _entity.; _ask.Buyer = _entity.;
_ask.BuyerPhone = _entity.; _ask.BuyerPhone = _entity.;
_ask.ErpBillNum = _entity.QAD订单号.ToUpper(); _ask.ErpBillNum = _entity.QAD订单号.ToUpper();
_ask.EndTime = DateTime.Parse(_entity.); _ask.EndTime = DateTime.Parse(_entity.);
_ask.CreateTime = DateTime.Parse(_entity.); _ask.CreateTime = DateTime.Now;
_ask.CreateUser = p_creator; _ask.CreateUser = p_creator;
_ask.VendId = _entity..ToUpper(); _ask.VendId = _entity..ToUpper();
_ask.GUID = Guid.NewGuid(); _ask.GUID = Guid.NewGuid();
@ -1996,8 +1996,8 @@ namespace CK.SCP.Controller
_t_ASK_Detail.PoUnit = itm.; _t_ASK_Detail.PoUnit = itm.;
_t_ASK_Detail.CreateTime = DateTime.Now; _t_ASK_Detail.CreateTime = DateTime.Now;
_t_ASK_Detail.CreateUser = _ask.CreateUser; _t_ASK_Detail.CreateUser = _ask.CreateUser;
_t_ASK_Detail.PartCode = itm..ToUpper(); _t_ASK_Detail.PartCode = (itm..ToUpper()).TrimEnd();
_t_ASK_Detail.BeginTime = DateTime.Parse(itm.); _t_ASK_Detail.BeginTime = _ask.BeginTime;
_t_ASK_Detail.EndTime = DateTime.Parse(itm.); _t_ASK_Detail.EndTime = DateTime.Parse(itm.);
_t_ASK_Detail.TempQty = decimal.Parse(itm.); _t_ASK_Detail.TempQty = decimal.Parse(itm.);
_t_ASK_Detail.AskQty = decimal.Parse(itm.); _t_ASK_Detail.AskQty = decimal.Parse(itm.);
@ -2007,6 +2007,7 @@ namespace CK.SCP.Controller
_t_ASK_Detail.State = _ask.State; _t_ASK_Detail.State = _ask.State;
_t_ASK_Detail.Price = string.IsNullOrEmpty(itm.) ? 0 : decimal.Parse(itm.); _t_ASK_Detail.Price = string.IsNullOrEmpty(itm.) ? 0 : decimal.Parse(itm.);
_t_ASK_Detail.GUID = Guid.NewGuid(); _t_ASK_Detail.GUID = Guid.NewGuid();
_t_ASK_Detail.Remark = itm.;
db.TB_ASK_DETAIL.Add(_t_ASK_Detail); db.TB_ASK_DETAIL.Add(_t_ASK_Detail);
// _number++; // _number++;
@ -2096,7 +2097,14 @@ namespace CK.SCP.Controller
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", e.Message); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", e.Message);
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(e); _ret.ErrorList.Add(e);
throw e; if (e.InnerException != null)
{
_ret.MessageList.Add(e.InnerException.Message);
}
else
{
_ret.MessageList.Add(e.Message);
}
} }
return _ret; return _ret;
@ -2599,114 +2607,6 @@ namespace CK.SCP.Controller
return _ret; return _ret;
} }
public static void Get_V_TB_PO_DETAIL_List_STATISTICS(V_TB_PO_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_PO_DETAIL>>> p_action)
{
ResultObject<IQueryable<V_TB_PO_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_PO_DETAIL>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TB_PO_DETAIL> q = db.V_TB_PO_DETAIL;
if (!string.IsNullOrEmpty(p_entity.PoBillNum))
{
q = q.Where(p => p.PoBillNum.Contains(p_entity.PoBillNum));
}
if (!string.IsNullOrEmpty(p_entity.ErpBillNum))
{
q = q.Where(p => p.ErpBillNum.Contains(p_entity.ErpBillNum));
}
if (p_entity.BeginTime != null)
{
q = q.Where(p => p.BeginTime >= p_entity.BeginTime);
}
if (p_entity.EndTime != null)
{
q = q.Where(p => p.BeginTime <= p_entity.EndTime);
}
if (!string.IsNullOrEmpty(p_entity.VendName))
{
q = q.Where(p => p.VendName.Contains(p_entity.VendName));
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode == p_entity.PartCode);
}
if (p_entity.State != null)
{
q = q.Where(p => p.State == p_entity.State);
}
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));
}
//IQueryable<TB_ASK_DETAIL> _aq = db.TB_ASK_DETAIL;
//_aq = _aq.Where(p => p.PoBillNum == p_entity.PoBillNum);
//var _a=_aq.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { AskSum = p.Max(itm=>itm .AskQty),PoLine=p.Key });
//if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
//{
// q = q.Where(p => p_entity.UserInAddress.Contains(p.Address));
//}
_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_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_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_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_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_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_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_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", e.Message);
throw e;
}
}
public static void Get_V_TA_VENDER(V_TB_PO_DETAIL p_entity, Action<ResultObject<IQueryable<V_TA_VENDER>>> p_action) public static void Get_V_TA_VENDER(V_TB_PO_DETAIL p_entity, Action<ResultObject<IQueryable<V_TA_VENDER>>> p_action)
{ {

403
Controller/SCP_RECEIVE_CONTROLLER.cs

@ -15,6 +15,7 @@ using System.Data.SqlClient;
using System.Data; using System.Data;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity; using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Models.ScpEntity.ExcelImportEntity;
namespace CK.SCP.Controller namespace CK.SCP.Controller
{ {
@ -33,6 +34,14 @@ namespace CK.SCP.Controller
{ {
q = q.Where(p => p.RecvBillNum.Contains(p_entity.RecvBillNum)); q = q.Where(p => p.RecvBillNum.Contains(p_entity.RecvBillNum));
} }
if (!string.IsNullOrEmpty(p_entity.ErpRecvBillNum))
{
q = q.Where(p => p.ErpRecvBillNum.Contains(p_entity.ErpRecvBillNum));
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
q = q.Where(p => p.VendId==p_entity.VendId);
}
if (!string.IsNullOrEmpty(p_entity.PoBillNum)) if (!string.IsNullOrEmpty(p_entity.PoBillNum))
{ {
q = q.Where(p => p.PoBillNum.Contains(p_entity.PoBillNum)); q = q.Where(p => p.PoBillNum.Contains(p_entity.PoBillNum));
@ -60,7 +69,14 @@ namespace CK.SCP.Controller
} }
if (!string.IsNullOrEmpty(p_entity.CreateUser)) if (!string.IsNullOrEmpty(p_entity.CreateUser))
{ {
q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser)||p.CreateUser==null); if (p_entity.CreateUser == "无")
{
q = q.Where(p => string.IsNullOrEmpty(p.CreateUser));
}
else
{
q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser));
}
} }
if (p_entity.IsDeleted != false) if (p_entity.IsDeleted != false)
{ {
@ -86,6 +102,14 @@ namespace CK.SCP.Controller
{ {
q = q.Where(p => p_entity.UserInAddress.Contains(p.Site)); q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
} }
if (p_entity.ShipTimeStart != null && !p_entity.ShipTimeStart.ToString().Contains("0001/1/1"))
{
q = q.Where(p => p.ShipTime >= p_entity.ShipTimeStart);
}
if (p_entity.ShipTimeEnd != null && !p_entity.ShipTimeEnd.ToString().Contains("0001/1/1"))
{
q = q.Where(p => p.ShipTime <= p_entity.ShipTimeEnd);
}
_ret.State = ReturnStatus.Succeed; _ret.State = ReturnStatus.Succeed;
_ret.Result = q; _ret.Result = q;
@ -798,7 +822,41 @@ namespace CK.SCP.Controller
return p_list; return p_list;
} }
public static List<V_TB_INVOICE_DETAIL> Get_V_TB_INVOICE_LIST_SYJB(List<V_TB_INVOICE_DETAIL> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
p_list.ForEach(itm =>
{
try
{
var _recSum = db.V_TB_RECEIVE_DETAIL.Where(p => p.Remark== itm.AskBillNum && p.RecvBillNum == itm.RecvBillNum && p.PartCode == itm.PartCode && p.Batch == itm.Batch && p.IsDeleted == false).Select(p => p.Qty).Sum();
if (itm.RecvBillNum.Substring(0, 1) == "R")
{
_recSum = 0 - Math.Abs(_recSum);
}
var _sum = db.V_TB_INVOICE_DETAIL.Where(p =>p.AskBillNum==itm.AskBillNum && p.RecvBillNum == itm.RecvBillNum && p.PartCode == itm.PartCode && p.Batch == itm.Batch && p.IsDeleted == false).Select(p => p.Qty).Sum();
if (_recSum - _sum <= 0)
{
itm.CanQty = 0;
}
else
{
itm.CanQty = _recSum - _sum;
}
}
catch
{
itm.CanQty = 0;
}
});
}
return p_list;
}
public static List<V_TB_INVOICE_DETAIL> Get_V_TB_INVOICE_LIST(List<V_TB_INVOICE_DETAIL> p_list) public static List<V_TB_INVOICE_DETAIL> Get_V_TB_INVOICE_LIST(List<V_TB_INVOICE_DETAIL> p_list)
{ {
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
@ -854,10 +912,29 @@ namespace CK.SCP.Controller
{ {
q = q.Where(p => p.RecvBillNum == p_entity.RecvBillNum); q = q.Where(p => p.RecvBillNum == p_entity.RecvBillNum);
} }
if (!string.IsNullOrEmpty(p_entity.ErpRecvBillNum))
{
if (p_entity.ErpRecvBillNum == "可开票")
{
q = q.Where(p => !string.IsNullOrEmpty(p.ErpRecvBillNum));
}
else if(p_entity.ErpRecvBillNum == "不可开票")
{
q = q.Where(p => string.IsNullOrEmpty( p.ErpRecvBillNum) );
}
else
{
q = q.Where(p => p.ErpRecvBillNum == p_entity.ErpRecvBillNum);
}
}
if (p_entity.PoLine != 0) if (p_entity.PoLine != 0)
{ {
q = q.Where(p => p.PoLine == p_entity.PoLine); q = q.Where(p => p.PoLine == p_entity.PoLine);
} }
if (!string.IsNullOrEmpty(p_entity.AskCreateUser))
{
q = q.Where(p => p.AskCreateUser.Contains(p_entity.AskCreateUser));
}
if (!string.IsNullOrEmpty(p_entity.PartCode)) if (!string.IsNullOrEmpty(p_entity.PartCode))
{ {
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode)); q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
@ -892,7 +969,7 @@ namespace CK.SCP.Controller
} }
if (!string.IsNullOrEmpty(p_entity.Site)) if (!string.IsNullOrEmpty(p_entity.Site))
{ {
q = q.Where(p => p.Site.Contains(p_entity.Site)); q = q.Where(p => p.Site==p_entity.Site);
} }
if (!string.IsNullOrEmpty(p_entity.VendId)) if (!string.IsNullOrEmpty(p_entity.VendId))
{ {
@ -1802,7 +1879,329 @@ namespace CK.SCP.Controller
return _ds; return _ds;
} }
/// <summary>
/// 数据导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="p_creator"></param>
/// <param name="p_buyer"></param>
/// <param name="p_site"></param>
/// <param name="p_time"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_RECEIVE(List<SCP_ASN_EXCEL> p_order_list, string p_creator, string p_buyer, string p_site, DateTime p_time)
{
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>();
p_order_list.ForEach
(p =>
{
var _ls = CheckExcel(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
{
var Ask_list = p_order_list.Where(f => decimal.Parse(f.) > 0);
var GroupList = Ask_list.GroupBy(p => new { p., p., p., p., p., p. }).Select(p => new { = p.Sum(itm => decimal.Parse(itm.)), = p.Key., = p.Key., p.Key., p.Key., p.Key., p.Key. }).ToList();
var OrderList = GroupList.GroupBy(p => p.).ToList();
List<string> _list = new List<string>();
OrderList.ForEach((p) =>
{
var list_distinct = p.GroupBy(t => new { t., t. }).ToList();
var list = p.ToList();
if (list_distinct.Count < list.Count)
{
_ret.MessageList.Add("相同组号,存在同一编号、行号的数据");
return;
}
if (list.Count > 0)
{
var _entity = list.FirstOrDefault();
TB_ASK _ask = new TB_ASK();
_ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode();
_ask.State = (int)AskState.Receive;
_ask.PoBillNum = _entity..ToUpper();
_ask.ModType = (int)BillModType.Contract;
_ask.Site = p_site;
_ask.BeginTime = p_time;
_ask.Buyer = p_creator;
_ask.BuyerPhone = "";
_ask.ErpBillNum = _entity..ToUpper();
_ask.EndTime = p_time;
_ask.CreateTime = p_time;
_ask.CreateUser = p_creator;
_ask.VendId = _entity..ToUpper();
_ask.GUID = Guid.NewGuid();
_ask.IsDeleted = false;
db.TB_ASK.Add(_ask);
TB_ASN _asn = new TB_ASN();
_asn.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode();
_asn.AskBillNum = _ask.AskBillNum;
_asn.VendId = _entity..ToUpper(); ;
_asn.State = (int)AsnState.Receive;
_asn.PoBillNum = _entity..ToUpper();
_asn.Site = p_site;
_asn.CreateTime = p_time;
_asn.CreateUser = p_creator;
_asn.UpdateTime = p_time;
_asn.UpdateUser = p_creator;
_asn.ShipTime = p_time;
_asn.ShipUser = p_creator;
_asn.ReceiveTime = p_time;
_asn.ReceiveUser = p_creator;
_asn.GUID = Guid.NewGuid();
_asn.IsDeleted = false;
db.TB_ASN.Add(_asn);
list.ForEach((itm) =>
{
TB_ASK_DETAIL _t_ASK_Detail = new TB_ASK_DETAIL();
_t_ASK_Detail.PoLine = Int32.Parse(itm.);
_t_ASK_Detail.Currency = "";
_t_ASK_Detail.AskBillNum = _ask.AskBillNum;
_t_ASK_Detail.PoBillNum = _ask.PoBillNum;
_t_ASK_Detail.PoUnit = itm.;
_t_ASK_Detail.CreateTime = DateTime.Now;
_t_ASK_Detail.CreateUser = _ask.CreateUser;
_t_ASK_Detail.PartCode = itm..ToUpper();
_t_ASK_Detail.BeginTime = p_time;
_t_ASK_Detail.EndTime = p_time;
_t_ASK_Detail.TempQty = itm.;
_t_ASK_Detail.AskQty = itm.;
_t_ASK_Detail.IsDeleted = false;
_t_ASK_Detail.LocUnit = itm.;
_t_ASK_Detail.UnConv = 1;
_t_ASK_Detail.State = _ask.State;
_t_ASK_Detail.Price = string.IsNullOrEmpty(itm.) ? 0 : decimal.Parse(itm.);
_t_ASK_Detail.GUID = Guid.NewGuid();
db.TB_ASK_DETAIL.Add(_t_ASK_Detail);
TB_ASN_DETAIL _t_ASN_Detail = new TB_ASN_DETAIL();
_t_ASN_Detail.AsnBillNum = _asn.AsnBillNum;
_t_ASN_Detail.PoLine = Int32.Parse(itm.);
_t_ASN_Detail.Currency = "";
_t_ASN_Detail.PoBillNum = _asn.PoBillNum;
_t_ASN_Detail.PoUnit = itm.;
_t_ASN_Detail.CreateTime = DateTime.Now;
_t_ASN_Detail.CreateUser = _asn.CreateUser;
_t_ASN_Detail.PartCode = itm..ToUpper();
_t_ASN_Detail.Batch = p_time.ToString("yyyyMMdd");
_t_ASN_Detail.VendBatch = p_time.ToString("yyyyMMdd");
_t_ASN_Detail.Qty = itm.;
_t_ASN_Detail.State = (int)AsnState.Receive;
_t_ASN_Detail.CreateTime = p_time;
_t_ASN_Detail.CreateUser = p_creator;
_t_ASN_Detail.IsDeleted = false;
_t_ASN_Detail.GUID = Guid.NewGuid();
_t_ASN_Detail.PoUnit = itm.;
_t_ASN_Detail.ProduceDate = p_time;
db.TB_ASN_DETAIL.Add(_t_ASN_Detail);
var _reclist = p_order_list.Where(t => t. == itm. && t. == itm. && t. == itm.).GroupBy(t => t.).ToList();
_reclist.ForEach((q) =>
{
var reclist = q.FirstOrDefault();
TB_RECEIVE _rec = new TB_RECEIVE();
_rec.RecvBillNum = reclist.;
_rec.State = (int)FormState.;
_rec.Remark = _ask.AskBillNum;
_rec.CreateTime = p_time;
_rec.CreateUser = p_creator;
_rec.IsDeleted = false;
_rec.GUID = System.Guid.NewGuid();
if (Convert.ToInt32(reclist.) < 0)
{
_rec.RecvBillNum = "R." + _rec.RecvBillNum;
_rec.BillType = 1;
}
else
{
_rec.BillType = 0;
}
_rec.PoBillNum = reclist..ToUpper();
_rec.AsnBillNum = reclist..ToUpper();
_rec.Site = p_site;
_rec.VendId = reclist..ToUpper();
_rec.ShipTime = p_time;
if (!_list.Contains(reclist.))
{
_list.Add(reclist.);
db.TB_RECEIVE.Add(_rec);
}
var _recdetaillist = p_order_list.Where(f => f. == reclist. && f. == reclist. && f. == reclist. && f. == reclist.).ToList();
_recdetaillist.ForEach((n) =>
{
TB_RECEIVE_DETAIL _t_RECEIVE_Detail = new TB_RECEIVE_DETAIL();
_t_RECEIVE_Detail.RecvBillNum = n.;
_t_RECEIVE_Detail.PoBillNum = n..ToUpper();
_t_RECEIVE_Detail.PoLine = Int32.Parse(n.);
_t_RECEIVE_Detail.PartCode = n..ToUpper();
_t_RECEIVE_Detail.Batch = n.;
_t_RECEIVE_Detail.VendBatch = n.;
_t_RECEIVE_Detail.PoUnit = n.;
_t_RECEIVE_Detail.LocUnit = "";
_t_RECEIVE_Detail.Qty = decimal.Parse(n.);
_t_RECEIVE_Detail.State = (int)FormState.;
_t_RECEIVE_Detail.Remark = _ask.AskBillNum;
_t_RECEIVE_Detail.CreateTime = p_time;
_t_RECEIVE_Detail.CreateUser = p_creator;
_t_RECEIVE_Detail.IsDeleted = false;
_t_RECEIVE_Detail.GUID = System.Guid.NewGuid();
if (_t_RECEIVE_Detail.Qty < 0)
{
// _t_RECEIVE_Detail.RecvBillNum = "R." + _t_RECEIVE_Detail.RecvBillNum;
_t_RECEIVE_Detail.Qty = System.Math.Abs(_t_RECEIVE_Detail.Qty);
_t_RECEIVE_Detail.BillType = 1;
}
else
{
_t_RECEIVE_Detail.BillType = 0;
}
db.TB_RECEIVE_DETAIL.Add(_t_RECEIVE_Detail);
});
});
});
}
else
{
_ret.MessageList.Add("请检查数据后,重新导入!");
return;
}
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_RECIVECE_CONTROLLER), "EXCEL_RECEIVE", 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_RECIVECE_CONTROLLER), "EXCEL_RECEIVE", 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_RECIVECE_CONTROLLER), "EXCEL_RECEIVE", 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_RECIVECE_CONTROLLER), "EXCEL_RECEIVE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
private static List<string> CheckExcel(ScpEntities db, SCP_ASN_EXCEL p_excel)
{
List<string> ErrorList = new List<string>();
if (!string.IsNullOrEmpty(p_excel.))
{
int count = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel. && p.PartCode == p_excel. && p.PoLine.ToString() == p_excel.);
if (count == 0)
{
ErrorList.Add(string.Format("订单编号{0}零件号{1}行号{2}不存在!", p_excel., p_excel., p_excel.));
}
}
else
{
ErrorList.Add(string.Format("订单编号为空!"));
}
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.))
{
ErrorList.Add(string.Format("收货单号【{1}】零件号【{0}】有填写为空!", p_excel., p_excel.));
}
return ErrorList;
}
} }
} }

117
Controller/SCP_REJECT_CONTROLLER.cs

@ -9,6 +9,7 @@ using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils; using CK.SCP.Utils;
using CK.SCP.Controller; using CK.SCP.Controller;
using CK.SCP.Models.Enums; using CK.SCP.Models.Enums;
using System.Data.Entity.Core;
namespace CK.SCP.Controller namespace CK.SCP.Controller
{ {
@ -243,5 +244,121 @@ namespace CK.SCP.Controller
} }
return _ret; return _ret;
} }
/// <summary>
/// 保存退货
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_list"></param>
/// <param name="currentuser"></param>
/// <returns></returns>
public static ResultObject<bool> Save_TB_REJECT(V_TB_ASN_DETAIL p_entity, List<V_TB_ASN_DETAIL> p_list, string currentuser)
{
ResultObject<bool> _ret = new ResultObject<bool>();
var scpRcvList = new List<TB_RECEIVE>();
var scpRcveDetailList = new List<TB_RECEIVE_DETAIL>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
TB_RECEIVE scpRcv = new TB_RECEIVE();
scpRcv.RecvBillNum = SCP_BILLCODE_CONTROLLER.MakeReviceCode();//退货单号
scpRcv.State = (int)FormState.;
scpRcv.Remark = "";
scpRcv.CreateTime = DateTime.Now;//创建日期
scpRcv.CreateUser = currentuser;//创建用户
scpRcv.IsDeleted = false;
scpRcv.GUID = System.Guid.NewGuid();
scpRcv.BillType = 1;
scpRcv.PoBillNum = p_entity.PoBillNum;//采购单
scpRcv.AsnBillNum = p_entity.AsnBillNum;//发货单号
scpRcv.Site = p_entity.Site;//地点
scpRcv.VendId = p_entity.VendId;//供货商名称
scpRcv.ShipTime = DateTime.Now;//收货日期
scpRcvList.Add(scpRcv);
db.TB_RECEIVE.AddOrUpdate(p => p.UID, scpRcvList.ToArray());
p_list.ForEach(item =>
{
TB_RECEIVE_DETAIL scpRcvDetail = new TB_RECEIVE_DETAIL();
scpRcvDetail.RecvBillNum = SCP_BILLCODE_CONTROLLER.MakeReviceCode();//退货单号
scpRcvDetail.PoBillNum = item.PoBillNum;//采购单
scpRcvDetail.PoLine = item.PoLine;//订单行
scpRcvDetail.PartCode = item.PartCode;//零件号
scpRcvDetail.Batch = item.Batch;//批次
scpRcvDetail.VendBatch = item.VendBatch;//供应商批号
scpRcvDetail.PoUnit = item.PoUnit;//采购单位
scpRcvDetail.LocUnit = item.LocUnit;//基本单位
scpRcvDetail.Qty = item.RejectQty;//退货数量
scpRcvDetail.State = (int)FormState.;// (int)FormState.关闭,
scpRcvDetail.Remark = item.Remark;
scpRcvDetail.CreateTime = DateTime.Now;//创建日期
scpRcvDetail.CreateUser = currentuser;//创建用户
scpRcvDetail.IsDeleted = false;
scpRcvDetail.GUID = System.Guid.NewGuid();
scpRcvDetail.BillType = 1;
scpRcveDetailList.Add(scpRcvDetail);
});
db.TB_RECEIVE_DETAIL.AddOrUpdate(p => p.UID, scpRcveDetailList.ToArray());
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
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_RECIVECE_CONTROLLER), "Save_TB_RECEIVE", 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_RECIVECE_CONTROLLER), "Save_TB_RECEIVE", 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_RECIVECE_CONTROLLER), "Save_TB_RECEIVE", 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_RECIVECE_CONTROLLER), "Save_TB_RECEIVE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
} }
} }

236
Controller/SCP_REPORT_CONTROLLER.cs

@ -19,85 +19,6 @@ namespace CK.SCP.Controller
public class SCP_REPORT_CONTROLLER public class SCP_REPORT_CONTROLLER
{ {
// public static DataTable GET_SCP_UNPAIED(V_SUPPLIERS_REGUALARLY p_entity)
// {
// StringBuilder _buffer = new StringBuilder();
//// SELECT VendId AS 供应商编码, VendName AS 供应商名称, Site AS 域, 税前金额, 税额, 税后金额
//// FROM(SELECT VendId, VendName, Site, SUM(ROUND(Qty * Price, 2)) AS 税前金额, SUM(ROUND(ROUND(Qty * Price, 2)
//// * 0.13, 2)) AS 税额, SUM(ROUND(Qty * Price, 2)) + SUM(ROUND(ROUND(Qty * Price, 2) * 0.13, 2))
//// AS 税后金额
//// FROM dbo.V_TB_RECEIVE_LIST
//// WHERE(State = 1) AND(Qty < 0)
//// GROUP BY VendId, VendName, Site) AS a
// }
//public override DataTable GetPagedDataTable(int pageIndex, int pageSize)
//{
// //SetWhere();
// //if (StrOrder == "") StrOrder = "UserType desc, UserName asc";
// int rowbegin = (pageIndex * pageSize) + 1;
// int rowend = (pageIndex + 1) * pageSize;
// return GetDataLimit(rowbegin, rowend, "", StrWhere + " and " + StrSearch, StrOrder);
//}
//public virtual DataTable GetDataLimit(int rows1, int rows2, string fields, string strwhere, string orderby,string p_tableview)
//{
// var dbSetting = GlobalConfig.ScpDatabase;
// try
// {
// if (fields == "")
// { fields = "*"; }
// string sql = @"
// select {0} from (
// select ROW_NUMBER() over(order by {1}) as rows_number_9999999, {0} from {2} where {5}
// ) as query_temp_table_9999999 where rows_number_9999999 between {3} and {4} and ({5})
// ";
// object[] obj = new object[6];
// obj[0] = fields;
// obj[1] = orderby;
// obj[2] = p_tableview;
// obj[3] = rows1;
// obj[4] = rows2;
// obj[5] = strwhere;
// sql = string.Format(sql, obj);
// DataTable dt = new DataTable();
// var strConn = EntitiesFactory.GetEfConnectionString(dbSetting);
// SqlConnection conn = new System.Data.SqlClient.SqlConnection();
// conn.ConnectionString = strConn;
// if (conn.State != ConnectionState.Open)
// {
// conn.Open();
// }
// #region 结束时间范围
// SqlCommand cmd = new SqlCommand();
// cmd.Connection = conn;
// cmd.CommandText = sql;
// SqlDataAdapter adapter = new SqlDataAdapter(cmd);
// adapter.Fill(dt);
// return dt;
// }
// catch
// { }
//}
public static string GET_V_SUPPLIERS_REGUALARLY_LIST_SQL(V_SUPPLIERS_REGUALARLY p_entity) public static string GET_V_SUPPLIERS_REGUALARLY_LIST_SQL(V_SUPPLIERS_REGUALARLY p_entity)
{ {
StringBuilder _buffer = new StringBuilder(); StringBuilder _buffer = new StringBuilder();
@ -133,7 +54,6 @@ namespace CK.SCP.Controller
} }
public static DataTable Get_RECEIVE_YEAR(V_TB_RECEIVE_DETAIL p_detail, string p_year) public static DataTable Get_RECEIVE_YEAR(V_TB_RECEIVE_DETAIL p_detail, string p_year)
{ {
string _sql = "SELECT D.*,E.VENDNAME,F.PROJECTID FROM({0}) c pivot(sum(c.数量) for c.M in (一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月)) as d LEFT JOIN TA_VENDER E on D.vendid=E.VENDID AND D.SITE=E.SITE LEFT JOIN TA_PART F ON f.partcode =d.partcode and f.site=e.site where {1}"; string _sql = "SELECT D.*,E.VENDNAME,F.PROJECTID FROM({0}) c pivot(sum(c.数量) for c.M in (一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月)) as d LEFT JOIN TA_VENDER E on D.vendid=E.VENDID AND D.SITE=E.SITE LEFT JOIN TA_PART F ON f.partcode =d.partcode and f.site=e.site where {1}";
@ -283,8 +203,6 @@ namespace CK.SCP.Controller
return dt; return dt;
} }
public static DataTable Get_PART_LIFE(V_TB_PO_DETAIL p_detail) public static DataTable Get_PART_LIFE(V_TB_PO_DETAIL p_detail)
{ {
DataTable dt = new DataTable(); DataTable dt = new DataTable();
@ -531,65 +449,6 @@ namespace CK.SCP.Controller
} }
public string GetASN_REC_REPORT(V_TB_ASK_DETAIL p_detail)
{
string sqlString = "SELECT a.PartCode,a.PoLine,a.AskBillNum,AskQty,isnull(sum(b.Qty),0) asnQty,isNull(SUM(c.Qty),0) as RecQty,a.PoBillNum FROM TB_ASK_DETAIL A\n" +
"LEFT JOIN\n" +
"\n" +
"(select\n" +
"TB_ASN_DETAIL.Qty,\n" +
"TB_ASN.AsnBillNum,\n" +
"TB_ASN.AskBillNum,\n" +
"TB_ASN_DETAIL.PartCode,\n" +
"TB_ASN_DETAIL.PoLine\n" +
"from TB_ASN_DETAIL inner join TB_ASN on TB_ASN_DETAIL.AsnBillNum=tb_asn.AsnBillNum and TB_ASN.State<>-1) as\n" +
" B on a.AskBillNum=b.AskBillNum and a.PartCode=b.PartCode and a.PoLine=b.PoLine\n" +
"Left join\n" +
"(\n" +
"select\n" +
"TB_RECEIVE_DETAIL.Qty,\n" +
"TB_RECEIVE.AsnBillNum,\n" +
"TB_RECEIVE_DETAIL.PartCode,\n" +
"TB_RECEIVE_DETAIL.PoLine\n" +
"from TB_RECEIVE_DETAIL inner join TB_RECEIVE on TB_RECEIVE_DETAIL.RecvBillNum=TB_RECEIVE.RecvBillNum and TB_RECEIVE.State<>-1) as\n" +
"\n" +
" C on B.AsnBillNum=C.AsnBillNum and B.PartCode=C.PartCode and B.PoLine=C.PoLine\n" +
" where a.State<>-1 {0}" +
"\n" +
" GROUP BY a.PartCode,a.PoLine,a.AskBillNum,a.AskQty,a.PoBillNum";
if (!string.IsNullOrEmpty(p_detail.PartCode))
{
}
if (!string.IsNullOrEmpty(p_detail.VendId))
{
}
if (!string.IsNullOrEmpty(p_detail.AskBillNum))
{
}
if (!string.IsNullOrEmpty(p_detail.PoBillNum))
{
}
if (!string.IsNullOrEmpty(p_detail.PoBillNum))
{
}
return sqlString;
}
public static string GET_SQE(V_TB_ASN_DETAIL p_entity) public static string GET_SQE(V_TB_ASN_DETAIL p_entity)
{ {
StringBuilder _buffer = new StringBuilder(); StringBuilder _buffer = new StringBuilder();
@ -793,8 +652,8 @@ namespace CK.SCP.Controller
_builder.Append(" select h.Site, h.AskBillNum,h.EndTime, h.VendId, h.PartCode ,sum (h.Qty) as ArriveQty , AskQty ,(AskQty -sum (h.Qty)) as Qty ,sum(h.NntimelyQty) as NntimelyQty , "); _builder.Append(" select h.Site, h.AskBillNum,h.EndTime, h.VendId, h.PartCode ,sum (h.Qty) as ArriveQty , AskQty ,(AskQty -sum (h.Qty)) as Qty ,sum(h.NntimelyQty) as NntimelyQty , ");
_builder.Append(" (CASE WHEN AskQty=0 Then 0 ELSE (sum (NntimelyQty)/AskQty) END) as OTD ,( CASE WHEN AskQty=0 Then 0 ELSE (sum (h.Qty)/AskQty) END ) AS ArriveOTD from ( SELECT p.Site, p.VendId, p.AskBillNum, p.PartCode, ISNULL(A.Qty,0) as Qty, "); _builder.Append(" (CASE WHEN AskQty=0 Then 0 ELSE (sum (NntimelyQty)/AskQty) END) as OTD ,( CASE WHEN AskQty=0 Then 0 ELSE (sum (h.Qty)/AskQty) END ) AS ArriveOTD from ( SELECT p.Site, p.VendId, p.AskBillNum, p.PartCode, ISNULL(A.Qty,0) as Qty, ");
_builder.Append(" (p.AskQty- ISNULL(p.ReduceQty,0)) as AskQty , (CASE WHEN DATEDIFF(day, A.ShipTime, p.EndTime) >= -1 THEN A.Qty ELSE 0 END) as NntimelyQty ,a.ShipTime ,p.EndTime FROM dbo.V_TB_ASK_DETAIL AS p LEFT OUTER JOIN "); _builder.Append(" (p.AskQty- ISNULL(p.ReduceQty,0)) as AskQty , (CASE WHEN DATEDIFF(day, A.ShipTime, p.EndTime) >= -1 THEN A.Qty ELSE 0 END) as NntimelyQty ,a.ShipTime ,p.EndTime FROM dbo.V_TB_ASK_DETAIL AS p LEFT OUTER JOIN ");
_builder.Append(" V_TB_ASN AS B on p.AskBillNum=b.AskBillNum LEFT OUTER JOIN dbo.V_TB_ARRIVE_DETAIL AS A ON b.AsnBillNum=A.AsnBillNum AND A.PoLine = p.PoLine AND A.PartCode = p.PartCode where p.IsDeleted=0 "); _builder.Append(" dbo.V_TB_ARRIVE_DETAIL AS A ON A.Remark = p.AskBillNum AND A.PoLine = p.PoLine AND A.PartCode = p.PartCode LEFT OUTER JOIN dbo.V_TB_ARRIVE AS B ON A.ArrvBillNum = B.ArrvBillNum where p.IsDeleted=0 ");
if (p_entity.BeginTime != null) if (p_entity.BeginTime != null)
{ {
_builder.AppendFormat(" AND p.EndTime>='{0}'", p_entity.BeginTime); _builder.AppendFormat(" AND p.EndTime>='{0}'", p_entity.BeginTime);
@ -1133,6 +992,88 @@ namespace CK.SCP.Controller
} }
} }
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 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_REPORT_CONTROLLER), "Get_V_TB_ASK_RECEIVE_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_REPORT_CONTROLLER), "Get_V_TB_ASK_RECEIVE_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_REPORT_CONTROLLER), "Get_V_TB_ASK_RECEIVE_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_REPORT_CONTROLLER), "Get_V_TB_ASK_RECEIVE_List", e.Message);
throw e;
}
}
public static void Get_V_TIMELY_DELIVERY_List(V_TIMELY_DELIVERY p_entity, Action<ResultObject<IQueryable<V_TIMELY_DELIVERY>>> p_action)
{
ResultObject<IQueryable<V_TIMELY_DELIVERY>> _ret = new ResultObject<IQueryable<V_TIMELY_DELIVERY>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
string _sql = GetV_TIMELY_DELIVERY_SQL(p_entity);
IQueryable<V_TIMELY_DELIVERY> q = db.Database.SqlQuery<V_TIMELY_DELIVERY>(_sql).AsQueryable();
if (p_entity.RecvBeginTime != null)
{
q = q.Where(p => p.RecvTime >= p_entity.RecvBeginTime);
}
if (p_entity.RecvEndTime != null)
{
q = q.Where(p => p.RecvTime <= p_entity.RecvEndTime);
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
var _ls = p_entity.PartCode.Split(new char[] { ',' });
q = q.Where(p => _ls.Contains(p.PartCode));
}
if (!string.IsNullOrEmpty(p_entity.PartDesc1))
{
q = q.Where(p => p.PartDesc1.Contains(p.PartDesc1));
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{ {
var sb = new StringBuilder(); var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList()) foreach (var error in dbEx.EntityValidationErrors.ToList())
@ -1179,7 +1120,6 @@ namespace CK.SCP.Controller
throw e; throw e;
} }
} }
public static void Get_TB_ASK_UNCOMPLETE_List(TB_UNCOMPLETE_TEMPASK p_entity, Action<ResultObject<IQueryable<TB_UNCOMPLETE_TEMPASK>>> p_action) public static void Get_TB_ASK_UNCOMPLETE_List(TB_UNCOMPLETE_TEMPASK p_entity, Action<ResultObject<IQueryable<TB_UNCOMPLETE_TEMPASK>>> p_action)
{ {
@ -1269,7 +1209,7 @@ namespace CK.SCP.Controller
} }
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx); _ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TIMELY_DELIVERY_List", sb.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_TB_ASK_UNCOMPLETE_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
} }
catch (OptimisticConcurrencyException ex)//并发冲突异常 catch (OptimisticConcurrencyException ex)//并发冲突异常
@ -1277,14 +1217,14 @@ namespace CK.SCP.Controller
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex); _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TIMELY_DELIVERY_List", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_TB_ASK_UNCOMPLETE_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
} }
catch (ScpException ex) catch (ScpException ex)
{ {
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex); _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TIMELY_DELIVERY_List", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_TB_ASK_UNCOMPLETE_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{ {
@ -1300,7 +1240,7 @@ namespace CK.SCP.Controller
{ {
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e); _ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_TIMELY_DELIVERY_List", e.Message); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_TB_ASK_UNCOMPLETE_List", e.Message);
throw e; throw e;
} }
} }

1
Controller/SCP_TB_PRICE_CONTROLLER.cs

@ -18,6 +18,5 @@ namespace CK.SCP.Controller
return db.TB_PRICE.ToList(); return db.TB_PRICE.ToList();
} }
} }
} }
} }

82
Controller/SCP_TB_VENDER_CONTROLLER.cs

@ -86,6 +86,88 @@ namespace CK.SCP.Controller
} }
//public static ResultObject<bool> Save_TA_VENDER(List<TA_VENDER> p_entitys)
//{
// ResultObject<bool> _ret = new ResultObject<bool>();
// try
// {
// using (ScpEntities db = EntitiesFactory.CreateScpInstance())
// {
// foreach (var itm in p_entitys)
// {
// var _entity = db.TA_VENDER.Where(p => p.UID == itm.UID).FirstOrDefault();
// _entity.Quota = itm.Quota;
// db.TA_VENDER.AddOrUpdate(p => p.UID, _entity);
// }
// if (_ret.MessageList.Count > 0)
// {
// _ret.State = ReturnStatus.Failed;
// }
// else
// {
// if (db.SaveChanges() != -1)
// {
// _ret.State = ReturnStatus.Succeed;
// _ret.Result = true;
// }
// 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_TB_VENDER_CONTROLLER), "Save_TA_VENDER", 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_TB_VENDER_CONTROLLER), "Save_TA_VENDER", 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_TB_VENDER_CONTROLLER), "Save_TA_VENDER", 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_TB_VENDER_CONTROLLER), "Save_TA_VENDER", e.Message);
// _ret.Result = false;
// _ret.ErrorList.Add(e);
// throw e;
// }
// return _ret;
//}
} }
} }

105
Controller/SCP_TS_BARCODE_CONTROLLER.cs

@ -158,6 +158,103 @@ namespace CK.SCP.Controller
throw e; throw e;
} }
}
public static void Get_V_TS_BARCODE_List(V_TS_BARCODE p_entity, Action<ResultObject<IQueryable<V_TS_BARCODE>>> p_action)
{
ResultObject<IQueryable<V_TS_BARCODE>> _ret = new ResultObject<IQueryable<V_TS_BARCODE>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TS_BARCODE> q = db.V_TS_BARCODE;
if (!string.IsNullOrEmpty(p_entity.BarCode))
{
q = q.Where(p => p.BarCode.Contains(p_entity.BarCode));
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
}
if (!string.IsNullOrEmpty(p_entity.Batch))
{
q = q.Where(p => p.Batch.Contains(p_entity.Batch));
}
if (!string.IsNullOrEmpty(p_entity.BillNum))
{
q = q.Where(p => p.BillNum.Contains(p_entity.BillNum));
}
if (p_entity.PoBillLine != 0)
{
q = q.Where(p => p.PoBillLine == p_entity.PoBillLine);
}
if (!string.IsNullOrEmpty(p_entity.VendBatch))
{
q = q.Where(p => p.VendBatch.Contains(p_entity.VendBatch));
}
if (p_entity.PackQty != 0)
{
q = q.Where(p => p.PackQty == p_entity.PackQty);
}
if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
{
q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));
}
q = q.Where(p => p.IsScanned == p_entity.IsScanned);
_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_TS_BARCODE_CONTROLLER), "Get_V_TS_BARCODE_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_TS_BARCODE_CONTROLLER), "Get_V_TS_BARCODE_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_TS_BARCODE_CONTROLLER), "Get_V_TS_BARCODE_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_TS_BARCODE_CONTROLLER), "Get_V_TS_BARCODE_List", e.Message);
throw e;
}
} }
public static void Get_TS_BARCODE_CUSTOM_List(TS_BARCODE_CUSTOM p_entity, Action<ResultObject<IQueryable<TS_BARCODE_CUSTOM>>> p_action) public static void Get_TS_BARCODE_CUSTOM_List(TS_BARCODE_CUSTOM p_entity, Action<ResultObject<IQueryable<TS_BARCODE_CUSTOM>>> p_action)
{ {
@ -269,21 +366,21 @@ namespace CK.SCP.Controller
} }
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx); _ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", sb.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_CUSTOM_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
} }
catch (OptimisticConcurrencyException ex)//并发冲突异常 catch (OptimisticConcurrencyException ex)//并发冲突异常
{ {
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex); _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_CUSTOM_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
} }
catch (ScpException ex) catch (ScpException ex)
{ {
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex); _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_CUSTOM_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{ {
var inner = (UpdateException)ex.InnerException; var inner = (UpdateException)ex.InnerException;
@ -298,7 +395,7 @@ namespace CK.SCP.Controller
{ {
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e); _ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", e.Message); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TS_BARCODE_CONTROLLER), "Get_TS_BARCODE_CUSTOM_List", e.Message);
throw e; throw e;
} }

92
Controller/SCP_WMS_CONTROLLER.cs

@ -103,6 +103,98 @@ namespace CK.SCP.Controller
throw e; throw e;
} }
}
public static List<VIEW_STOCK_REPORT> GET_INVOICE_CANQTY(List<VIEW_STOCK_REPORT> p_list)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (p_list.Count > 0)
{
p_list.ForEach(p =>
{
var entity = db.V_TB_RECEIVE_LIST.Where(itm => itm.PartCode == p.PartCode&&itm.VendId==p.VendId ).ToList();
decimal canqty = entity.Sum(t => t.CanQty);
p.InvoiceQty = canqty;
});
}
}
return p_list;
}
public static void Get_VIEW_STOCK_REPORT(VIEW_STOCK_REPORT p_entity, Action<ResultObject<IQueryable<VIEW_STOCK_REPORT>>> p_action)
{
ResultObject<IQueryable<VIEW_STOCK_REPORT>> _ret = new ResultObject<IQueryable<VIEW_STOCK_REPORT>>();
try
{
using (WmsEntities db = EntitiesFactory.CreateWmsInstance())
{
IQueryable<VIEW_STOCK_REPORT> q = db.VIEW_STOCK_REPORT;
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
}
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_WMS_CONTROLLER), "Get_VIEW_STOCK_REPORT", 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_WMS_CONTROLLER), "Get_VIEW_STOCK_REPORT", 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_WMS_CONTROLLER), "Get_VIEW_STOCK_REPORT", 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_WMS_CONTROLLER), "Get_VIEW_STOCK_REPORT", e.Message);
throw e;
}
} }
public static void Get_VIEW_STOCK_DETAIL(VIEW_STOCK_QTY p_entity, Action<ResultObject<IQueryable<VIEW_STOCK_QTY>>> p_action) public static void Get_VIEW_STOCK_DETAIL(VIEW_STOCK_QTY p_entity, Action<ResultObject<IQueryable<VIEW_STOCK_QTY>>> p_action)
{ {

49
Controller/UniApiController.cs

@ -1,6 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.Data.Entity.Core; using System.Data.Entity.Core;
using System.Data.SqlClient;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using CK.SCP.Models; using CK.SCP.Models;
@ -13,6 +15,53 @@ namespace CK.SCP.Controller
{ {
public static class UniApiController public static class UniApiController
{ {
public static DataTable FindUniapi(string p_type, string p_billNum, string p_domain)
{
string sql = string.Empty;
switch (p_type)
{
case "xxqad_pod_det":
sql =
"SELECT * FROM[xxqad_pod_det] a inner join xxqad_ctrl b on a.xxqad_pod_seq = b.xxqad_seq where xxqad_domain = '{1}' and xxqad_pod_nbr in ({0}) order by xxqad_pod_nbr, b.xxqad_seq ";
break;
case "xxqad_prh_det":
sql = "SELECT * FROM[xxqad_prh_det] a inner join xxqad_ctrl b on a.xxqad_prh_seq = b.xxqad_seq where xxqad_domain = '{1}' and xxqad_prh_psnbr in ({0}) order by xxqad_prh_psnbr, b.xxqad_seq ";
break;
case "xxwms_rc1_det":
sql = "select * from xxwms_rc1_det a inner join xxwms_ctrl b on a.xxwms_rc_seq = b.xxwms_seq where xxwms_domain = '{1}' and xxwms_rc_nbr in ({0}) order by xxwms_rc_nbr, b.xxwms_seq";
break;
case "xxscm_tx_mstr":
sql = "select * from xxscm_tx_mstr a inner join xxscm_ctrl b on a.xxscm_tx_seq = b.xxscm_seq where xxscm_domain = '{1}' and xxscm_tx_nbr in ({0}) order by xxscm_tx_nbr, b.xxscm_seq";
break;
case "xxscm_inv_det":
sql = "select * from xxscm_inv_det a inner join xxscm_ctrl b on a.xxscm_inv_seq = b.xxscm_seq where xxscm_domain = '{1}' and xxscm_inv_nbr IN({0}) order by xxscm_inv_nbr,b.xxscm_seq";
break;
}
DataTable _dt = new DataTable();
var dbSetting = GlobalConfig.UniApiDatabase;
try
{
var strConn = EntitiesFactory.GetEfConnectionString(dbSetting);
SqlConnection conn = new System.Data.SqlClient.SqlConnection();
conn.ConnectionString = strConn;
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = string.Format(sql, p_billNum, p_domain);
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
adapter.Fill(_dt);
}
catch (Exception e)
{
}
return _dt;
}
public static void Get_TS_UNI_API_List(TS_UNI_API p_entity, Action<ResultObject<IQueryable<TS_UNI_API>>> p_action) public static void Get_TS_UNI_API_List(TS_UNI_API p_entity, Action<ResultObject<IQueryable<TS_UNI_API>>> p_action)
{ {
ResultObject<IQueryable<TS_UNI_API>> _ret = new ResultObject<IQueryable<TS_UNI_API>>(); ResultObject<IQueryable<TS_UNI_API>> _ret = new ResultObject<IQueryable<TS_UNI_API>>();

7
Models/CK.SCP.Models.csproj

@ -332,11 +332,16 @@
<Compile Include="GlobalConfig.cs" /> <Compile Include="GlobalConfig.cs" />
<Compile Include="ScpCache.cs" /> <Compile Include="ScpCache.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_FORECAST_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_FORECAST_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_MOLDSHARING_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_OTD_REPORT_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_OTD_REPORT_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_OTD_VendId_REPORT_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PART_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_PART_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PRICE_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_PRICE_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_PART_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_PART_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelImportEntity\SCP_ASN_EXCEL.cs" />
<Compile Include="ScpEntity\TA_MoldSharing.cs" />
<Compile Include="ScpEntity\TA_MOLDSHARING_INVOICE.cs" />
<Compile Include="ScpEntity\TA_VENDER_EXTEND.cs" /> <Compile Include="ScpEntity\TA_VENDER_EXTEND.cs" />
<Compile Include="ScpEntity\TB_CLAIM_APPEND.cs" /> <Compile Include="ScpEntity\TB_CLAIM_APPEND.cs" />
<Compile Include="ScpEntity\TB_PALLETS.cs" /> <Compile Include="ScpEntity\TB_PALLETS.cs" />
@ -442,6 +447,7 @@
<Compile Include="ScpEntity\V_TB_REJECT_DETAIL.cs" /> <Compile Include="ScpEntity\V_TB_REJECT_DETAIL.cs" />
<Compile Include="ScpEntity\V_TIMELY_DELIVERY.cs" /> <Compile Include="ScpEntity\V_TIMELY_DELIVERY.cs" />
<Compile Include="ScpEntity\V_TM_HYANTOLIN_REVIEW.cs" /> <Compile Include="ScpEntity\V_TM_HYANTOLIN_REVIEW.cs" />
<Compile Include="ScpEntity\V_TS_BARCODE.cs" />
<Compile Include="UniApiEntity\xxwms_review_det.cs" /> <Compile Include="UniApiEntity\xxwms_review_det.cs" />
<Compile Include="ScpEntity\TM_HUANTOLIN_REVIEW.cs" /> <Compile Include="ScpEntity\TM_HUANTOLIN_REVIEW.cs" />
<Compile Include="ScpException.cs" /> <Compile Include="ScpException.cs" />
@ -701,6 +707,7 @@
<Compile Include="WmsEntity\VIEW_STOCK_GROUP.cs" /> <Compile Include="WmsEntity\VIEW_STOCK_GROUP.cs" />
<Compile Include="WmsEntity\VIEW_STOCK_MOVE.cs" /> <Compile Include="WmsEntity\VIEW_STOCK_MOVE.cs" />
<Compile Include="WmsEntity\VIEW_STOCK_QTY.cs" /> <Compile Include="WmsEntity\VIEW_STOCK_QTY.cs" />
<Compile Include="WmsEntity\VIEW_STOCK_REPORT.cs" />
<Compile Include="WmsEntity\VIEW_STOCK_VEND.cs" /> <Compile Include="WmsEntity\VIEW_STOCK_VEND.cs" />
<Compile Include="WmsEntity\VIEW_STORE_WHSE.cs" /> <Compile Include="WmsEntity\VIEW_STORE_WHSE.cs" />
<Compile Include="WmsEntity\VIEW_TRANSACTION.cs" /> <Compile Include="WmsEntity\VIEW_TRANSACTION.cs" />

20
Models/ScpEntities.cs

@ -52,6 +52,7 @@ namespace CK.SCP.Models
public virtual DbSet<TL_BILL> TL_BILL { get; set; } public virtual DbSet<TL_BILL> TL_BILL { get; set; }
public virtual DbSet<TL_OPER> TL_OPER { get; set; } public virtual DbSet<TL_OPER> TL_OPER { get; set; }
public virtual DbSet<TS_BARCODE> TS_BARCODE { get; set; } public virtual DbSet<TS_BARCODE> TS_BARCODE { get; set; }
public virtual DbSet<V_TS_BARCODE> V_TS_BARCODE { get; set; }
public virtual DbSet<TS_BARCODE_SMALL> TS_BARCODE_SMALL { get; set; } public virtual DbSet<TS_BARCODE_SMALL> TS_BARCODE_SMALL { get; set; }
public virtual DbSet<TS_STOCK> TS_STOCK { get; set; } public virtual DbSet<TS_STOCK> TS_STOCK { get; set; }
public virtual DbSet<TS_UNI_API> TS_UNI_API { get; set; } public virtual DbSet<TS_UNI_API> TS_UNI_API { get; set; }
@ -123,33 +124,30 @@ namespace CK.SCP.Models
public virtual DbSet<TB_PRICE> TB_PRICE { get; set; } public virtual DbSet<TB_PRICE> TB_PRICE { get; set; }
public virtual DbSet<TB_FORECAST> TB_FORECAST { get; set; } public virtual DbSet<TB_FORECAST> TB_FORECAST { get; set; }
public virtual DbSet<V_TB_FORECAST> V_TB_FORECAST { get; set; } public virtual DbSet<V_TB_FORECAST> V_TB_FORECAST { get; set; }
public virtual DbSet<TA_MOLDSHARING> TA_MoldSharing { get; set; }
public virtual DbSet<TA_MOLDSHARING_INVOICE> TA_MoldSharing_Invoice { get; set; }
public virtual DbSet<TB_RECEIVE_DETAIL_QAD> TB_RECEIVE_DETAIL_QAD { get; set; } public virtual DbSet<TB_RECEIVE_DETAIL_QAD> TB_RECEIVE_DETAIL_QAD { get; set; }
public virtual DbSet<TB_RECEIVE_QAD> TB_RECEIVE_QAD { get; set; } public virtual DbSet<TB_RECEIVE_QAD> TB_RECEIVE_QAD { get; set; }
public virtual DbSet<TM_HYANTOLIN_REVIEW> TM_HYANTOLIN_REVIEW { get; set; } public virtual DbSet<TM_HYANTOLIN_REVIEW> TM_HYANTOLIN_REVIEW { get; set; }
public virtual DbSet<TB_CLAIM_APPEND> TB_CLAIM_APPEND { get; set; } public virtual DbSet<TB_CLAIM_APPEND> TB_CLAIM_APPEND { get; set; }
public virtual DbSet<V_TM_HYANTOLIN_REVIEW> V_TM_HYANTOLIN_REVIEW { get; set; } public virtual DbSet<V_TM_HYANTOLIN_REVIEW> V_TM_HYANTOLIN_REVIEW { get; set; }
public virtual DbSet<TB_PLAN_CUSTOM> TB_PLAN_CUSTOM { get; set; } public virtual DbSet<TB_PLAN_CUSTOM> TB_PLAN_CUSTOM { get; set; }
public virtual DbSet<TB_PO_PLAN> TB_PO_PLAN { get; set; } public virtual DbSet<TB_PO_PLAN> TB_PO_PLAN { get; set; }
public virtual DbSet<V_TB_PO_PLAN> V_TB_PO_PLAN { get; set; } public virtual DbSet<V_TB_PO_PLAN> V_TB_PO_PLAN { get; set; }
public virtual DbSet<V_TB_PO_PLAN_DETAIL> V_TB_PO_PLAN_DETAIL { get; set; } public virtual DbSet<V_TB_PO_PLAN_DETAIL> V_TB_PO_PLAN_DETAIL { get; set; }
public virtual DbSet<TB_PO_PLAN_EXTEND> TB_PO_PLAN_EXTEND { get; set; } public virtual DbSet<TB_PO_PLAN_EXTEND> TB_PO_PLAN_EXTEND { get; set; }
public virtual DbSet<V_TB_PO_PLAN_EXTEND> V_TB_PO_PLAN_EXTEND { get; set; } public virtual DbSet<V_TB_PO_PLAN_EXTEND> V_TB_PO_PLAN_EXTEND { get; set; }
public virtual DbSet<V_TB_ASK_RECEIVE> V_TB_ASK_RECEIVE { get; set; } public virtual DbSet<V_TB_ASK_RECEIVE> V_TB_ASK_RECEIVE { get; set; }
public virtual DbSet<TB_ASK_RECEIVE> TB_ASK_RECEIVE { get; set; } public virtual DbSet<TB_ASK_RECEIVE> TB_ASK_RECEIVE { get; set; }
public virtual DbSet<TB_UNCOMPLETE_TEMPASK> TB_UNCOMPLETE_TEMPASK { get; set; } public virtual DbSet<TB_UNCOMPLETE_TEMPASK> TB_UNCOMPLETE_TEMPASK { get; set; }
// public virtual DbSet<V_TB_PO_INCOMPLETE> V_TB_PO_INCOMPLETE { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder) protected override void OnModelCreating(DbModelBuilder modelBuilder)
{ {
modelBuilder.Entity<TA_MOLDSHARING>()
.Property(e => e.Price)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_INVOICE_DETAIL>()
.Property(e => e.Price)
.HasPrecision(18, 5);
modelBuilder.Entity<TA_REVICE_PORT>() modelBuilder.Entity<TA_REVICE_PORT>()
.Property(e => e.PORT_NO) .Property(e => e.PORT_NO)
.IsUnicode(false); .IsUnicode(false);

9
Models/ScpEntity/ExcelExportEnttity/SCP_FORECAST_EXPORT.cs

@ -27,4 +27,13 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
public string { get; set; } public string { get; set; }
public string { get; set; } public string { get; set; }
} }
public class SCP_FORECAST_EXPORT_SYJB
{
public string { get; set; }
public string { get; set; }
public string 1 { get; set; }
public string 2 { get; set; }
public string 3 { get; set; }
public string { get; set; }
}
} }

17
Models/ScpEntity/ExcelExportEnttity/SCP_MOLDSHARING_EXPORT.cs

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
{
public class SCP_MOLDSHARING_EXPORT
{
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
}
}

22
Models/ScpEntity/ExcelExportEnttity/SCP_OTD_VendId_REPORT_EXPORT.cs

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
{
public class SCP_OTD_VendId_REPORT_EXPORT
{
public string { get; set; }
public string { get; set; } //VendId
public string { get; set; } //VendName
public string { get; set; }//endtime
public string { get; set; } //AskQty
public string { get; set; } //ArriveQty
public string { get; set; } //Qty
public string { get; set; } //NntimelyQty
public string { get; set; }//OTD
public string { get; set; }//ArriveOTD
}
}

23
Models/ScpEntity/ExcelImportEntity/SCP_ASN_EXCEL.cs

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity.ExcelImportEntity
{
public class SCP_ASN_EXCEL
{
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
}
}

10
Models/ScpEntity/ExcelImportEntity/SCP_PO_EXCEL.cs

@ -15,11 +15,9 @@ namespace CK.SCP.Models.ScpEntity.ExcelImportEntity
public string QAD订单号 {set;get;} public string QAD订单号 {set;get;}
public string { set; get; } public string { set; get; }
public string {set;get;} public string {set;get;}
public string {set;get;}
public string {set;get;} public string {set;get;}
public string {set;get;} public string {set;get;}
public string {set;get;} public string {set;get;}
public string {set;get;}
public string {set;get;} public string {set;get;}
public string {set;get;} public string {set;get;}
public string {set;get;} public string {set;get;}
@ -27,13 +25,7 @@ namespace CK.SCP.Models.ScpEntity.ExcelImportEntity
public string {set;get;} public string {set;get;}
public string { set; get; } public string { set; get; }
public string {set;get;} public string {set;get;}
//public string 是否免费 {set;get;} public string { set; get; }
//public string 是否批量 {set;get;}
//public string 是否紧急要货 {set;get;}
} }
public class SCP_PO_DETAIL_IMPORT_MODEL public class SCP_PO_DETAIL_IMPORT_MODEL
{ {

31
Models/ScpEntity/TA_MOLDSHARING_INVOICE.cs

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity
{
public class TA_MOLDSHARING_INVOICE
{
[Key]
public long UID { set; get; }
public long MoldSharingId { set; get; }
public System.Guid InvcGUID { get; set; }
[Required, StringLength(50)]
public string InvcBillNum { set; get; }
public int PoLineNum { get; set; }
[StringLength(50)]
public string PartCode { get; set; }
[StringLength(50)]
public string Batch { get; set; }
public string RecvBillNum { get; set; }
[StringLength(50)]
public string ErpRecvBillNum { get; set; }
public decimal Price { get; set; }
[Column(TypeName = "money")]
public decimal Qty { get; set; }
}
}

34
Models/ScpEntity/TA_MoldSharing.cs

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class TA_MOLDSHARING
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
public long UID { get; set; }
[StringLength(50)]
public string VendId { get; set; }
[StringLength(50)]
public string PartCode { get; set; }
[StringLength(50)]
public string Site { get; set; }
public System.DateTime CreateTime { get; set; }
[StringLength(50)]
public string CreateUser { get; set; }
public Nullable<System.DateTime> UpdateTime { get; set; }
[StringLength(50)]
public string UpdateUser { get; set; }
public decimal? TotalCount { get; set; }//分摊总数(已分摊期初数+分摊数量)
public decimal? InitialQty { get; set; }//已分摊期初数
public decimal? Qty { get; set; }//分摊数量
public decimal? Count { get; set; }//累计分摊数量
// [Column(TypeName = "money")]
public decimal? Price { get; set; }
public bool IsDeleted { get; set; }
}
}

49
Models/ScpEntity/TB_FORECAST.cs

@ -20,25 +20,15 @@ namespace CK.SCP.Models.ScpEntity
/// <summary> /// <summary>
/// 零件编号 /// 零件编号
/// </summary> /// </summary>
[StringLength(50)] [StringLength(50)]
public string PoType { get; set; } public string PartCode { get; set; }
[StringLength(50)] /// </summary>
/// 供应商编号 /// 供应商编号
/// </summary> /// </summary>
public string VendId { get; set; } public string VendId { get; set; }
[StringLength(50)] /// <summary>
public string PartCode { get; set; } /// N+1
public int PoLine { get; set; }
[StringLength(50)]
public string Specifications { get; set; }
public string Unit { get; set; }
/// </summary> /// </summary>
public decimal Qty { get; set; }
public string ProductStatus { get; set; }
public string IsUrgent { get; set; }
public DateTime? ShippdedTime { get; set; }
public string ShippdedPlace { get; set; }
public decimal MonthQty { get; set; }
public decimal MonthQty1 { get; set; } public decimal MonthQty1 { get; set; }
/// <summary> /// <summary>
/// N+2 /// N+2
@ -48,21 +38,32 @@ namespace CK.SCP.Models.ScpEntity
/// N+3 /// N+3
/// </summary> /// </summary>
public decimal MonthQty3 { get; set; } public decimal MonthQty3 { get; set; }
/// <summary> /// <summary>
/// 月份
/// </summary>
public string Ontime { get; set; }
public string Datetime { get; set; }
[StringLength(50)]
public string Remark { get; set; }
/// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>
public int State { get; set; } public int State { get; set; }
/// <summary> /// <summary>
/// 地点 /// 地点
/// </summary> /// </summary>
[StringLength(50)]
public string Site { get; set; } public string Site { get; set; }
/// <summary>
/// 月份
/// </summary>
public string Month { get; set; }
public string PoType { get; set; }
public int PoLine { get; set; }
[StringLength(50)]
public string Specifications { get; set; }
public string Unit { get; set; }
public decimal Qty { get; set; }
public string ProductStatus { get; set; }
public string IsUrgent { get; set; }
public DateTime? ShippdedTime { get; set; }
public string ShippdedPlace { get; set; }
public decimal MonthQty { get; set; }
public string Ontime { get; set; }
public string Datetime { get; set; }
[StringLength(50)]
public string Remark { get; set; }
} }
} }

2
Models/ScpEntity/TB_INVOICE_DETAIL.cs

@ -19,6 +19,8 @@ namespace CK.SCP.Models.ScpEntity
[StringLength(50)] [StringLength(50)]
public string AsnBillNum { get; set; } public string AsnBillNum { get; set; }
[StringLength(50)] [StringLength(50)]
public string AskBillNum { get; set; }
[StringLength(50)]
public string PoBillNum { get; set; } public string PoBillNum { get; set; }
[DatabaseGenerated(DatabaseGeneratedOption.None)] [DatabaseGenerated(DatabaseGeneratedOption.None)]
public int PoLineNum { get; set; } public int PoLineNum { get; set; }

5
Models/ScpEntity/TS_BARCODE.cs

@ -99,6 +99,11 @@ namespace CK.SCP.Models.ScpEntity
public string PartName => ScpCache.GetPartDesc1(PartCode,Site); public string PartName => ScpCache.GetPartDesc1(PartCode,Site);
[NotMapped] [NotMapped]
public List<long> UIDList { get; set; } public List<long> UIDList { get; set; }
[DisplayName("是否扫描")]
public bool IsScanned { get; set; }
[DisplayName("是否扫描")]
[NotMapped]
public string IsScanned_Desc => IsScanned ? "已扫描" : "未扫描";
[NotMapped] [NotMapped]
public decimal CanQty { get; set; } public decimal CanQty { get; set; }

4
Models/ScpEntity/V_TB_ASK.cs

@ -50,6 +50,10 @@ namespace CK.SCP.Models.ScpEntity
public DateTime? BeginTime { get; set; } public DateTime? BeginTime { get; set; }
[NotMapped]//订货结束日期
public DateTime? BeginTime_End { get; set; }
[NotMapped]//到货开始日期
public DateTime? EndTime_start { get; set; }
public DateTime? EndTime { get; set; } public DateTime? EndTime { get; set; }
public string Extend1 { get; set; } public string Extend1 { get; set; }

5
Models/ScpEntity/V_TB_ASN_DETAIL.cs

@ -95,5 +95,10 @@ namespace CK.SCP.Models.ScpEntity
public string Extend3 { get; set; } public string Extend3 { get; set; }
public string SubSite { get; set; } public string SubSite { get; set; }
/// <summary>
/// 可退货数量
/// </summary>
[NotMapped]
public decimal CanRejectQty { get; set; }
} }
} }

28
Models/ScpEntity/V_TB_FORECAST.cs

@ -13,36 +13,34 @@ namespace CK.SCP.Models.ScpEntity
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; } public long UID { get; set; }
[StringLength(50)] [StringLength(50)]
public string PoType { get; set; } public string PartCode { get; set; }
[StringLength(50)] [StringLength(50)]
public string VendId { get; set; } public string VendId { get; set; }
public int? State { get; set; }
public decimal MonthQty1 { get; set; }
public decimal MonthQty2 { get; set; }
public decimal MonthQty3 { get; set; }
[StringLength(50)]
public string State_DESC { get; set; }
[StringLength(50)] [StringLength(50)]
public string PartCode { get; set; } public string Site { get; set; }
public string Month { get; set; }
[StringLength(50)]
public string PoType { get; set; }
public int PoLine { get; set; } public int PoLine { get; set; }
[StringLength(50)] [StringLength(50)]
public string Specifications { get; set; } public string Specifications { get; set; }
public string Unit { get; set; } public string Unit { get; set; }
public decimal Qty { get; set; } public decimal Qty { get; set; }
public string ProductStatus { get; set; } public string ProductStatus { get; set; }
public string IsUrgent { get; set; } public string IsUrgent { get; set; }
public DateTime? ShippdedTime { get; set; } public DateTime? ShippdedTime { get; set; }
public string ShippdedPlace { get; set; } public string ShippdedPlace { get; set; }
public decimal MonthQty { get; set; } public decimal MonthQty { get; set; }
public decimal MonthQty1 { get; set; }
public decimal MonthQty2 { get; set; }
public decimal MonthQty3 { get; set; }
public string Ontime { get; set; } public string Ontime { get; set; }
public string Datetime { get; set; } public string Datetime { get; set; }
[StringLength(50)] [StringLength(50)]
public string Remark { get; set; } public string Remark { get; set; }
public int? State { get; set; }
[StringLength(50)]
public string State_DESC { get; set; }
[StringLength(50)]
public string Site { get; set; }
} }
} }

1
Models/ScpEntity/V_TB_INCOMPLETE_ASK.cs

@ -34,7 +34,6 @@
[NotMapped] [NotMapped]
public decimal OnRoadQty { get; set; }//在途数量 public decimal OnRoadQty { get; set; }//在途数量
public DateTime? BeginTime { get; set; } public DateTime? BeginTime { get; set; }
public DateTime? EndTime { get; set; } public DateTime? EndTime { get; set; }
public int ValidityDays { get; set; } public int ValidityDays { get; set; }

2
Models/ScpEntity/V_TB_INVOICE.cs

@ -66,6 +66,8 @@ namespace CK.SCP.Models.ScpEntity
[StringLength(50)] [StringLength(50)]
public string DiscountRemark { get; set; } public string DiscountRemark { get; set; }
public bool IsRed { get; set; } public bool IsRed { get; set; }
public decimal? MoldSharingPrice { get; set; } //分摊价格
public string AskCreateUser { get; set; } //要货看板创建人
/// <summary> /// <summary>
/// 采购价 /// 采购价
/// </summary> /// </summary>

2
Models/ScpEntity/V_TB_INVOICE_DETAIL.cs

@ -22,6 +22,7 @@ namespace CK.SCP.Models.ScpEntity
public string PoBillNum { get; set; } public string PoBillNum { get; set; }
public int PoLineNum { get; set; } public int PoLineNum { get; set; }
public string AsnBillNum { get; set; } public string AsnBillNum { get; set; }
public string AskBillNum { get; set; }
public string PartCode { get; set; } public string PartCode { get; set; }
public string Batch { get; set; } public string Batch { get; set; }
public Nullable<System.DateTime> ProduceDate { get; set; } public Nullable<System.DateTime> ProduceDate { get; set; }
@ -29,6 +30,7 @@ namespace CK.SCP.Models.ScpEntity
public decimal Qty { get; set; } public decimal Qty { get; set; }
public string PoUnit { get; set; } public string PoUnit { get; set; }
public decimal Price { get; set; } public decimal Price { get; set; }
public decimal OldPrice { get; set; }
public string Currency { get; set; } public string Currency { get; set; }
public Nullable<decimal> PackQty { get; set; } public Nullable<decimal> PackQty { get; set; }
public Nullable<int> State { get; set; } public Nullable<int> State { get; set; }

6
Models/ScpEntity/V_TB_RECEIVE.cs

@ -58,6 +58,12 @@ namespace CK.SCP.Models.ScpEntity
public string ErpRecvBillNum { get; set; } public string ErpRecvBillNum { get; set; }
[NotMapped]
public DateTime ShipTimeStart { set; get; }
[NotMapped]
public DateTime ShipTimeEnd { set; get; }
public string Extend1 { get; set; } public string Extend1 { get; set; }
public string Extend2 { get; set; } public string Extend2 { get; set; }

2
Models/ScpEntity/V_TB_RECEIVE_DETAIL.cs

@ -71,8 +71,6 @@ namespace CK.SCP.Models.ScpEntity
[NotMapped] [NotMapped]
public string ProjectId { set; get; } public string ProjectId { set; get; }
public string Extend1 { get; set; } public string Extend1 { get; set; }
public string Extend2 { get; set; } public string Extend2 { get; set; }
public string Extend3 { get; set; } public string Extend3 { get; set; }

1
Models/ScpEntity/V_TB_RECEIVE_LIST.cs

@ -94,5 +94,6 @@ namespace CK.SCP.Models.ScpEntity
public string Tax { set; get; } public string Tax { set; get; }
public string AskCreateUser { get; set; }
} }
} }

48
Models/ScpEntity/V_TS_BARCODE.cs

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class V_TS_BARCODE
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[StringLength(50)]
public string BarCode { get; set; }
[Required]
[StringLength(50)]
public string PartCode { get; set; }
[Required]
[StringLength(50)]
public string Batch { get; set; }
[Column(TypeName = "money")]
public decimal Qty { get; set; }
[Required]
[StringLength(50)]
public string BillNum { get; set; }
public int PoBillLine { get; set; }
[StringLength(50)]
public string VendId { get; set; }
[StringLength(50)]
public string VendBatch { get; set; }
[DisplayName("是否扫描")]
public bool IsScanned { get; set; }
[DisplayName("是否描述")]
public string IsScanned_Desc { get; set; }
[Column(TypeName = "money")]
public decimal PackQty { get; set; }
public string Site { get; set; }
[NotMapped]
public List<string> UserInVendIds { set; get; }
[NotMapped]
public List<string> UserInAddress { set; get; }
}
}

37
Models/WmsEntity/VIEW_STOCK_REPORT.cs

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ChangKeTec.Wms.Models.Wms
{
public partial class VIEW_STOCK_REPORT
{
[Key]
[Column(Order = 0)]
[StringLength(50)]
public string PartCode { get; set; }
[Key]
[Column(Order = 2)]
public string VendId { get; set; }
/// <summary>
/// WMS待检验数量
/// </summary>
public decimal InspectQty { get; set; }
/// <summary>
/// WMS合格数量
/// </summary>
public decimal QualifiedQty { get; set; }
/// <summary>
/// SCP待开票数量
/// </summary>
[NotMapped]
public decimal InvoiceQty { get; set; }
[NotMapped]
public List<string> UserInVendIds { set; get; }
}
}

1
Models/WmsEntity/WmsEntities.cs

@ -22,6 +22,7 @@ namespace ChangKeTec.Wms.Models.Wms
public virtual DbSet<VIEW_PRODUCT_DETAIL> VIEW_PRODUCT_DETAIL { get; set; } public virtual DbSet<VIEW_PRODUCT_DETAIL> VIEW_PRODUCT_DETAIL { get; set; }
public virtual DbSet<VIEW_STOCK_VEND> VIEW_STOCK_VEND { get; set; } public virtual DbSet<VIEW_STOCK_VEND> VIEW_STOCK_VEND { get; set; }
public virtual DbSet<VIEW_STOCK_QTY> VIEW_STOCK_QTY { get; set; } public virtual DbSet<VIEW_STOCK_QTY> VIEW_STOCK_QTY { get; set; }
public virtual DbSet<VIEW_STOCK_REPORT> VIEW_STOCK_REPORT { get; set; }
public virtual DbSet<TA_BILLTYPE> TA_BILLTYPE { get; set; } public virtual DbSet<TA_BILLTYPE> TA_BILLTYPE { get; set; }
public virtual DbSet<TA_BOM> TA_BOM { get; set; } public virtual DbSet<TA_BOM> TA_BOM { get; set; }
public virtual DbSet<TA_CELL> TA_CELL { get; set; } public virtual DbSet<TA_CELL> TA_CELL { get; set; }

54
SCP/Admin/UNIAPI.aspx

@ -0,0 +1,54 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UNIAPI.aspx.cs" Inherits="SCP.Admin.UNIAPI" %>
<!DOCTYPE html>
<!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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:DropDownList runat="server" ID="DDL_State" Label="查询接口">
<f:ListItem Text="订单接口" Value="xxqad_pod_det"/>
<f:ListItem Text="QAD收货单接口" Value="xxqad_prh_det" />
<f:ListItem Text="WMS收货单接口" Value="xxwms_rc_det" />
<f:ListItem Text="发货单接口" Value="xxscm_tx_mstr" />
<f:ListItem Text="发票接口" Value="xxscm_inv_det" />
</f:DropDownList>
<f:TextArea runat="server" Label="单据号" ID="TXT_billnum" Width="600" ></f:TextArea>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Grid ID = "Grid" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "true" runat ="server"
>
<Columns>
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

88
SCP/Admin/UNIAPI.aspx.cs

@ -0,0 +1,88 @@
using CK.SCP.Controller;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Admin
{
public partial class UNIAPI : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Bind();
}
}
private void Bind()
{
var _domain = Request["Domain"];
var _billNum =TXT_billnum.Text= Request.Params["BillNum"];
var _tableName=DDL_State.SelectedValue= Request.Params["TableName"];
if (!string.IsNullOrEmpty(_billNum) && !string.IsNullOrEmpty(_domain) && !string.IsNullOrEmpty(_tableName))
{
var _ary = _billNum.Split(new char[] { ',' }).ToList();
var sqlstr = string.Empty;
_ary.ForEach(p =>
{
sqlstr += string.Format("'{0}',", p);
});
sqlstr = sqlstr.Substring(0, sqlstr.Length - 1);
DataTable _dt = UniApiController.FindUniapi(_tableName, sqlstr, _domain);
foreach (DataColumn column in _dt.Columns)
{
FineUI.BoundField bf;
bf = new FineUI.BoundField();
bf.DataField = column.ColumnName;
bf.SortField = column.ColumnName;
bf.HeaderText = column.ColumnName;
Grid.Columns.Add(bf);
}
Grid.DataSource = _dt;
Grid.DataBind();
}
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
StringBuilder _buffer = new StringBuilder();
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_buffer.AppendFormat("TableName={0}&&", DDL_State.SelectedValue);
}
if (!string.IsNullOrEmpty(TXT_billnum.Text))
{
_buffer.AppendFormat("BillNum={0}&&", TXT_billnum.Text);
}
string s = _buffer.ToString();
PageContext.Redirect(string.Format("UNIAPI.aspx?{0}", s));
}
}
}

78
SCP/Admin/UNIAPI.aspx.designer.cs

@ -0,0 +1,78 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Admin {
public partial class UNIAPI {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// TXT_billnum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextArea TXT_billnum;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// Grid 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid;
}
}

15
SCP/Business/PageBase.cs

@ -275,7 +275,20 @@ namespace SCP
} }
} }
} }
protected void IsPriceEdit(Grid p_grid, params string[] p_str)
{
if (CurrentUser.RoleList.Contains("查看价格"))
{
foreach (var itm in p_grid.Columns)
{
if (p_str.Contains(itm.HeaderText))
{
itm.Hidden = false;
itm.Enabled = false;
}
}
}
}
public void UpdateDataRow<T>(Dictionary<string, object> rowDict, T entity) public void UpdateDataRow<T>(Dictionary<string, object> rowDict, T entity)
{ {

60
SCP/Common/MailHelper.cs

@ -71,14 +71,21 @@ namespace SCP.Common
{ {
using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance()) using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance())
{ {
var _userList=db.Users.Where(p => p.SupplierCode == p_VendId).ToList(); StringBuilder _buffer = new StringBuilder();
_buffer.Append("SELECT b.Email ");
_buffer.Append(" FROM VenderUsers AS a INNER JOIN ");
_buffer.Append(" Users AS b ON a.UserId = b.ID INNER JOIN ");
_buffer.Append(" RoleUsers AS g ON a.UserId = g.UserID INNER JOIN ");
_buffer.Append(" Roles AS h ON g.RoleID = h.ID ");
_buffer.AppendFormat(" WHERE(h.Name = '供应商' and a.VenderId='{0}' ) ", p_VendId);
var _userList = db.Database.SqlQuery<string>(_buffer.ToString()).ToList();
//var _vender = ScpCache.VenderList.Where(itm => itm.VendId == p_VendId).FirstOrDefault(); //var _vender = ScpCache.VenderList.Where(itm => itm.VendId == p_VendId).FirstOrDefault();
if (_userList != null && _userList.Count>0) if (_userList != null && _userList.Count>0)
{ {
foreach (var itm in _userList) foreach (var itm in _userList)
{ {
string mails = ""; string mails = "";
mails += itm.Email + ","; mails += itm + ",";
if (mails != "") if (mails != "")
{ {
mails = mails.Substring(0, mails.Length - 1); mails = mails.Substring(0, mails.Length - 1);
@ -94,7 +101,56 @@ namespace SCP.Common
} }
} }
} }
/// <summary>
/// 发邮件给采购
/// </summary>
/// <param name="p_VendId"></param>
/// <param name="p_Content"></param>
/// <param name="p_title"></param>
/// <param name="p_site"></param>
public static void SendMailToUser(string p_VendId, string p_Content, string p_title, string p_site)
{
try
{
using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance())
{
StringBuilder _buffer = new StringBuilder();
_buffer.Append("SELECT b.Email ");
_buffer.Append(" FROM VenderUsers AS a INNER JOIN ");
_buffer.Append(" Users AS b ON a.UserId = b.ID INNER JOIN ");
_buffer.Append(" FactoryUsers AS c ON a.UserId = c.UserID INNER JOIN ");
_buffer.Append(" TA_FACTORY AS d ON c.FACTORY_ID = d.ID INNER JOIN ");
_buffer.Append(" RoleUsers AS g ON a.UserId = g.UserID INNER JOIN ");
_buffer.Append(" Roles AS h ON g.RoleID = h.ID ");
_buffer.AppendFormat(" WHERE(h.Name = '采购人员' and a.VenderId='{0}' and d.FactoryId='{1}' ) ", p_VendId, p_site);
var _userList = db.Database.SqlQuery<string>(_buffer.ToString()).ToList();
if (_userList != null && _userList.Count > 0)
{
foreach (var itm in _userList)
{
string mails = "";
mails += itm + ",";
if (mails != "")
{
mails = mails.Substring(0, mails.Length - 1);
}
string mailbody = "";
mailbody += "尊敬的采购计划人员<br>";
mailbody += "你好!<br><br>";
mailbody += "<b>" + p_Content + "</b> ,请到供应商协同网站" + HttpContext.Current.Request.Url.Host + "打开查看!<br>";
mailbody += "<br><br><br><br>日期:" + DateTime.Now;
MyWebSmtpMail webmail = new MyWebSmtpMail();
webmail.Send(mails, mailbody, p_title);
}
}
}
}
catch (Exception e)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "MailManager", e.Message);
}
}
public static void SendCompanyMail(string p_tl,string p_User, string p_Content, string p_title) public static void SendCompanyMail(string p_tl,string p_User, string p_Content, string p_title)
{ {

140
SCP/SCP.csproj

@ -197,6 +197,7 @@
<Content Include="Admin\title_new.aspx" /> <Content Include="Admin\title_new.aspx" />
<Content Include="Admin\title_user.aspx" /> <Content Include="Admin\title_user.aspx" />
<Content Include="Admin\title_user_addnew.aspx" /> <Content Include="Admin\title_user_addnew.aspx" />
<Content Include="Admin\UNIAPI.aspx" />
<Content Include="Admin\user.aspx" /> <Content Include="Admin\user.aspx" />
<Content Include="Admin\user_changepassword.aspx" /> <Content Include="Admin\user_changepassword.aspx" />
<Content Include="Admin\user_edit.aspx" /> <Content Include="Admin\user_edit.aspx" />
@ -254,6 +255,8 @@
<Content Include="Views\BasicData\SCP_FACTORY.aspx" /> <Content Include="Views\BasicData\SCP_FACTORY.aspx" />
<Content Include="Views\BasicData\SCP_FACTORY_EDIT.aspx" /> <Content Include="Views\BasicData\SCP_FACTORY_EDIT.aspx" />
<Content Include="Views\BasicData\SCP_LANGUAGE.aspx" /> <Content Include="Views\BasicData\SCP_LANGUAGE.aspx" />
<Content Include="Views\BasicData\SCP_MoldSharing.aspx" />
<Content Include="Views\BasicData\SCP_MOLDSHARING_DETAIL.aspx" />
<Content Include="Views\BasicData\SCP_RECIVE_PORT.aspx" /> <Content Include="Views\BasicData\SCP_RECIVE_PORT.aspx" />
<Content Include="Views\BasicData\SCP_TA_VEND_PART.aspx" /> <Content Include="Views\BasicData\SCP_TA_VEND_PART.aspx" />
<Content Include="Views\BasicData\SCP_VenderUser.aspx" /> <Content Include="Views\BasicData\SCP_VenderUser.aspx" />
@ -4516,36 +4519,36 @@
<Content Include="Views\WarehouseData\SCP_RECEIVE_DETAIL.aspx" /> <Content Include="Views\WarehouseData\SCP_RECEIVE_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASK.aspx" /> <Content Include="Views\沈阳金杯\PlanData\SCP_ASK.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL.aspx" /> <Content Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL_PARTCODE.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASN.aspx" /> <Content Include="Views\沈阳金杯\PlanData\SCP_ASN.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx" /> <Content Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_FORECAST.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_PRODUCT_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_FORECAST_REPORT.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx" /> <Content Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT.aspx" /> <Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT_VendID.aspx" /> <Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT_VendID.aspx" />
<Content Include="Views\沈阳金杯\SCP_ARRIVE.aspx" /> <Content Include="Views\沈阳金杯\SCP_ARRIVE.aspx" />
<Content Include="Views\沈阳金杯\SCP_ARRIVE_DETAIL.aspx" /> <Content Include="Views\沈阳金杯\SCP_ARRIVE_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SCP_PO.aspx" />
<Content Include="Views\沈阳金杯\SCP_PO_ARRIVE.aspx" />
<Content Include="Views\沈阳金杯\SCP_PO_STATISTICS.aspx" />
<Content Include="Views\沈阳金杯\SCP_PO_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASK.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_ASK.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASK_DETAIL.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_ASK_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASN.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_ASN.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASN_CREATE.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_ASN_CREATE.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL_Modify.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_FORECAST.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_INVOICE.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_INVOICE.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_INVOICE_CREATE.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_INVOICE_CREATE.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_INVOICE_EDIT.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_INVOICE_EDIT.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_PRODUCT_DETAIL.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_PRODUCT_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\SupplierData\SCP_RECEIVE_LIST.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_RECEIVE_LIST.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL_RED.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_TS_BARCODE.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_RED.aspx" /> <Content Include="Views\沈阳金杯\SupplierData\SCP_WMS_STOCK_REPORT.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE.aspx" /> <Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_CHECKFAIL.aspx" /> <Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_CHECKFAIL.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_CONFIRM.aspx" /> <Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_CONFIRM.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_CONFIRM_DETAIL.aspx" /> <Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_CONFIRM_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL.aspx" /> <Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_DETAIL_RED.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_RED.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW.aspx" /> <Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_DETAIL.aspx" /> <Content Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\WarehouseData\SCP_RECEIVE.aspx" /> <Content Include="Views\沈阳金杯\WarehouseData\SCP_RECEIVE.aspx" />
@ -4793,6 +4796,13 @@
<Compile Include="Admin\title_user_addnew.aspx.designer.cs"> <Compile Include="Admin\title_user_addnew.aspx.designer.cs">
<DependentUpon>title_user_addnew.aspx</DependentUpon> <DependentUpon>title_user_addnew.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Admin\UNIAPI.aspx.cs">
<DependentUpon>UNIAPI.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Admin\UNIAPI.aspx.designer.cs">
<DependentUpon>UNIAPI.aspx</DependentUpon>
</Compile>
<Compile Include="Admin\user.aspx.cs"> <Compile Include="Admin\user.aspx.cs">
<DependentUpon>user.aspx</DependentUpon> <DependentUpon>user.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -4976,6 +4986,20 @@
<Compile Include="Views\BasicData\SCP_LANGUAGE.aspx.designer.cs"> <Compile Include="Views\BasicData\SCP_LANGUAGE.aspx.designer.cs">
<DependentUpon>SCP_LANGUAGE.aspx</DependentUpon> <DependentUpon>SCP_LANGUAGE.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\BasicData\SCP_MoldSharing.aspx.cs">
<DependentUpon>SCP_MoldSharing.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\BasicData\SCP_MoldSharing.aspx.designer.cs">
<DependentUpon>SCP_MoldSharing.aspx</DependentUpon>
</Compile>
<Compile Include="Views\BasicData\SCP_MOLDSHARING_DETAIL.aspx.cs">
<DependentUpon>SCP_MOLDSHARING_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\BasicData\SCP_MOLDSHARING_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_MOLDSHARING_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\BasicData\SCP_RECIVE_PORT.aspx.cs"> <Compile Include="Views\BasicData\SCP_RECIVE_PORT.aspx.cs">
<DependentUpon>SCP_RECIVE_PORT.aspx</DependentUpon> <DependentUpon>SCP_RECIVE_PORT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5678,6 +5702,13 @@
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL.aspx.designer.cs"> <Compile Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ASK_DETAIL.aspx</DependentUpon> <DependentUpon>SCP_ASK_DETAIL.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL_PARTCODE.aspx.cs">
<DependentUpon>SCP_ASK_DETAIL_PARTCODE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL_PARTCODE.aspx.designer.cs">
<DependentUpon>SCP_ASK_DETAIL_PARTCODE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASN.aspx.cs"> <Compile Include="Views\沈阳金杯\PlanData\SCP_ASN.aspx.cs">
<DependentUpon>SCP_ASN.aspx</DependentUpon> <DependentUpon>SCP_ASN.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5692,6 +5723,27 @@
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx.designer.cs"> <Compile Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx.designer.cs">
<DependentUpon>SCP_ASN_LIST.aspx</DependentUpon> <DependentUpon>SCP_ASN_LIST.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_FORECAST.aspx.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_FORECAST.aspx.designer.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_PRODUCT_DETAIL.aspx.cs">
<DependentUpon>SCP_PRODUCT_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\PlanData\SCP_PRODUCT_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_PRODUCT_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\Report\SCP_FORECAST_REPORT.aspx.cs">
<DependentUpon>SCP_FORECAST_REPORT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\Report\SCP_FORECAST_REPORT.aspx.designer.cs">
<DependentUpon>SCP_FORECAST_REPORT.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx.cs"> <Compile Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx.cs">
<DependentUpon>SCP_INCOMPLETE_ASK.aspx</DependentUpon> <DependentUpon>SCP_INCOMPLETE_ASK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5727,34 +5779,6 @@
<Compile Include="Views\沈阳金杯\SCP_ARRIVE_DETAIL.aspx.designer.cs"> <Compile Include="Views\沈阳金杯\SCP_ARRIVE_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ARRIVE_DETAIL.aspx</DependentUpon> <DependentUpon>SCP_ARRIVE_DETAIL.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\SCP_PO.aspx.cs">
<DependentUpon>SCP_PO.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO.aspx.designer.cs">
<DependentUpon>SCP_PO.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_ARRIVE.aspx.cs">
<DependentUpon>SCP_PO_ARRIVE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_ARRIVE.aspx.designer.cs">
<DependentUpon>SCP_PO_ARRIVE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_STATISTICS.aspx.cs">
<DependentUpon>SCP_PO_STATISTICS.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_STATISTICS.aspx.designer.cs">
<DependentUpon>SCP_PO_STATISTICS.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_DETAIL.aspx.cs">
<DependentUpon>SCP_PO_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SCP_PO_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_PO_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_ASK.aspx.cs"> <Compile Include="Views\沈阳金杯\SupplierData\SCP_ASK.aspx.cs">
<DependentUpon>SCP_ASK.aspx</DependentUpon> <DependentUpon>SCP_ASK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5790,6 +5814,20 @@
<Compile Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL.aspx.designer.cs"> <Compile Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ASN_DETAIL.aspx</DependentUpon> <DependentUpon>SCP_ASN_DETAIL.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL_Modify.aspx.cs">
<DependentUpon>SCP_ASN_DETAIL_Modify.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_ASN_DETAIL_Modify.aspx.designer.cs">
<DependentUpon>SCP_ASN_DETAIL_Modify.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_FORECAST.aspx.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_FORECAST.aspx.designer.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\SupplierData\SCP_INVOICE.aspx.cs"> <Compile Include="Views\沈阳金杯\SupplierData\SCP_INVOICE.aspx.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon> <DependentUpon>SCP_INVOICE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5825,19 +5863,19 @@
<Compile Include="Views\沈阳金杯\SupplierData\SCP_RECEIVE_LIST.aspx.designer.cs"> <Compile Include="Views\沈阳金杯\SupplierData\SCP_RECEIVE_LIST.aspx.designer.cs">
<DependentUpon>SCP_RECEIVE_LIST.aspx</DependentUpon> <DependentUpon>SCP_RECEIVE_LIST.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL_RED.aspx.cs"> <Compile Include="Views\沈阳金杯\SupplierData\SCP_TS_BARCODE.aspx.cs">
<DependentUpon>SCP_INVOICE_DELTAIL_RED.aspx</DependentUpon> <DependentUpon>SCP_TS_BARCODE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL_RED.aspx.designer.cs"> <Compile Include="Views\沈阳金杯\SupplierData\SCP_TS_BARCODE.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_DELTAIL_RED.aspx</DependentUpon> <DependentUpon>SCP_TS_BARCODE.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_RED.aspx.cs"> <Compile Include="Views\沈阳金杯\SupplierData\SCP_WMS_STOCK_REPORT.aspx.cs">
<DependentUpon>SCP_INVOICE_RED.aspx</DependentUpon> <DependentUpon>SCP_WMS_STOCK_REPORT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_RED.aspx.designer.cs"> <Compile Include="Views\沈阳金杯\SupplierData\SCP_WMS_STOCK_REPORT.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_RED.aspx</DependentUpon> <DependentUpon>SCP_WMS_STOCK_REPORT.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE.aspx.cs"> <Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE.aspx.cs">
<DependentUpon>SCP_INVOICE.aspx</DependentUpon> <DependentUpon>SCP_INVOICE.aspx</DependentUpon>
@ -5874,20 +5912,6 @@
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL.aspx.designer.cs"> <Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_DELTAIL.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_DELTAIL.aspx</DependentUpon> <DependentUpon>SCP_INVOICE_DELTAIL.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_DETAIL_RED.aspx.cs">
<DependentUpon>SCP_INVOICE_VIEW_DETAIL_RED.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_DETAIL_RED.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_VIEW_DETAIL_RED.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_RED.aspx.cs">
<DependentUpon>SCP_INVOICE_VIEW_RED.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW_RED.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_VIEW_RED.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW.aspx.cs"> <Compile Include="Views\沈阳金杯\WarehouseData\SCP_INVOICE_VIEW.aspx.cs">
<DependentUpon>SCP_INVOICE_VIEW.aspx</DependentUpon> <DependentUpon>SCP_INVOICE_VIEW.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

76
SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx

@ -0,0 +1,76 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MOLDSHARING_DETAIL.aspx.cs" Inherits="SCP.Views.BasicData.SCP_MOLDSHARING_DETAIL" %>
<!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" Title="">
<Items>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items>
<f:TextBox ID="TextVendId" runat="server" Label="供应商" Text="" Width="600" Readonly="true">
</f:TextBox>
<f:TextBox ID="TextPartCode" runat="server" Label="零件编号" Text="" Width="600" Readonly="true">
</f:TextBox>
<f:TextBox ID="TextPrice" runat="server" Label="价格" Text="" Width="600" Readonly="true" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items>
<f:TextBox ID="TextTotal" runat="server" Label="分摊总量" Text="" Width="600" Readonly="true">
</f:TextBox>
<f:TextBox ID="TexInitialQty" runat="server" Label="初始已分摊数量" Text="" Width="600" Readonly="true">
</f:TextBox>
<f:TextBox ID="TextCount" runat="server" Label="已累计数量" Text="" Width="600" Readonly="true" />
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Toolbar runat="server">
<Items>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_OnClick">
</f:Button>
<f:ToolbarFill runat="server" />
</Items>
</f:Toolbar>
<f:Grid ID="Grid_MOLDSHARING_DETAIL" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="" IsDatabasePaging="True" AllowPaging="True" SortField="PartCode" SortDirection="DESC"
EnableRowSelectEvent="False" AutoScroll="True" OnPageIndexChange="Grid1_OnPageIndexChange">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_OnSelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
<f:ListItem Text="1000" Value="1000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="InvcBillNum" DataField="InvcBillNum" HeaderText="发票号" ColumnID="InvcBillNum" Width="100px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件编号" ColumnID="PartCode" Width="120px" />
<f:BoundField SortField="PoLineNum" DataField="PoLineNum" HeaderText="订单行" ColumnID="PoLineNum" Width="60px" />
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="Qty" Width="60px" />
<f:BoundField SortField="Price" DataField="Price" HeaderText="价格" ColumnID="Price" Width="60px" />
<f:BoundField SortField="RecvBillNum" DataField="RecvBillNum" HeaderText="WM单号" ColumnID="RecvBillNum" Width="80px" />
<f:BoundField SortField="ErpRecvBillNum" DataField="ErpRecvBillNum" HeaderText="ERP单号" ColumnID="ErpRecvBillNum" Width="80px" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

88
SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx.cs

@ -0,0 +1,88 @@
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.BasicData
{
public partial class SCP_MOLDSHARING_DETAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
BindData();
}
}
public void LoadData()
{
var item = new TA_MOLDSHARING();
item.UID =long.Parse( GetQueryValue("ID"));
SCP_MoldSharing_Controller.Get_V_TA_MoldSharing_List(item, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
var _rec = _ret.Result.FirstOrDefault();
TextVendId.Text = _rec.VendId;
TextPartCode.Text = _rec.PartCode;
TextPrice.Text = _rec.Price.ToString();
TextTotal.Text = _rec.TotalCount.ToString();
TexInitialQty.Text = _rec.InitialQty.ToString();
TextCount.Text = _rec.Count.ToString();
}
});
}
public void BindData()
{
var _entity = new TA_MOLDSHARING_INVOICE();
_entity.MoldSharingId = long.Parse(GetQueryValue("ID"));
SCP_MoldSharing_Controller.Get_V_TA_MOLDSHARING_INVOICE_List(_entity, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
Grid_MOLDSHARING_DETAIL.RecordCount = ret.Result.Count();
var _ls = SortAndPage(ret.Result, Grid_MOLDSHARING_DETAIL);
Grid_MOLDSHARING_DETAIL.DataSource = _ls;
Grid_MOLDSHARING_DETAIL.DataBind();
}
});
}
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e)
{
Grid_MOLDSHARING_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{
Grid_MOLDSHARING_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void btnOutput_OnClick(object sender, EventArgs e)
{
var _entity = new TA_MOLDSHARING_INVOICE();
_entity.MoldSharingId= long.Parse(GetQueryValue("ID"));
SCP_MoldSharing_Controller.Get_V_TA_MOLDSHARING_INVOICE_List(_entity, (ret) =>
{
if (ret.State == ReturnStatus.Succeed)
{
Dictionary<string, string> cellheader = new Dictionary<string, string> {
{ "InvcBillNum", "发票号" },
{ "PartCode", "零件编号" },
{ "PoLineNum", "订单行" },
{ "Qty", "数量" },
{ "Price", "价格" },
};
string url = EntityListToExcel2003(cellheader, ret.Result.ToList(), "分摊明细");
}
});
}
}
}

134
SCP/Views/BasicData/SCP_MOLDSHARING_DETAIL.aspx.designer.cs

@ -0,0 +1,134 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.BasicData
{
public partial class SCP_MOLDSHARING_DETAIL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// TextVendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextVendId;
/// <summary>
/// TextPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPartCode;
/// <summary>
/// TextPrice 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPrice;
/// <summary>
/// TextTotal 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextTotal;
/// <summary>
/// TexInitialQty 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TexInitialQty;
/// <summary>
/// TextCount 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextCount;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// Grid_MOLDSHARING_DETAIL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_MOLDSHARING_DETAIL;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

92
SCP/Views/BasicData/SCP_MoldSharing.aspx

@ -0,0 +1,92 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MoldSharing.aspx.cs" Inherits="SCP.Views.BasicData.SCP_MoldSharing" %>
<!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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="BtnRefersh" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</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:Button ID="BtnOutPut" runat="server" EnablePostBack="True" Text="导出" Icon="Add" Hidden="true">
</f:Button>
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_OnClick">
</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:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox">
<Items>
<f:Form runat="server" BodyPadding="10px">
<Rows>
<f:FormRow runat="server" ColumnWidths="50% 50%">
<Items>
<f:Label runat="server" Label="供应商编号" />
<f:TextBox ID="textVendId" runat="server" />
<f:Label runat="server" Label="零件编码" />
<f:TextBox ID="textPartCode" runat="server" />
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:Button runat="server" ID="btnClose" Text="关闭" OnClick="btnClose_OnClick"></f:Button>
<f:Button ID="btnSearch" runat="server" OnClick="btnSearch_OnClick" Text="快速查找">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableRowDoubleClickEvent="True"
runat="server" DataKeyNames="UID,VendId" IsDatabasePaging="true" AllowPaging="True" OnPageIndexChange="Grid1_OnPageIndexChange"
EnableRowSelectEvent="True" AutoScroll="True" SortField="VendId" SortDirection="ASC" AllowSorting="True" OnRowDoubleClick="Grid1_RowDoubleClick">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_OnSelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
<f:ListItem Text="1000" Value="1000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" SortField="VendId" />
<f:BoundField runat="server" HeaderText="零件编码" ColumnID="" DataField="PartCode" SortField="PartCode" />
<f:BoundField runat="server" HeaderText="价格" ColumnID="" DataField="Price" SortField="Price" />
<f:BoundField runat="server" HeaderText="分摊总量" DataFormatString="{0:F0}" ColumnID="" DataField="TotalCount" SortField="TotalCount" />
<f:BoundField runat="server" HeaderText="初始已分摊数量" DataFormatString="{0:F0}" ColumnID="" DataField="InitialQty" SortField="InitialQty" />
<f:BoundField runat="server" HeaderText="分摊数量" DataFormatString="{0:F0}" ColumnID="" DataField="Qty" SortField="Qty" />
<f:BoundField runat="server" HeaderText="已累计数量" DataFormatString="{0:F0}" ColumnID="" DataField="Count" SortField="Count" />
<f:BoundField runat="server" HeaderText="创建人" ColumnID="" DataField="CreateUser" SortField="CreateUser" />
<f:BoundField runat="server" HeaderText="创建时间" ColumnID="" DataField="CreateTime" SortField="CreateTime" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1024px" AutoScroll="True"
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true" OnClose="Window1_Close" CloseAction="HidePostBack"
IFrameUrl="about:blank" />
</form>
</body>
</html>

175
SCP/Views/BasicData/SCP_MoldSharing.aspx.cs

@ -0,0 +1,175 @@
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.BasicData
{
public partial class SCP_MoldSharing : PageBase
{
/// <summary>
/// 页面加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindData()
{
SearchV_TA_MoldSharingData((result) =>
{
Grid1.RecordCount = result.Count();
var list = SortAndPage<TA_MOLDSHARING>(result, Grid1);
Grid1.DataSource = list;
Grid1.DataBind();
});
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_TA_MoldSharingData(Action<IQueryable<TA_MOLDSHARING>> p_action)
{
TA_MOLDSHARING _entity = new TA_MOLDSHARING();
_entity.PartCode = textPartCode.Text;
_entity.VendId = textVendId.Text;
SCP_MoldSharing_Controller.Get_V_TA_MoldSharing_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
/// <summary>
/// 显示查询面板事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnShow_OnClick(object sender, EventArgs e)
{
gp1.Hidden = false;
}
/// <summary>
/// 关闭显示查询面板事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnClose_OnClick(object sender, EventArgs e)
{
gp1.Hidden = true;
}
/// <summary>
/// 查询事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void btnSearch_OnClick(object sender, EventArgs e)
{
BindData();
}
/// <summary>
/// 导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void btnInput_Click(object sender, EventArgs e)
{
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_MOLDSHARING_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
var ret = SCP_MoldSharing_Controller.EXCEL_MOLDSHARING_MOD(list, CurrentUser.FactoryList[0], CurrentUser.Name);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{
BindData();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
}
}
/// <summary>
/// 删除数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
int[] _selections = Grid1.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid1.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_MoldSharing_Controller.Save_TA_MOLDSHARING_STATE(_UidList, CurrentUser.Name, true);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
object[] rowDataKeys = Grid1.DataKeys[e.RowIndex];
string UID = rowDataKeys[0].ToString();
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../BasicData/SCP_MOLDSHARING_DETAIL.aspx?ID={0}", UID)));
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindData();
}
}
}

73
SCP/Views/沈阳金杯/SCP_PO_DETAIL.aspx.designer.cs → SCP/Views/BasicData/SCP_MoldSharing.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.SYJB { namespace SCP.Views.BasicData
{
public partial class SCP_PO_DETAIL { public partial class SCP_MoldSharing
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -40,94 +42,112 @@ namespace SCP.SYJB {
protected global::FineUI.Toolbar Toolbar2; protected global::FineUI.Toolbar Toolbar2;
/// <summary> /// <summary>
/// BTN_REFRESH 控件。 /// BtnRefersh 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button BTN_REFRESH; protected global::FineUI.Button BtnRefersh;
/// <summary> /// <summary>
/// BTN_RELESE 控件。 /// btnDelete 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button BTN_RELESE; protected global::FineUI.Button btnDelete;
/// <summary> /// <summary>
/// TXT_State_DESC 控件。 /// BtnOutPut 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_State_DESC; protected global::FineUI.Button BtnOutPut;
/// <summary> /// <summary>
/// TXT_PoBillNum 控件。 /// btnShow 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_PoBillNum; protected global::FineUI.Button btnShow;
/// <summary> /// <summary>
/// TXT_VendName 控件。 /// FileUp 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_VendName; protected global::FineUI.FileUpload FileUp;
/// <summary> /// <summary>
/// DP_BeginTime 控件。 /// btnInput 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DatePicker DP_BeginTime; protected global::FineUI.Button btnInput;
/// <summary> /// <summary>
/// TXT_Site 控件。 /// gp1 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_Site; protected global::FineUI.GroupPanel gp1;
/// <summary> /// <summary>
/// txtRemark 控件。 /// textVendId 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox txtRemark; protected global::FineUI.TextBox textVendId;
/// <summary> /// <summary>
/// HF_GRID_INDEX 控件。 /// textPartCode 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.HiddenField HF_GRID_INDEX; protected global::FineUI.TextBox textPartCode;
/// <summary> /// <summary>
/// Grid_V_TB_PO_DETAIL 控件。 /// btnClose 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Grid Grid_V_TB_PO_DETAIL; protected global::FineUI.Button btnClose;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSearch;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary> /// <summary>
/// ToolbarSeparator1 控件。 /// ToolbarSeparator1 控件。
@ -164,14 +184,5 @@ namespace SCP.SYJB {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Window Window1; protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
} }
} }

17
SCP/Views/BasicData/Supplier.aspx

@ -10,13 +10,13 @@
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> <f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> <f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items> <Items>
<f:Form runat="server"> <f:Form runat="server">
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar2" runat="server"> <f:Toolbar ID="Toolbar2" runat="server">
<Items> <Items>
<f:Button ID="BtnRefersh" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload"> <f:Button ID="BtnRefersh" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button> </f:Button>
<f:Button ID="BtnOutPut" runat="server" EnablePostBack="True" Text="导出" Icon="PageExcel" OnClick="BtnOutPut_OnClick"> <f:Button ID="BtnOutPut" runat="server" EnablePostBack="True" Text="导出" Icon="PageExcel" OnClick="BtnOutPut_OnClick">
</f:Button> </f:Button>
@ -76,6 +76,19 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="20" BoxFlex="1" CssClass="maingrid" <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="20" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="VendId" IsDatabasePaging="False" AllowPaging="True" OnPageIndexChange="Grid1_OnPageIndexChange" runat="server" DataKeyNames="VendId" IsDatabasePaging="False" AllowPaging="True" OnPageIndexChange="Grid1_OnPageIndexChange"
EnableRowSelectEvent="True" AutoScroll="True" OnSort="Grid1_OnSort" SortField="VendName" SortDirection="ASC" AllowSorting="True"> EnableRowSelectEvent="True" AutoScroll="True" OnSort="Grid1_OnSort" SortField="VendName" SortDirection="ASC" AllowSorting="True">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" 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="20" Value="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns> <Columns>
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" SortField="VendId" /> <f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" SortField="VendId" />
<f:BoundField runat="server" HeaderText="供应商名称" ColumnID="" DataField="VendName" SortField="VendName" /> <f:BoundField runat="server" HeaderText="供应商名称" ColumnID="" DataField="VendName" SortField="VendName" />

44
SCP/Views/BasicData/Supplier.aspx.cs

@ -42,7 +42,8 @@ namespace SCP.BasicData
_ls.Insert(0, new TB_FACTORY() { FactoryId = "", FactoryName = "" }); _ls.Insert(0, new TB_FACTORY() { FactoryId = "", FactoryName = "" });
DPL_Factory.DataSource = _ls; DPL_Factory.DataSource = _ls;
DPL_Factory.DataBind(); DPL_Factory.DataBind();
_list = SCP_TB_VENDER_CONTROLLER.Getlist(); // _list = SCP_TB_VENDER_CONTROLLER.Getlist();
_list= SearchData();
var list = Sort<TA_VENDER>(_list.AsQueryable(), Grid1); var list = Sort<TA_VENDER>(_list.AsQueryable(), Grid1);
Grid1.DataSource = list; Grid1.DataSource = list;
@ -120,7 +121,38 @@ namespace SCP.BasicData
Alert.Show(string.Join("<br>", ret.MessageList)); Alert.Show(string.Join("<br>", ret.MessageList));
} }
} }
//public void BtnSave_OnClick(object sender, EventArgs e)
//{
// List<TA_VENDER> _list = new List<TA_VENDER>();
// for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
// {
// GridRow row = Grid1.Rows[i];
// TA_VENDER _entity = new TA_VENDER();
// object[] rowDataKeys = Grid1.DataKeys[i];
// _entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
// System.Web.UI.WebControls.TextBox _txt = (System.Web.UI.WebControls.TextBox)row.FindControl("txtQuota");
// if (string.IsNullOrEmpty(_txt.Text))
// {
// _txt.Text = "0";
// }
// _entity.Quota = decimal.Parse(_txt.Text);
// if (_entity.Quota > 0)
// {
// _list.Add(_entity);
// }
// }
// var ret = SCP_TB_VENDER_CONTROLLER.Save_TA_VENDER(_list);
// if (ret.State == ReturnStatus.Succeed)
// {
// var list = ret.Result;
// Alert.Show("保存成功!");
// BindData();
// }
// else
// {
// Alert.Show("保存失败!");
// }
//}
//查询 //查询
protected void btnSearch_OnClick(object sender, EventArgs e) protected void btnSearch_OnClick(object sender, EventArgs e)
{ {
@ -166,9 +198,13 @@ namespace SCP.BasicData
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e) protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{ {
Grid1.PageIndex = e.NewPageIndex; BindData();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
} }
protected void Grid1_OnSort(object sender, GridSortEventArgs e) protected void Grid1_OnSort(object sender, GridSortEventArgs e)
{ {

33
SCP/Views/BasicData/Supplier.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.BasicData { namespace SCP.BasicData
{
public partial class Supplier { public partial class Supplier
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -147,6 +149,33 @@ namespace SCP.BasicData {
/// </remarks> /// </remarks>
protected global::FineUI.Grid Grid1; protected global::FineUI.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary> /// <summary>
/// Window1 控件。 /// Window1 控件。
/// </summary> /// </summary>

9
SCP/Views/PlanData/SCP_ASN_DETAIL_View.aspx

@ -92,6 +92,7 @@
</ItemTemplate> </ItemTemplate>
</f:TemplateField> </f:TemplateField>
<f:BoundField Width = "100px" SortField="VendName" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商名称" />
<f:BoundField Width = "80px" SortField="PoBillNum" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单单号" /> <f:BoundField Width = "80px" SortField="PoBillNum" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单单号" />
<f:BoundField Width = "80px" SortField="AskBillNum" DataField = "AskBillNum" DataFormatString = "{0}" HeaderText = "要货看板号" /> <f:BoundField Width = "80px" SortField="AskBillNum" DataField = "AskBillNum" DataFormatString = "{0}" HeaderText = "要货看板号" />
<f:BoundField Width = "80px" SortField="AsnBillNum" DataField = "AsnBillNum" DataFormatString = "{0}" HeaderText = "发货单号" /> <f:BoundField Width = "80px" SortField="AsnBillNum" DataField = "AsnBillNum" DataFormatString = "{0}" HeaderText = "发货单号" />
@ -100,12 +101,12 @@
<f:BoundField Width = "100px" SortField="PartCode" DataField = "PartCode" DataFormatString = "{0}" HeaderText = "零件编号" /> <f:BoundField Width = "100px" SortField="PartCode" DataField = "PartCode" DataFormatString = "{0}" HeaderText = "零件编号" />
<f:BoundField Width = "100px" SortField="PartDesc1" DataField = "PartDesc1" DataFormatString = "{0}" HeaderText = "零件名称" /> <f:BoundField Width = "100px" SortField="PartDesc1" DataField = "PartDesc1" DataFormatString = "{0}" HeaderText = "零件名称" />
<f:BoundField Width = "50px" SortField="CurrencyDesc" DataField = "CurrencyDesc" DataFormatString = "{0}" HeaderText = "币种" Hidden="true"/> <f:BoundField Width = "50px" SortField="CurrencyDesc" DataField = "CurrencyDesc" DataFormatString = "{0}" HeaderText = "币种" Hidden="true"/>
<f:BoundField Width = "100px" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" />
<f:BoundField Width = "100px" SortField="Batch" DataField = "Batch" DataFormatString = "{0}" HeaderText = "批次" /> <f:BoundField Width = "100px" SortField="Batch" DataField = "Batch" DataFormatString = "{0}" HeaderText = "批次" />
<f:BoundField Width = "100px" SortField="VendBatch" DataField = "VendBatch" DataFormatString = "{0}" HeaderText = "供应商批次" /> <f:BoundField Width = "100px" SortField="VendBatch" DataField = "VendBatch" DataFormatString = "{0}" HeaderText = "供应商批次" />
<f:BoundField Width = "100px" SortField="ShipTime" DataField = "ShipTime" DataFormatString = "{0}" HeaderText = "发货日期" /> <f:BoundField Width = "100px" SortField="ShipTime" DataField = "ShipTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "发货日期" />
<f:BoundField Width = "100px" SortField="EndTime" DataField = "EndTime" DataFormatString = "{0}" HeaderText = "承诺到货日期" /> <f:BoundField Width = "100px" SortField="EndTime" DataField = "EndTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "承诺到货日期" />
<f:BoundField Width = "100px" DataField = "ReceiveTime" DataFormatString = "{0}" HeaderText = "实际到货日期" /> <f:BoundField Width = "100px" DataField = "ReceiveTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "实际到货日期" />
<f:BoundField Width = "50px" SortField="PoUnit" DataField = "PoUnit" DataFormatString = "{0}" HeaderText = "单位" /> <f:BoundField Width = "50px" SortField="PoUnit" DataField = "PoUnit" DataFormatString = "{0}" HeaderText = "单位" />
<f:BoundField Width = "80px" SortField="Price" DataField = "Price" DataFormatString = "{0}" HeaderText = "价格" Hidden="true"/> <f:BoundField Width = "80px" SortField="Price" DataField = "Price" DataFormatString = "{0}" HeaderText = "价格" Hidden="true"/>

39
SCP/Views/PlanData/SCP_PO.aspx

@ -83,21 +83,18 @@
<f:ListItem Text="关闭" Value="0" /> <f:ListItem Text="关闭" Value="0" />
<f:ListItem Text="开放" Value="1" /> <f:ListItem Text="开放" Value="1" />
</f:DropDownList> </f:DropDownList>
<f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找订单">
</f:Button>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%"> <f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items> <Items>
<f:TextBox runat="server" Required ="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode" /> <f:TextBox runat="server" Required ="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode" />
</Items>
<%-- <f:DropDownList runat="server" ID="DropDownList1" Label="零件状态"> </f:FormRow>
<f:ListItem Text="-" Value=""/> <f:FormRow runat="server">
<f:ListItem Text="开发" Value="0" /> <Items>
<f:ListItem Text="关闭" Value="1" /> <f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找订单">
</f:DropDownList> --%> </f:Button>
<f:Button ID="BtnSearchDetail" runat="server" OnClick="BtnSearchDetail_Click" Text="快速查找订单明细"> <f:Button ID="BtnSearchDetail" runat="server" OnClick="BtnSearchDetail_Click" Text="快速查找订单明细">
</f:Button> </f:Button>
</Items> </Items>
@ -131,18 +128,18 @@
<Columns> <Columns>
<f:BoundField Width = "60px" DataField = "State" DataFormatString = "{0}" HeaderText = "状态" Hidden="true" /> <f:BoundField Width = "60px" SortField="State" DataField = "State" DataFormatString = "{0}" HeaderText = "状态" Hidden="true" />
<f:BoundField Width = "60px" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" SortField="State_DESC" /> <f:BoundField Width = "60px" SortField="State_DESC" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" />
<f:BoundField Width = "80px" DataField = "ModType_DESC" DataFormatString = "{0}" HeaderText = "单据类型" SortField="ModType_DESC"/> <f:BoundField Width = "80px" SortField="ModType_DESC" DataField = "ModType_DESC" DataFormatString = "{0}" HeaderText = "单据类型" />
<f:BoundField Width = "100px" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单编号" SortField="PoBillNum"/> <f:BoundField Width = "100px" SortField="PoBillNum" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单编号" />
<f:BoundField Width = "100px" DataField = "ErpBillNum" DataFormatString = "{0}" HeaderText ="项目编号" SortField="ErpBillNum"/> <f:BoundField Width = "100px" SortField="ErpBillNum" DataField = "ErpBillNum" DataFormatString = "{0}" HeaderText ="项目编号" />
<f:BoundField Width = "100px" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" SortField="VendName"/> <f:BoundField Width = "100px" SortField="VendName" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" />
<f:BoundField Width = "100px" DataField = "VendId" DataFormatString = "{0}" HeaderText = "供应商编码" SortField="VendId"/> <f:BoundField Width = "100px" SortField="VendId" DataField = "VendId" DataFormatString = "{0}" HeaderText = "供应商编码" />
<%-- <f:BoundField Width = "100px" DataField = "Contacter" DataFormatString = "{0}" HeaderText = "发布人" />--%> <%-- <f:BoundField Width = "100px" DataField = "Contacter" DataFormatString = "{0}" HeaderText = "发布人" />--%>
<f:BoundField Width = "100px" DataField = "BeginTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "订货日期" SortField="BeginTime"/> <f:BoundField Width = "100px" SortField="BeginTime" DataField = "BeginTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "订货日期" />
<f:BoundField Width = "100px" DataField = "Site_Desc" DataFormatString = "{0}" HeaderText = "地点" SortField="Site_Desc" /> <f:BoundField Width = "100px" SortField="Site_Desc" DataField = "Site_Desc" DataFormatString = "{0}" HeaderText = "地点" />
<f:BoundField Width = "100px" DataField = "Buyer" DataFormatString = "{0}" HeaderText = "收货人" SortField="Buyer"/> <f:BoundField Width = "100px" SortField="Buyer" DataField = "Buyer" DataFormatString = "{0}" HeaderText = "收货人" />
<f:BoundField Width = "100px" DataField = "BuyerPhone" DataFormatString = "{0}" HeaderText = "收货电话" /> <f:BoundField Width = "100px" SortField="BuyerPhone" DataField = "BuyerPhone" DataFormatString = "{0}" HeaderText = "收货电话" />
</Columns> </Columns>

2
SCP/Views/PlanData/SCP_PO.aspx.cs

@ -111,6 +111,8 @@ namespace SCP.PlanData
protected void Grid_V_TB_PO_Sort(object sender, FineUI.GridSortEventArgs e) protected void Grid_V_TB_PO_Sort(object sender, FineUI.GridSortEventArgs e)
{ {
Grid_V_TB_PO.SortDirection = e.SortDirection;
Grid_V_TB_PO.SortField = e.SortField;
BindOrder(); BindOrder();
} }

12
SCP/Views/PlanData/SCP_PO.aspx.designer.cs

@ -231,31 +231,31 @@ namespace SCP.PlanData
protected global::FineUI.DropDownList DDL_State; protected global::FineUI.DropDownList DDL_State;
/// <summary> /// <summary>
/// BtnClose 控件。 /// TXT_PartCode 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button BtnClose; protected global::FineUI.TextBox TXT_PartCode;
/// <summary> /// <summary>
/// BtnSearch 控件。 /// BtnClose 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button BtnSearch; protected global::FineUI.Button BtnClose;
/// <summary> /// <summary>
/// TXT_PartCode 控件。 /// BtnSearch 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_PartCode; protected global::FineUI.Button BtnSearch;
/// <summary> /// <summary>
/// BtnSearchDetail 控件。 /// BtnSearchDetail 控件。

1
SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx

@ -96,7 +96,6 @@
<f:Grid ID = "Grid_V_TB_PO_DETAIL" EnableCollapse = "true" ShowBorder = "true" EnableMultiSelect="true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect = "true" <f:Grid ID = "Grid_V_TB_PO_DETAIL" EnableCollapse = "true" ShowBorder = "true" EnableMultiSelect="true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect = "true"
DataKeyNames = "UID,PoBillNum,PoLine,PartCode,PlanQty,ShippedQty,ReceivedQty,RejectQty,BeginTime,EndTime,PoUnit,LocUnit,Price,Currency,PackQty,UnConv,DockCode,State,Remark,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,PartDesc1,CurrencyDesc,ErpBillNum,ModType,Contacter,Site,Buyer,BuyerPhone,VendName,PartDesc2,TempQty,PublishQty,ReceivedPort,SubSite,Extend1,Extend2,Extend3" DataKeyNames = "UID,PoBillNum,PoLine,PartCode,PlanQty,ShippedQty,ReceivedQty,RejectQty,BeginTime,EndTime,PoUnit,LocUnit,Price,Currency,PackQty,UnConv,DockCode,State,Remark,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,PartDesc1,CurrencyDesc,ErpBillNum,ModType,Contacter,Site,Buyer,BuyerPhone,VendName,PartDesc2,TempQty,PublishQty,ReceivedPort,SubSite,Extend1,Extend2,Extend3"
SortField="PoLine" SortField="PoLine"
OnSort="Grid_V_TB_PO_DETAIL_Sort"
AllowSorting="true" AllowSorting="true"
AllowPaging="True" AllowPaging="True"
AllowCellEditing="true" ClicksToEdit="2" AllowCellEditing="true" ClicksToEdit="2"

8
SCP/Views/PlanData/SCP_PO_DETAIL_OUT.aspx

@ -57,7 +57,7 @@
<f:Grid ID = "Grid_V_TB_PO_DETAIL" EnableCollapse = "true" Title="采购明细" ShowBorder = "true" EnableMultiSelect="true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect = "true" <f:Grid ID = "Grid_V_TB_PO_DETAIL" EnableCollapse = "true" Title="采购明细" ShowBorder = "true" EnableMultiSelect="true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect = "true"
DataKeyNames = "UID,PoBillNum,PoLine,PartCode,VendName,ProjectId,PartDesc1,PartDesc2" DataKeyNames = "UID,PoBillNum,PoLine,PartCode,VendName,ProjectId,PartDesc1,PartDesc2"
SortField="PoLine" SortField="PoLine"
BoxFlex="1" BoxFlex="1"
AllowPaging="True" AllowPaging="True"
IsDatabasePaging="true" PageSize="500" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange"> IsDatabasePaging="true" PageSize="500" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange">
<PageItems> <PageItems>
@ -79,7 +79,7 @@
<f:BoundField Width = "50px" DataField = "PoLine" DataFormatString = "{0}" HeaderText = "行号" /> <f:BoundField Width = "50px" DataField = "PoLine" DataFormatString = "{0}" HeaderText = "行号" />
<f:BoundField Width = "100px" DataField = "PartDesc1" DataFormatString = "{0}" HeaderText = "零件名称" /> <f:BoundField Width = "100px" DataField = "PartDesc1" DataFormatString = "{0}" HeaderText = "零件名称" />
<f:BoundField Width = "80px" DataField = "PartCode" DataFormatString = "{0}" HeaderText = "零件编码" /> <f:BoundField Width = "80px" DataField = "PartCode" DataFormatString = "{0}" HeaderText = "零件编码" />
<f:BoundField Width="300px" DataField="VendName" DataFormatString="{0}" HeaderText="供应商" /> <f:BoundField Width="300px" DataField="VendName" DataFormatString="{0}" HeaderText="供应商" />
</Columns> </Columns>
</f:Grid> </f:Grid>
</Items> </Items>
@ -99,9 +99,7 @@
</f:Toolbar> </f:Toolbar>
<f:Grid ID = "Grid1" ColumnWidth="45%" EnableCollapse = "true" ShowBorder = "true" Title="模板导出区" EnableMultiSelect="true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect = "true" <f:Grid ID = "Grid1" ColumnWidth="45%" EnableCollapse = "true" ShowBorder = "true" Title="模板导出区" EnableMultiSelect="true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect = "true"
DataKeyNames = "UID,PoBillNum,PoLine,PartCode,VendName,ProjectId,PartDesc1,PartDesc2" PageSize="500" DataKeyNames = "UID,PoBillNum,PoLine,PartCode,VendName,ProjectId,PartDesc1,PartDesc2" PageSize="500"
SortField="PoLine" SortField="PoLine" BoxFlex="1" AllowPaging="True">
BoxFlex="1"
AllowPaging="True">
<Columns> <Columns>
<f:BoundField Width="100px" DataField="ProjectId" HeaderText="项目编码"></f:BoundField> <f:BoundField Width="100px" DataField="ProjectId" HeaderText="项目编码"></f:BoundField>

3
SCP/Views/SupplierData/SCP_INVOICE.aspx

@ -90,7 +90,7 @@
</f:GroupPanel> </f:GroupPanel>
<f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true" ShowHeader="False" <f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true" ShowHeader="False"
AllowPaging="True" PageSize="10" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange" AllowPaging="True" PageSize="20" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange"
ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1" ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1"
DataKeyNames="UID, InvcBillNum" AllowSorting="true" IsDatabasePaging="true" SortField="State" OnRowDataBound="Grid_V_TB_INVOICE_RowDataBound" > DataKeyNames="UID, InvcBillNum" AllowSorting="true" IsDatabasePaging="true" SortField="State" OnRowDataBound="Grid_V_TB_INVOICE_RowDataBound" >
<PageItems> <PageItems>
@ -100,7 +100,6 @@
</f:ToolbarText> </f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server"> runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="20" Value="20" /> <f:ListItem Text="20" Value="20" />
<f:ListItem Text="50" Value="50" /> <f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" /> <f:ListItem Text="100" Value="100" />

16
SCP/Views/SupplierData/SCP_INVOICE.aspx.cs

@ -46,9 +46,6 @@ namespace SCP.Views.SupplierData
SearchInvoice(ret => { SearchInvoice(ret => {
Grid_V_TB_INVOICE.RecordCount = ret.Count(); Grid_V_TB_INVOICE.RecordCount = ret.Count();
ret = SortAndPage(ret, Grid_V_TB_INVOICE); ret = SortAndPage(ret, Grid_V_TB_INVOICE);
var _ls=ret.ToList();
Grid_V_TB_INVOICE.DataSource = ret; Grid_V_TB_INVOICE.DataSource = ret;
Grid_V_TB_INVOICE.DataBind(); Grid_V_TB_INVOICE.DataBind();
}); });
@ -151,15 +148,6 @@ namespace SCP.Views.SupplierData
//导出 //导出
protected void btnOutput_OnClick(object sender, EventArgs e) protected void btnOutput_OnClick(object sender, EventArgs e)
{ {
//List<string> _ls = new List<string>();
//for (int i = 0, count = Grid_V_TB_INVOICE.Rows.Count; i < count; i++)
//{
// object[] rowDataKeys = Grid_V_TB_INVOICE.DataKeys[i];
// _ls.Add(rowDataKeys[1] as string);
//}
//DataSet ds = SCP_EXCEL_CONTROLLER.GET_INVOICE_EXECEL(_ls);
//PageBase.DataSetToExcel(ds, "财务确认");
int[] _selections = Grid_V_TB_INVOICE.SelectedRowIndexArray; int[] _selections = Grid_V_TB_INVOICE.SelectedRowIndexArray;
if (_selections.Count() == 0) if (_selections.Count() == 0)
{ {
@ -205,10 +193,6 @@ namespace SCP.Views.SupplierData
catch catch
{ } { }
} }
//if (i > 0)
//{
// Alert.Show("请尽快处理索赔和退货数据,如果不处理新建发票将")
//}
} }
protected void BTN_INV_Click(object sender, EventArgs e) protected void BTN_INV_Click(object sender, EventArgs e)

32
SCP/Views/SupplierData/SCP_INVOICE_CREATE.aspx.cs

@ -127,38 +127,6 @@ namespace SCP.Views.SupplierData
{ {
_vendId = CurrentUser.VenderList[0]; _vendId = CurrentUser.VenderList[0];
} }
//SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST_PRICE(_vendId, temp, (rs) =>
//{
// if (rs.State == ReturnStatus.Succeed)
// {
// temp.ForEach(itm =>
// {
// var _entityList = rs.Result.ToList().Where(p => p.PartCode == itm.PartCode && itm.CreateTime >= p.StartTime && itm.CreateTime <= p.EndTime).ToList();
// if (_entityList.Count > 0)
// {
// var _max = _entityList.Select(p => p.UID).Max();
// var _entity = _entityList.Where(p => p.UID == _max).FirstOrDefault();
// if (itm.ModType == (int)BillModType.Contract)
// {
// if (CurrentUser.FactoryList.FirstOrDefault() == "CNS")
// {
// itm.Price = _entity.Amt;
// }
// else
// {
// itm.Price = itm.Price > 0 ? itm.Price : _entity.Amt;
// }
// }
// else
// {
// itm.Price = itm.Price > 0 ? itm.Price : _entity.Amt;
// }
// }
// });
// }
//});
var _isall=parm.IsAll; var _isall=parm.IsAll;
if(_isall=="0") if(_isall=="0")
{ {

35
SCP/Views/SupplierData/SCP_INVOICE_EDIT.aspx.cs

@ -56,21 +56,6 @@ namespace SCP.Views.SupplierData
IsPriceVisible(Grid1, "要货日期"); IsPriceVisible(Grid1, "要货日期");
} }
public decimal ToDecimal(decimal num, int scale)
{
decimal tempOdds = Math.Round(num, scale);
//if (tempOdds > num)
//{
// num = (decimal)((double)(tempOdds - (decimal)Math.Pow(10, -scale)));
//}
//else
//{
// num = (decimal)((double)tempOdds);
//}
//return num;
return tempOdds;
}
private void Search(Action<IQueryable<V_TB_INVOICE_DETAIL>> p_list) private void Search(Action<IQueryable<V_TB_INVOICE_DETAIL>> p_list)
{ {
@ -96,20 +81,6 @@ namespace SCP.Views.SupplierData
//Grid1.DataSource =SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList()); //Grid1.DataSource =SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList());
List<V_TB_INVOICE_DETAIL> temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList()); List<V_TB_INVOICE_DETAIL> temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_INVOICE_LIST(list.ToList());
temp = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(temp); temp = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(temp);
//decimal htjgSum = 0;//合同总价
//decimal htceSum = 0;//合同差额
//foreach (V_TB_INVOICE_DETAIL rec in temp)
//{
// rec.Qty = ToDecimal(rec.Qty, 2);
// rec.CanQty = ToDecimal(rec.CanQty, 2);
// htjgSum += rec.Qty * (rec.ContractPrice == null ? 0 : Convert.ToDecimal(rec.ContractPrice));//开票数量*合同价格
// htceSum += rec.Qty * (rec.BlancePrice == null ? 0 : Convert.ToDecimal(rec.BlancePrice));//开票数量*合同差额
//}
//txtContractPrice1.Text = htjgSum.ToString();
//txtBlancePrice1.Text = htceSum.ToString();
GetInvoice(); GetInvoice();
Grid1.DataSource = temp; Grid1.DataSource = temp;
Grid1.DataBind(); Grid1.DataBind();
@ -210,15 +181,11 @@ namespace SCP.Views.SupplierData
txtExpressNumber.Readonly = false; txtExpressNumber.Readonly = false;
txtContractPrice1.Readonly = false; txtContractPrice1.Readonly = false;
txtContractPrice1.Required = false; txtContractPrice1.Required = false;
txtBlancePrice1.Readonly = true; txtBlancePrice1.Readonly = false;
txtBlancePrice1.Required = false; txtBlancePrice1.Required = false;
this.btnMail.Hidden = false; this.btnMail.Hidden = false;
this.btnReject.Hidden = false; this.btnReject.Hidden = false;
this.btnOK.Hidden = false; this.btnOK.Hidden = false;
txtContractPrice1.Readonly = true;
txtContractPrice1.Required = false;
txtContractPrice1.Enabled = false;
txtBlancePrice1.Readonly = false;
} }
if (_Model.State ==(int) InvoiceState.CheckSuccess) if (_Model.State ==(int) InvoiceState.CheckSuccess)
{ {

26
SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx

@ -10,12 +10,10 @@
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" /> <f:PageManager ID="PageManager1" runat="server" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> <f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items> <Items>
<f:Toolbar ID="Toolbar1" runat="server"> <f:Toolbar ID="Toolbar1" runat="server">
<Items> <Items>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnRefresh" runat="server" Text="刷新" Icon="Reload" OnClientClick="location.reload();"> <f:Button ID="btnRefresh" runat="server" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button> </f:Button>
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server"> <f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
@ -24,6 +22,9 @@
</f:Button> </f:Button>
<f:Button ID="btnPrintRe" runat="server" Text="补打条码" OnClick="btnPrintRe_Click" Icon="Printer"> <f:Button ID="btnPrintRe" runat="server" Text="补打条码" OnClick="btnPrintRe_Click" Icon="Printer">
</f:Button> </f:Button>
<f:ToolbarSeparator ID="ToolbarSeparator3" runat="server">
</f:ToolbarSeparator>
<f:CheckBox runat="server" ID="ckbox" Label="未扫描" LabelWidth="45px" Text="" AutoPostBack="true" OnCheckedChanged="ckbox_CheckedChanged"></f:CheckBox>
<f:ToolbarFill ID="ToolbarFill1" runat="server"> <f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill> </f:ToolbarFill>
<f:TextBox ID="txtKeyword" runat="server" Label="" Text=""> <f:TextBox ID="txtKeyword" runat="server" Label="" Text="">
@ -36,15 +37,26 @@
</f:Toolbar> </f:Toolbar>
<f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="true" ShowHeader="False" <f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="true" ShowHeader="False" BoxFlex="1"
AllowPaging="True" PageSize="100" OnPageIndexChange="Grid1_PageIndexChange" AllowPaging="True" PageSize="100" OnPageIndexChange="Grid1_PageIndexChange"
ShowBorder="False" AutoScroll="true" ShowBorder="False" AutoScroll="true" SortDirection="DESC" SortField="BarCode"
DataKeyNames="UID,BarCode" AllowSorting="true" IsDatabasePaging="true" > DataKeyNames="UID,BarCode" AllowSorting="true" IsDatabasePaging="true" >
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"></f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText2" 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> <Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" /> <f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="BarCode" DataField="BarCode" HeaderText="条码" ColumnID="BarCode" Width="200" /> <f:BoundField SortField="IsScanned_Desc" DataField="IsScanned_Desc" HeaderText="状态" ColumnID="IsScanned_Desc" Width="100" />
<f:BoundField SortField="BarCode" DataField="BarCode" HeaderText="条码" ColumnID="BarCode" Width="100" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode"/> <f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode"/>
<f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" ColumnID="ProductName" Width="300px"/> <f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" ColumnID="ProductName" Width="200px" />
<f:BoundField SortField="Batch" DataField="Batch" HeaderText="批次" ColumnID="Batch"/> <f:BoundField SortField="Batch" DataField="Batch" HeaderText="批次" ColumnID="Batch"/>
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="Qty"/> <f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="Qty"/>
<f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="标包数量" ColumnID="PackageQty"/> <f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="标包数量" ColumnID="PackageQty"/>

19
SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.cs

@ -27,7 +27,8 @@ namespace SCP.SupplierData
{ {
Search(ret => { Search(ret => {
Grid1.RecordCount = ret.Count(); Grid1.RecordCount = ret.Count();
Grid1.DataSource = ret.ToList(); var list = SortAndPage<TS_BARCODE>(ret, Grid1);
Grid1.DataSource = list.ToList();
Grid1.DataBind(); Grid1.DataBind();
}); });
@ -37,9 +38,13 @@ namespace SCP.SupplierData
string billnum = GetQueryValue("BillNo"); string billnum = GetQueryValue("BillNo");
TS_BARCODE _code = new TS_BARCODE(); TS_BARCODE _code = new TS_BARCODE();
_code.BillNum = billnum; _code.BillNum = billnum;
if (ckbox.Checked)
{
_code.IsScanned = true;
}
if (!string.IsNullOrEmpty(txtKeyword.Text)) if (!string.IsNullOrEmpty(txtKeyword.Text))
{ {
_code.PartCode = txtKeyword.Text; _code.BarCode = txtKeyword.Text;
} }
SCP_BARCODE_CONTROLLER.Get_TS_BARCODE_List(_code, ret => { SCP_BARCODE_CONTROLLER.Get_TS_BARCODE_List(_code, ret => {
if (ret.State == ReturnStatus.Succeed) if (ret.State == ReturnStatus.Succeed)
@ -68,6 +73,7 @@ namespace SCP.SupplierData
{ {
Dictionary<string, string> cellheader = new Dictionary<string, string> Dictionary<string, string> cellheader = new Dictionary<string, string>
{ {
{ "IsScanned_Desc", "状态" },
{ "BarCode", "包装箱码" }, { "BarCode", "包装箱码" },
{ "Qty", "数量" }, { "Qty", "数量" },
{ "PartCode", "零件编号" }, { "PartCode", "零件编号" },
@ -110,5 +116,14 @@ namespace SCP.SupplierData
{ {
BindData(); BindData();
} }
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void ckbox_CheckedChanged(object sender, CheckedEventArgs e)
{
BindData();
}
} }
} }

60
SCP/Views/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.SupplierData { namespace SCP.SupplierData
{
public partial class SCP_SHIP_DETAIL_BARCODE { public partial class SCP_SHIP_DETAIL_BARCODE
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -48,15 +50,6 @@ namespace SCP.SupplierData {
/// </remarks> /// </remarks>
protected global::FineUI.Toolbar Toolbar1; protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary> /// <summary>
/// btnRefresh 控件。 /// btnRefresh 控件。
/// </summary> /// </summary>
@ -93,6 +86,24 @@ namespace SCP.SupplierData {
/// </remarks> /// </remarks>
protected global::FineUI.Button btnPrintRe; protected global::FineUI.Button btnPrintRe;
/// <summary>
/// ToolbarSeparator3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator3;
/// <summary>
/// ckbox 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.CheckBox ckbox;
/// <summary> /// <summary>
/// ToolbarFill1 控件。 /// ToolbarFill1 控件。
/// </summary> /// </summary>
@ -137,5 +148,32 @@ namespace SCP.SupplierData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Grid Grid1; protected global::FineUI.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText2;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
} }
} }

35
SCP/Views/SupplierData/SCP_TS_BARCODE.aspx

@ -10,17 +10,17 @@
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> <f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> <f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar2" runat="server"> <f:Toolbar ID="Toolbar2" runat="server">
<Items> <Items>
<f:Button ID="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Add"> <f:Button ID="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Add">
</f:Button> </f:Button>
<f:Button ID="Button3" runat="server" EnablePostBack="True" Text="导出" Icon="PageExcel" OnClick="Button3_OnClick"> <f:Button ID="Button3" runat="server" EnablePostBack="True" Text="导出" Icon="PageExcel" OnClick="ButtonOut_OnClick">
</f:Button> </f:Button>
<f:Button ID="Button2" runat="server" EnablePostBack="True" Text="补打条码" Icon="Printer" OnClick="Button2_OnClick"> <f:Button ID="Button2" runat="server" EnablePostBack="True" Text="补打条码" Icon="Printer" OnClick="ButtonPrint_OnClick">
</f:Button> </f:Button>
<f:Button ID="btnSearch" runat="server" Text="快速查找" Icon="Printer" OnClick="btnSearch_OnClick"> <f:Button ID="btnSearch" runat="server" Text="快速查找" Icon="Printer" OnClick="BtnSearch_OnClick">
</f:Button> </f:Button>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
@ -28,8 +28,10 @@
<Items> <Items>
<f:Form runat="server" Layout="Column" ID="FormRow_1"> <f:Form runat="server" Layout="Column" ID="FormRow_1">
<Items> <Items>
<f:FormRow runat="server" BoxFlex="1"> <f:FormRow runat="server" BoxFlex="1" Margin="5">
<Items> <Items>
<f:Label runat="server" Label="发货单号" />
<f:TextBox ID="txtAsnNumBill" runat="server" />
<f:Label runat="server" Label="条码" /> <f:Label runat="server" Label="条码" />
<f:TextBox ID="txtBarCode" runat="server" /> <f:TextBox ID="txtBarCode" runat="server" />
<f:Label runat="server" Label="零件号" /> <f:Label runat="server" Label="零件号" />
@ -40,17 +42,30 @@
</f:FormRow> </f:FormRow>
</Items> </Items>
</f:Form> </f:Form>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="10" BoxFlex="1" CssClass="maingrid" <f:Grid ID="Grid1" ShowBorder="false" ShowHeader="true" PageSize="20" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="" IsDatabasePaging="True" AllowPaging="True" SortField="BarCode" SortDirection="DESC" runat="server" DataKeyNames="UID,BarCode" IsDatabasePaging="True" AllowPaging="True" SortField="BarCode" SortDirection="DESC"
EnableRowSelectEvent="True" AutoScroll="True"> EnableCheckBoxSelect="true" AutoScroll="True" OnPageIndexChange="Grid_V_TS_BARCODE_PageIndexChange">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" 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="20" Value="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns> <Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" /> <f:BoundField SortField="IsScanned_Desc" DataField="IsScanned_Desc" HeaderText="是否扫描" ColumnID="IsScanned_Desc" Width="100" />
<f:BoundField SortField="BarCode" DataField="BarCode" HeaderText="条码" ColumnID="BarCode" Width="100px" /> <f:BoundField SortField="BarCode" DataField="BarCode" HeaderText="条码" ColumnID="BarCode" Width="100px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="PartCode" Width="100px" /> <f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="PartCode" Width="100px" />
<f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" ColumnID="PartName" Width="300px" /> <f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" ColumnID="PartName" Width="300px" />
<f:BoundField SortField="Batch" DataField="Batch" HeaderText="批次" ColumnID="Batch" Width="100px" /> <f:BoundField SortField="Batch" DataField="Batch" HeaderText="批次" ColumnID="Batch" Width="100px" />
<f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="装箱数量" ColumnID="PackQty" Width="100px" DataFormatString = "{0:F}" /> <f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="装箱数量" ColumnID="PackQty" Width="100px" DataFormatString = "{0:F}" />
<f:BoundField SortField="BillNum" DataField="BillNum" HeaderText="发货单号" ColumnID="BillNum" Width="300px" />
</Columns> </Columns>
</f:Grid> </f:Grid>
</Items> </Items>

63
SCP/Views/SupplierData/SCP_TS_BARCODE.aspx.cs

@ -6,6 +6,8 @@ using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using CK.SCP.Controller; using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity; using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using FineUI;
namespace SCP.SupplierData namespace SCP.SupplierData
{ {
@ -16,35 +18,38 @@ namespace SCP.SupplierData
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid1);
TranslatorAgents(FormRow_1);
LoadData(); LoadData();
} }
} }
public void LoadData() public void LoadData()
{ {
SearchData((ret) => { SearchData((ret) =>
{
Grid1.RecordCount = ret.Count(); Grid1.RecordCount = ret.Count();
var list = SortAndPage<TS_BARCODE>(ret, Grid1); var list = SortAndPage<V_TS_BARCODE>(ret, Grid1);
Grid1.DataSource = list; Grid1.DataSource = list.ToList();
Grid1.DataBind(); Grid1.DataBind();
}); });
} }
//查询 //查询
protected void btnSearch_OnClick(object sender, EventArgs e) protected void BtnSearch_OnClick(object sender, EventArgs e)
{ {
LoadData(); LoadData();
} }
public void SearchData(Action<IQueryable<TS_BARCODE>> p_action) public void SearchData(Action<IQueryable<V_TS_BARCODE>> p_action)
{ {
string billnum = GetQueryValue("BillNum"); var _barCode = new V_TS_BARCODE();
var _barCode = new TS_BARCODE(); _barCode.BillNum = txtAsnNumBill.Text;
_barCode.BillNum = billnum; _barCode.BarCode = txtBarCode.Text;
SCP_TS_BARCODE_CONTROLLER.Get_TS_BARCODE_List(_barCode, (ret) => _barCode.PartCode = txtPartCode.Text;
_barCode.Batch = txtBatch.Text;
_barCode.IsScanned = false;
_barCode.UserInAddress = CurrentUser.FactoryList;
_barCode.UserInVendIds = CurrentUser.VenderList;
SCP_TS_BARCODE_CONTROLLER.Get_V_TS_BARCODE_List(_barCode, (ret) =>
{ {
if (ret.State == ReturnStatus.Succeed) if (ret.State == ReturnStatus.Succeed)
{ {
@ -53,30 +58,50 @@ namespace SCP.SupplierData
}); });
} }
//导出 //导出
protected void Button3_OnClick(object sender, EventArgs e) protected void ButtonOut_OnClick(object sender, EventArgs e)
{ {
SearchData((ret)=> { SearchData((ret) =>
{
var list = SortAndPage<TS_BARCODE>(ret, Grid1).ToList(); var list = SortAndPage<V_TS_BARCODE>(ret, Grid1).ToList();
// 2.设置单元格抬头 // 2.设置单元格抬头
// key:实体对象属性名称,可通过反射获取值 // key:实体对象属性名称,可通过反射获取值
// value:Excel列的名称 // value:Excel列的名称
Dictionary<string, string> cellheader = new Dictionary<string, string> { Dictionary<string, string> cellheader = new Dictionary<string, string> {
{ "IsScanned_Desc", "是否扫描" },
{ "BarCode", "条码" }, { "BarCode", "条码" },
{ "PartCode", "零件号" }, { "PartCode", "零件号" },
{ "PartName", "零件名称" }, { "PartName", "零件名称" },
{ "Batch", "批次" }, { "Batch", "批次" },
{ "PackQty", "装箱数量" }, { "PackQty", "装箱数量" },
}; };
string url = EntityListToExcel2003(cellheader, list, "条码列表"); string url = EntityListToExcel2003(cellheader, list, "条码列表");
}); });
} }
//补打条码 //补打条码
protected void Button2_OnClick(object sender, EventArgs e) protected void ButtonPrint_OnClick(object sender, EventArgs e)
{
List<string> _ls = new List<string>();
for(int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
if (Grid1.SelectedRowIndexArray.Contains(i))
{
object[] rowDataKeys = Grid1.DataKeys[i];
int id= ConvertHelper.To<int>(rowDataKeys[0]);
_ls.Add(id.ToString());
}
}
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=Material&data=101&type=pdf&filename=标签.pdf&Barcode={0}&open=\")", string.Join("_", _ls.ToArray()));
PageContext.RegisterStartupScript(str);
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{ {
throw new NotImplementedException(); Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
LoadData();
}
protected void Grid_V_TS_BARCODE_PageIndexChange(object sender, GridPageEventArgs e)
{
LoadData();
} }
} }
} }

42
SCP/Views/SupplierData/SCP_TS_BARCODE.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.SupplierData { namespace SCP.SupplierData
{
public partial class SCP_TS_BARCODE { public partial class SCP_TS_BARCODE
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -84,6 +86,15 @@ namespace SCP.SupplierData {
/// </remarks> /// </remarks>
protected global::FineUI.Form FormRow_1; protected global::FineUI.Form FormRow_1;
/// <summary>
/// txtAsnNumBill 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtAsnNumBill;
/// <summary> /// <summary>
/// txtBarCode 控件。 /// txtBarCode 控件。
/// </summary> /// </summary>
@ -119,5 +130,32 @@ namespace SCP.SupplierData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Grid Grid1; protected global::FineUI.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
} }
} }

3
SCP/Views/WarehouseData/SCP_INVOICE.aspx

@ -72,7 +72,7 @@
<f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true" <f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true"
ShowHeader="False" SortField="State;CreateTime" ShowHeader="False" SortField="State;CreateTime"
AllowPaging="True" PageSize="10" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange" AllowPaging="True" PageSize="20" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange"
ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1" ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1"
DataKeyNames="UID, InvcBillNum,State_DESC,InvoiceNum,ExpressNum,VendName,Amount,Tax,TaxAmount,ContractPrice,BlancePrice,Total,CreateTime,Remark,VendId" AllowSorting="true" IsDatabasePaging="true" > DataKeyNames="UID, InvcBillNum,State_DESC,InvoiceNum,ExpressNum,VendName,Amount,Tax,TaxAmount,ContractPrice,BlancePrice,Total,CreateTime,Remark,VendId" AllowSorting="true" IsDatabasePaging="true" >
<PageItems> <PageItems>
@ -82,7 +82,6 @@
</f:ToolbarText> </f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server"> runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="20" Value="20" /> <f:ListItem Text="20" Value="20" />
<f:ListItem Text="50" Value="50" /> <f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" /> <f:ListItem Text="100" Value="100" />

2
SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM.aspx

@ -75,7 +75,7 @@
</f:GroupPanel> </f:GroupPanel>
<f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true" <f:Grid ID="Grid_V_TB_INVOICE" runat="server" EnableCheckBoxSelect="true"
ShowHeader="False" SortField="State;CreateTime" AllowPaging="True" PageSize="200" ShowHeader="False" SortField="State;CreateTime" AllowPaging="True" PageSize="200"
OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange" OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange" BoxFlex="1"
ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1" ShowBorder="False" OnRowDoubleClick="Grid_V_TB_INVOICE_RowDoubleClick" BoxFlex="1"
DataKeyNames="UID, InvcBillNum" AllowSorting="true" IsDatabasePaging="true" > DataKeyNames="UID, InvcBillNum" AllowSorting="true" IsDatabasePaging="true" >
<PageItems> <PageItems>

4
SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM.aspx.cs

@ -85,10 +85,6 @@ namespace SCP.WarehouseData
{ {
if (ret.State == ReturnStatus.Succeed) if (ret.State == ReturnStatus.Succeed)
{ {
//if (_entity.InvoiceList == null || _entity.InvoiceList.Count == 0)
//{
// Alert.Show("未查询到符合条件的发票!");
//}
p_action(ret.Result); p_action(ret.Result);
} }
}); });

2
SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx

@ -10,7 +10,7 @@
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> <f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> <f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items> <Items>
<f:Form runat="server" Title=""> <f:Form runat="server" Title="">
<Toolbars> <Toolbars>

9
SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx.cs

@ -125,15 +125,6 @@ namespace SCP.WarehouseData
public decimal ToDecimal(decimal num, int scale) public decimal ToDecimal(decimal num, int scale)
{ {
decimal tempOdds = Math.Round(num, scale); decimal tempOdds = Math.Round(num, scale);
//if (tempOdds > num)
//{
// num = (decimal)((double)(tempOdds - (decimal)Math.Pow(10, -scale)));
//}
//else
//{
// num = (decimal)((double)tempOdds);
//}
//return num;
return tempOdds; return tempOdds;
} }

4
SCP/Views/WarehouseData/SCP_INVOICE_DELTAIL.aspx

@ -10,11 +10,11 @@
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> <f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> <f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar2" runat="server"> <f:Toolbar ID="Toolbar2" runat="server">
<Items> <Items>
<f:Button ID="btnEdit" runat="server" Text="修改数据" Enabled="true" OnClientClick="if(!confirm('是否要修改备注?'))return false;" Icon="ScriptSave" OnClick="btnEdit_OnClick"> <f:Button ID="btnEdit" runat="server" Text="修改数据" Enabled="true" OnClientClick="if(!confirm('是否要修改数据?'))return false;" Icon="ScriptSave" OnClick="btnEdit_OnClick">
</f:Button> </f:Button>
<f:Button ID="btnInvoiceFail" runat="server" Text="财务退回" Icon="BulletCross" OnClick="btnInvoiceFail_OnClick"> <f:Button ID="btnInvoiceFail" runat="server" Text="财务退回" Icon="BulletCross" OnClick="btnInvoiceFail_OnClick">
</f:Button> </f:Button>

25
SCP/Views/WarehouseData/SCP_RECEIVE.aspx

@ -55,24 +55,27 @@
<f:ListItem Text="审核通过" Value="1" /> <f:ListItem Text="审核通过" Value="1" />
<f:ListItem Text="已开票" Value="2" /> <f:ListItem Text="已开票" Value="2" />
</f:DropDownList> </f:DropDownList>
<f:TextBox ID="CreateUser" runat="server" Label="收货员" />
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server">
<Items> <Items>
<f:Label runat="server" Label="单据号" /> <f:TextBox ID="txtErpBill" runat="server" Label="ERP单据号"/>
<f:TextBox ID="txtReceiveBill" runat="server" /> <f:TextBox ID="txtReceiveBill" runat="server" Label="WMS单据号"/>
<f:Label runat="server" Label="供应商" /> <f:TextBox ID="txtSupplier" runat="server" Label="供应商代码" />
<f:TextBox ID="txtSupplier" runat="server" />
<f:Label runat="server" Label="订单号" />
<f:TextBox ID="txtPO" runat="server" />
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server">
<Items> <Items>
<f:Label runat="server" Label="发货单号" /> <f:TextBox ID="txtPO" runat="server" Label="订单号" />
<f:TextBox ID="AsnBillNum" runat="server" /> <f:TextBox ID="AsnBillNum" runat="server" Label="发货单号" />
<f:Label runat="server" Label="操作员" /> <f:TextBox ID="OperName" runat="server" Label="审核员" />
<f:TextBox ID="OperName" runat="server" /> </Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:DatePicker ID="txtShipTimeStar" runat="server" Label="收货时间" EmptyText="开始时间"></f:DatePicker>
<f:DatePicker ID="txtShipTimeEnd" runat="server" Label="至" EmptyText="结束时间"></f:DatePicker>
<f:TextBox runat="server" Required ="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode" /> <f:TextBox runat="server" Required ="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode" />
</Items> </Items>
</f:FormRow> </f:FormRow>
@ -108,7 +111,7 @@
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" /> <f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendName" /> <f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendName" />
<f:BoundField runat="server" HeaderText="供应商编码" ColumnID="" DataField="VendId" /> <f:BoundField runat="server" HeaderText="供应商编码" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="单据号" ColumnID="" DataField="RecvBillNum" /> <f:BoundField runat="server" HeaderText="WMS单据号" ColumnID="" DataField="RecvBillNum" />
<f:BoundField runat="server" HeaderText="Erp单据号" ColumnID="" DataField="ErpRecvBillNum" /> <f:BoundField runat="server" HeaderText="Erp单据号" ColumnID="" DataField="ErpRecvBillNum" />
<f:BoundField runat="server" HeaderText="订单号" ColumnID="" DataField="PoBillNum" /> <f:BoundField runat="server" HeaderText="订单号" ColumnID="" DataField="PoBillNum" />

12
SCP/Views/WarehouseData/SCP_RECEIVE.aspx.cs

@ -56,6 +56,7 @@ namespace SCP.WarehouseData
{ {
var _entity = new V_TB_RECEIVE(); var _entity = new V_TB_RECEIVE();
_entity.RecvBillNum=txtReceiveBill.Text;//单据号 _entity.RecvBillNum=txtReceiveBill.Text;//单据号
_entity.ErpRecvBillNum = txtErpBill.Text;
if (!string.IsNullOrEmpty(ddl.SelectedValue)) if (!string.IsNullOrEmpty(ddl.SelectedValue))
{ {
//已收货:0,审核通过:1,已开票,2 //已收货:0,审核通过:1,已开票,2
@ -93,13 +94,18 @@ namespace SCP.WarehouseData
_entity.UserInAddress = CurrentUser.FactoryList; _entity.UserInAddress = CurrentUser.FactoryList;
_entity.UserInVendIds = CurrentUser.VenderList; _entity.UserInVendIds = CurrentUser.VenderList;
_entity.VendName = txtSupplier.Text;//供应商 _entity.VendId = txtSupplier.Text;//供应商
_entity.PoBillNum = txtPO.Text;//订单号 _entity.PoBillNum = txtPO.Text;//订单号
_entity.AsnBillNum = AsnBillNum.Text;//发货单号 _entity.AsnBillNum = AsnBillNum.Text;//发货单号
_entity.OperName = OperName.Text;//操作员 _entity.OperName = OperName.Text;//操作员
if (CurrentUser.Name != "admin") _entity.CreateUser = CreateUser.Text;//wms收货员
if (txtShipTimeStar.SelectedDate != null)
{
_entity.ShipTimeStart = (DateTime)txtShipTimeStar.SelectedDate;
}
if (txtShipTimeEnd.SelectedDate != null)
{ {
_entity.CreateUser = CurrentUser.ChineseName; _entity.ShipTimeEnd = (DateTime)txtShipTimeEnd.SelectedDate;
} }
SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_GG_List(_entity, (ret) => SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_GG_List(_entity, (ret) =>
{ {

42
SCP/Views/WarehouseData/SCP_RECEIVE.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.WarehouseData { namespace SCP.WarehouseData
{
public partial class SCP_RECEIVE { public partial class SCP_RECEIVE
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -111,6 +113,24 @@ namespace SCP.WarehouseData {
/// </remarks> /// </remarks>
protected global::FineUI.DropDownList ddl; protected global::FineUI.DropDownList ddl;
/// <summary>
/// CreateUser 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox CreateUser;
/// <summary>
/// txtErpBill 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtErpBill;
/// <summary> /// <summary>
/// txtReceiveBill 控件。 /// txtReceiveBill 控件。
/// </summary> /// </summary>
@ -156,6 +176,24 @@ namespace SCP.WarehouseData {
/// </remarks> /// </remarks>
protected global::FineUI.TextBox OperName; protected global::FineUI.TextBox OperName;
/// <summary>
/// txtShipTimeStar 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker txtShipTimeStar;
/// <summary>
/// txtShipTimeEnd 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker txtShipTimeEnd;
/// <summary> /// <summary>
/// TXT_PartCode 控件。 /// TXT_PartCode 控件。
/// </summary> /// </summary>

21
SCP/Views/WarehouseData/SCP_RECEIVE_DETAIL.aspx

@ -77,17 +77,18 @@
<Columns> <Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" /> <f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="RecvBillNum" DataField="RecvBillNum" HeaderText="单据号" ColumnID="Line" Width="100px" /> <f:BoundField SortField="ErpRecvBillNum" DataField="ErpRecvBillNum" HeaderText="ERP单据号" ColumnID="ErpRecvBillNum" Width="100px" />
<f:BoundField SortField="AsnBillNum" DataField="AsnBillNum" HeaderText="发货单号" ColumnID="ProductCode" Width="120px" /> <f:BoundField SortField="RecvBillNum" DataField="RecvBillNum" HeaderText="单据号" ColumnID="RecvBillNum" Width="100px" />
<f:BoundField SortField="PoBillNum" DataField="PoBillNum" HeaderText="订单号" ColumnID="ProductName" Width="100px" /> <f:BoundField SortField="AsnBillNum" DataField="AsnBillNum" HeaderText="发货单号" ColumnID="AsnBillNum" Width="120px" />
<f:BoundField SortField="PoLine" DataField="PoLine" HeaderText="订单行" ColumnID="UnitCode" Width="60px" /> <f:BoundField SortField="PoBillNum" DataField="PoBillNum" HeaderText="订单号" ColumnID="PoBillNum" Width="100px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="PackageQty" Width="100px" /> <f:BoundField SortField="PoLine" DataField="PoLine" HeaderText="订单行" ColumnID="PoLine" Width="60px" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="CurrencyCode" Width="200px" /> <f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="PartCode" Width="100px" />
<f:BoundField SortField="Unit" DataField="Unit" HeaderText="单位" ColumnID="Price" Width="80px" /> <f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="PartDesc1" Width="200px" />
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="PlanQty" Width="60px" /> <f:BoundField SortField="Unit" DataField="Unit" HeaderText="单位" ColumnID="Unit" Width="80px" />
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="Qty" Width="60px" />
<f:BoundField SortField="DockCode" DataField="DockCode" HeaderText="ERP库位" ColumnID="DockCode" Width="60px" /> <f:BoundField SortField="DockCode" DataField="DockCode" HeaderText="ERP库位" ColumnID="DockCode" Width="60px" />
<f:BoundField SortField="ShipTime" DataField="ShipTime" HeaderText="时间" ColumnID="ShipQty" Width="60px" DataFormatString="{0:yy-MM-dd}"/> <f:BoundField SortField="ShipTime" DataField="ShipTime" HeaderText="时间" ColumnID="ShipTime" Width="60px" DataFormatString="{0:yy-MM-dd}"/>
<f:BoundField SortField="Remark" DataField="Remark" HeaderText="备注" ColumnID="ReceiveQty" Width="60px" /> <f:BoundField SortField="Remark" DataField="Remark" HeaderText="备注" ColumnID="Remark" Width="60px" />
</Columns> </Columns>
</f:Grid> </f:Grid>
</Items> </Items>

63
SCP/Views/沈阳金杯/PlanData/SCP_ASK.aspx

@ -23,44 +23,41 @@
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> <f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> <f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items> <Items>
<f:Form runat="server"> <f:Form runat="server">
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar2" runat="server"> <f:Toolbar ID="Toolbar2" runat="server">
<Items> <Items>
<f:ToolbarSeparator runat="server" /> <f:ToolbarSeparator runat="server" />
<f:Button ID="button3" runat="server" EnablePostBack="false" Text="刷新" Icon="Add" OnClientClick="location.reload();"> <f:Button ID="button3" runat="server" EnablePostBack="false" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button> </f:Button>
<f:ToolbarSeparator runat="server" /> <f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_Click" > <f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_Click" >
</f:Button> </f:Button>
<f:Button ID="btnDetail" runat="server" Text="明细" Icon="Zoom" OnClick="btnDetail_Click"> <f:Button ID="btnDetail" runat="server" Text="明细" Icon="Find" OnClick="btnDetail_Click">
</f:Button> </f:Button>
<f:ToolbarSeparator runat="server" /> <f:ToolbarSeparator runat="server" />
<f:Button ID="btnCreateAsk" runat="server" Text="创建要货看板" Icon="Zoom" OnClick="btnCreateAsk_Click"> <f:Button ID="btnCreateAsk" runat="server" Text="创建要货看板" Icon="Add" OnClick="btnCreateAsk_Click">
</f:Button> </f:Button>
<f:ToolbarSeparator runat="server" /> <f:ToolbarSeparator runat="server" />
<f:Button ID="BtnPublish" runat="server" EnablePostBack="True" Text="发布" Icon="Add" OnClick="BtnPublish_Click" OnClientClick="if(!confirm('是否要发布?'))return false;"> <f:Button ID="BtnPublish" runat="server" EnablePostBack="True" Text="发布" Icon="Add" OnClick="BtnPublish_Click" OnClientClick="if(!confirm('是否要发布?'))return false;">
</f:Button> </f:Button>
<%--<f:Button ID="BtnCanclePublish" runat="server" EnablePostBack="True" Text="取消发布" Icon="Add" OnClick="BtnCanclePublish_Click" OnClientClick="if(!confirm('是否要取消发布?'))return false;"> <f:Button ID="BtnStop" runat="server" EnablePostBack="True" Text="关闭完成订单" Icon="Delete" OnClick="BtnStop_Click" OnClientClick="if(!confirm('是否要关闭完成订单?'))return false;" Hidden="true">
</f:Button>--%> </f:Button>
<%--<f:Button ID="btnEdit" runat="server" Text="修改" Icon="PageExcel" >
</f:Button>--%>
<f:Button ID="btnShow" runat="server" Text="查询面板" OnClick="btnShow_Click"> <f:Button ID="btnShow" runat="server" Text="查询面板" OnClick="btnShow_Click">
</f:Button> </f:Button>
<f:ToolbarSeparator runat="server" /> <f:ToolbarSeparator runat="server" />
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true" > </f:FileUpload> <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 ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click" OnClientClick="if(!confirm('是否导入数据?'))return false;" >
</f:Button> </f:Button>
<%-- <f:Button ID="Button1" runat="server" Text="未完成" IconUrl="~/res/images/lv.png" >
</f:Button>--%>
<f:Button ID="btnAsn" runat="server" Text="发货单查询" Icon="Zoom" OnClick="btnAsn_Click"> <f:Button ID="btnAsn" runat="server" Text="发货单查询" Icon="Zoom" OnClick="btnAsn_Click">
</f:Button> </f:Button>
<f:LinkButton ID="linkbutton" runat="server" Text="模板下载" OnClick="LinkButton_Click" ></f:LinkButton>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
@ -74,15 +71,16 @@
<Items> <Items>
<f:TextBox runat = "server" Label = "订单编号" EmptyText = "" ID = "TXT_BillNo" /> <f:TextBox runat = "server" Label = "订单编号" EmptyText = "" ID = "TXT_BillNo" />
<f:TextBox runat = "server" Label = "供应商名称" EmptyText = "" ID = "TXT_VendName" /> <f:TextBox runat = "server" Label = "供应商名称" EmptyText = "" ID = "TXT_VendName" />
<f:TextBox runat = "server" Label = "送货地点" EmptyText = "" ID = "TXT_Site_Desc" /> <f:TextBox runat = "server" Hidden="true" Label = "送货地点" EmptyText = "" ID = "TXT_Site_Desc" />
<f:TextBox runat="server" Required ="true" Label="要货看板号" EmptyText="查询请填写要货看板号" ID="TXT_AskBillNo" />
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server">
<Items> <Items>
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="订货日期" EmptyText="请选择日期" ID="DP_StartDate" /> <f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="订货日期" EmptyText="请选择日期" ID="DP_StartDate" />
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" EmptyText="请选择日期" Label="至" ID="Date_EndDate" /> <f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="至" EmptyText="请选择日期" ID="DP_StartDate_End" />
<f:DropDownList runat="server" ID="DDL_State" Label="状态"> <f:DropDownList runat="server" ID="DDL_State" Label="状态">
<f:ListItem Text="-" Value=""/> <f:ListItem Text="-" Value=""/>
<f:ListItem Text="新建" Value="0" /> <f:ListItem Text="新建" Value="0" />
@ -96,8 +94,9 @@
</f:FormRow> </f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%"> <f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items> <Items>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" EmptyText="请选择日期" Label="到货日期" ID="Date_EndDate_Start" />
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" EmptyText="请选择日期" Label="至" ID="Date_EndDate" />
<f:TextBox runat="server" Required ="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode" /> <f:TextBox runat="server" Required ="true" Label="零件编号" EmptyText="查询请填写零件编号" ID="TXT_PartCode" />
<f:TextBox runat="server" Required ="true" Label="要货看板号" EmptyText="查询请填写要货看板号" ID="TXT_AskBillNo" />
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server">
@ -115,12 +114,12 @@
</Items> </Items>
</f:GroupPanel> </f:GroupPanel>
<f:Grid ID = "Grid_V_TB_ASK" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "true" runat ="server" EnableCheckBoxSelect="true" <f:Grid ID = "Grid_V_TB_ASK" BoxFlex="1" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "false" runat ="server" EnableCheckBoxSelect="true"
DataKeyNames = "UID,PoBillNum,AskBillNum,VendId,Site,Buyer,BuyerPhone,State,Remark,VendName,State_DESC,ModType_DESC,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,GUID" DataKeyNames = "UID,PoBillNum,AskBillNum,VendId,Site,Buyer,BuyerPhone,State,Remark,VendName,State_DESC,ModType_DESC,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,GUID"
OnRowDataBound="Grid_V_TB_ASK_RowDataBound" OnRowDataBound="Grid_V_TB_ASK_RowDataBound"
CssClass="maingrid" EnableRowDoubleClickEvent="True" OnSort="Grid_V_TB_ASK_Sort" SortField="CreateTime" CssClass="maingrid" EnableRowDoubleClickEvent="True" OnSort="Grid_V_TB_ASK_Sort" SortField="State" AllowSorting="true"
IsDatabasePaging="True" AllowPaging="True" OnRowDoubleClick="Grid_V_TB_ASK_RowDoubleClick" IsDatabasePaging="True" AllowPaging="True" OnRowDoubleClick="Grid_V_TB_ASK_RowDoubleClick"
AutoScroll="True" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_ASK_PageIndexChange"> AutoScroll="True" SortDirection="ASC" OnPageIndexChange="Grid_V_TB_ASK_PageIndexChange">
<PageItems> <PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator> </f:ToolbarSeparator>
@ -135,20 +134,20 @@
</f:DropDownList> </f:DropDownList>
</PageItems> </PageItems>
<Columns> <Columns>
<f:BoundField Width = "60px" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" /> <f:BoundField Width = "60px" SortField="State" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" />
<f:BoundField Width = "80px" DataField = "Flag" DataFormatString = "{0}" HeaderText = "是否完成" Hidden="true" /> <f:BoundField Width = "80px" SortField="Flag" DataField = "Flag" DataFormatString = "{0}" HeaderText = "是否完成" Hidden="true" />
<f:BoundField Width = "80px" DataField = "ModType_DESC" DataFormatString = "{0}" HeaderText = "单据类型" /> <f:BoundField Width = "80px" SortField="ModType_DESC" DataField = "ModType_DESC" DataFormatString = "{0}" HeaderText = "单据类型" />
<f:BoundField Width = "100px" DataField = "Month" DataFormatString = "{0}" HeaderText = "订单时间" /> <f:BoundField Width = "100px" SortField="EndTime" DataField = "Month" DataFormatString = "{0}" HeaderText = "订单时间" />
<f:BoundField Width = "100px" DataField = "AskBillNum" DataFormatString = "{0}" HeaderText = "要货看板编号" /> <f:BoundField Width = "100px" SortField="AskBillNum" DataField = "AskBillNum" DataFormatString = "{0}" HeaderText = "要货看板编号" />
<f:BoundField Width = "100px" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单号" /> <f:BoundField Width = "100px" SortField="PoBillNum" DataField = "PoBillNum" DataFormatString = "{0}" HeaderText = "订单号" />
<f:BoundField Width = "100px" DataField = "ErpBillNum" DataFormatString = "{0}" HeaderText ="ERP订单号" /> <f:BoundField Width = "100px" SortField="ErpBillNum" DataField = "ErpBillNum" DataFormatString = "{0}" HeaderText ="ERP订单号" />
<f:BoundField Width = "100px" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" /> <f:BoundField Width = "100px" SortField="VendName" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" />
<f:BoundField Width = "100px" DataField = "VendId" DataFormatString = "{0}" HeaderText = "供应商" /> <f:BoundField Width = "100px" SortField="VendId" DataField = "VendId" DataFormatString = "{0}" HeaderText = "供应商" />
<%--<f:BoundField Width = "100px" DataField = "Contacter" DataFormatString = "{0}" HeaderText = "发布人" />--%> <f:BoundField Width = "150px" SortField="BeginTime" DataField = "BeginTime" DataFormatString = "{0:yyyy-MM-dd HH:mm:ss}" HeaderText = "订货日期" />
<f:BoundField Width = "100px" DataField = "BeginTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "订货日期" /> <f:BoundField Width = "100px" SortField="EndTime" DataField = "EndTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "到货日期" />
<f:BoundField Width = "100px" DataField = "Site_Desc" DataFormatString = "{0}" HeaderText = "地点" /> <f:BoundField Width = "100px" SortField="Site_Desc" DataField = "Site_Desc" DataFormatString = "{0}" HeaderText = "地点" />
<f:BoundField Width = "100px" DataField = "Buyer" DataFormatString = "{0}" HeaderText = "收货人" /> <f:BoundField Width = "100px" SortField="Buyer" DataField = "Buyer" DataFormatString = "{0}" HeaderText = "收货人" />
<f:BoundField Width = "100px" DataField = "BuyerPhone" DataFormatString = "{0}" HeaderText = "收货电话" /> <f:BoundField Width = "100px" SortField="BuyerPhone" DataField = "BuyerPhone" DataFormatString = "{0}" HeaderText = "收货电话" />
</Columns> </Columns>
</f:Grid> </f:Grid>
</Items> </Items>

77
SCP/Views/沈阳金杯/PlanData/SCP_ASK.aspx.cs

@ -46,7 +46,7 @@ namespace SCP.Views.沈阳金杯.PlanData
SearchV_TB_ASKData((result) => { SearchV_TB_ASKData((result) => {
Grid_V_TB_ASK.RecordCount = result.Count(); Grid_V_TB_ASK.RecordCount = result.Count();
var list = SortAndPage<V_TB_ASK>(result, Grid_V_TB_ASK); var list = SortAndPage<V_TB_ASK>(result, Grid_V_TB_ASK);
var list_can = SCP_ASK_CONTROLLER.LOAD_ASK_DETAIL_CAN(list.OrderBy("State").ToList()); var list_can = SCP_ASK_CONTROLLER.LOAD_ASK_DETAIL_CAN(list.ToList());
Grid_V_TB_ASK.DataSource = list_can; Grid_V_TB_ASK.DataSource = list_can;
Grid_V_TB_ASK.DataBind(); Grid_V_TB_ASK.DataBind();
}); });
@ -65,9 +65,25 @@ namespace SCP.Views.沈阳金杯.PlanData
{ {
_entity.BeginTime = DP_StartDate.SelectedDate; _entity.BeginTime = DP_StartDate.SelectedDate;
} }
if (DP_StartDate.SelectedDate != null) if (DP_StartDate_End.SelectedDate != null)
{
DateTime BeginTime_End = new DateTime();
if (DateTime.TryParse(DP_StartDate_End.SelectedDate.ToString(), out BeginTime_End))
{
_entity.BeginTime_End = BeginTime_End.AddHours(23).AddMinutes(59).AddSeconds(59);
}
}
if (Date_EndDate_Start.SelectedDate != null)
{ {
_entity.EndTime = DP_StartDate.SelectedDate; _entity.EndTime_start = Date_EndDate_Start.SelectedDate;
}
if (Date_EndDate.SelectedDate != null)
{
DateTime EndTime = new DateTime();
if (DateTime.TryParse(Date_EndDate.SelectedDate.ToString(), out EndTime))
{
_entity.EndTime = EndTime.AddHours(23).AddMinutes(59).AddSeconds(59);
}
} }
if (!string.IsNullOrEmpty(DDL_State.SelectedValue)) if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{ {
@ -92,7 +108,6 @@ namespace SCP.Views.沈阳金杯.PlanData
} }
} }
_entity.UserInAddress = CurrentUser.FactoryList; _entity.UserInAddress = CurrentUser.FactoryList;
_entity.UserInVendIds = CurrentUser.VenderList;
SCP_ASK_CONTROLLER.Get_V_TB_ASK_List(_entity, (_ret) => SCP_ASK_CONTROLLER.Get_V_TB_ASK_List(_entity, (_ret) =>
{ {
if (_ret.State == ReturnStatus.Succeed) if (_ret.State == ReturnStatus.Succeed)
@ -111,7 +126,9 @@ namespace SCP.Views.沈阳金杯.PlanData
protected void Grid_V_TB_ASK_Sort(object sender, GridSortEventArgs e) protected void Grid_V_TB_ASK_Sort(object sender, GridSortEventArgs e)
{ {
Grid_V_TB_ASK.SortDirection = e.SortDirection;
Grid_V_TB_ASK.SortField = e.SortField;
BindAsk();
} }
@ -242,7 +259,39 @@ namespace SCP.Views.沈阳金杯.PlanData
Alert.Show(ret.Message); Alert.Show(ret.Message);
} }
} }
protected void BtnStop_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_ASK.SelectedRowIndexArray;
List<string> _AskList = new List<string>();
for (int i = 0, count = Grid_V_TB_ASK.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_ASK.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[2].ToString()))
{
_AskList.Add(rowDataKeys[2].ToString());
}
}
}
var ret = SCP_ASK_CONTROLLER.Save_TB_ASK_STATE(_AskList, AskState.Complete);
if (ret.State == ReturnStatus.Succeed)
{
if (ret.MessageList.Count > 0)
{
Alert.Show(string.Join("<br>", ret.MessageList));
}
else
{
Alert.Show("批量关闭完成成功!");
}
BindAsk();
}
else
{
Alert.Show(ret.Message);
}
}
protected void btnShow_Click(object sender, EventArgs e) protected void btnShow_Click(object sender, EventArgs e)
{ {
gp1.Hidden = false; gp1.Hidden = false;
@ -292,14 +341,22 @@ namespace SCP.Views.沈阳金杯.PlanData
{ {
_isAutoPublish = true; _isAutoPublish = true;
} }
var ret = SCP_PO_CONTROLLER.EXCEL_PO_TO_ASK(list, CurrentUser.Name, CurrentUser.ChineseName, DateTime.Now, BillModType.Non_Contract,_isAutoPublish); var ret = SCP_PO_CONTROLLER.EXCEL_PO_TO_ASK(datesetlist, CurrentUser.Name, CurrentUser.ChineseName, DateTime.Now, BillModType.Non_Contract, CurrentUser.FactoryList[0], _isAutoPublish);
List<string> message_list = SCP_PO_CONTROLLER.EXCEL_ASK_Check(list); List<string> message_list = SCP_PO_CONTROLLER.EXCEL_ASK_Check(list);
if (ret.State == ReturnStatus.Succeed && ret.Result == true) if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{ {
if (ret.MessageList.Count > 0)
{
message_list.AddRange(ret.MessageList);
}
if (message_list.Count > 0) if (message_list.Count > 0)
{ {
Alert.Show(string.Join("<br>", message_list)); Alert.Show(string.Join("<br>", message_list));
} }
else
{
Alert.Show("导入成功!");
}
BindAsk(); BindAsk();
} }
else else
@ -334,7 +391,11 @@ namespace SCP.Views.沈阳金杯.PlanData
string VendName = TXT_VendName.Text; string VendName = TXT_VendName.Text;
string State = DDL_State.SelectedValue; string State = DDL_State.SelectedValue;
string PartCode = TXT_PartCode.Text; string PartCode = TXT_PartCode.Text;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../PlanData/SCP_ASK_DETAIL.aspx?AskBillNum={0}&&VendName={1}&&State={2}&&PartCode={3}", AskBillNum, VendName, State, PartCode))); PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../PlanData/SCP_ASK_DETAIL_PARTCODE.aspx?AskBillNum={0}&&VendName={1}&&State={2}&&PartCode={3}", AskBillNum, VendName, State, PartCode)));
}
protected void LinkButton_Click(object sender, EventArgs e)
{
Alert.Show($"<a href=\'/uploadfiles/{".xlsx"}\'>{".xlsx"}</a>", "请点击文件名下载", MessageBoxIcon.Information);
} }
} }
} }

54
SCP/Views/沈阳金杯/PlanData/SCP_ASK.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.Views..PlanData { namespace SCP.Views..PlanData
{
public partial class SCP_ASK { public partial class SCP_ASK
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -84,6 +86,15 @@ namespace SCP.Views.沈阳金杯.PlanData {
/// </remarks> /// </remarks>
protected global::FineUI.Button BtnPublish; protected global::FineUI.Button BtnPublish;
/// <summary>
/// BtnStop 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnStop;
/// <summary> /// <summary>
/// btnShow 控件。 /// btnShow 控件。
/// </summary> /// </summary>
@ -120,6 +131,15 @@ namespace SCP.Views.沈阳金杯.PlanData {
/// </remarks> /// </remarks>
protected global::FineUI.Button btnAsn; protected global::FineUI.Button btnAsn;
/// <summary>
/// linkbutton 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.LinkButton linkbutton;
/// <summary> /// <summary>
/// gp1 控件。 /// gp1 控件。
/// </summary> /// </summary>
@ -156,6 +176,15 @@ namespace SCP.Views.沈阳金杯.PlanData {
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_Site_Desc; protected global::FineUI.TextBox TXT_Site_Desc;
/// <summary>
/// TXT_AskBillNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_AskBillNo;
/// <summary> /// <summary>
/// DP_StartDate 控件。 /// DP_StartDate 控件。
/// </summary> /// </summary>
@ -166,13 +195,13 @@ namespace SCP.Views.沈阳金杯.PlanData {
protected global::FineUI.DatePicker DP_StartDate; protected global::FineUI.DatePicker DP_StartDate;
/// <summary> /// <summary>
/// Date_EndDate 控件。 /// DP_StartDate_End 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DatePicker Date_EndDate; protected global::FineUI.DatePicker DP_StartDate_End;
/// <summary> /// <summary>
/// DDL_State 控件。 /// DDL_State 控件。
@ -184,22 +213,31 @@ namespace SCP.Views.沈阳金杯.PlanData {
protected global::FineUI.DropDownList DDL_State; protected global::FineUI.DropDownList DDL_State;
/// <summary> /// <summary>
/// TXT_PartCode 控件。 /// Date_EndDate_Start 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_PartCode; protected global::FineUI.DatePicker Date_EndDate_Start;
/// <summary> /// <summary>
/// TXT_AskBillNo 控件。 /// Date_EndDate 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_AskBillNo; protected global::FineUI.DatePicker Date_EndDate;
/// <summary>
/// TXT_PartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PartCode;
/// <summary> /// <summary>
/// BtnClose 控件。 /// BtnClose 控件。

61
SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL.aspx

@ -10,14 +10,12 @@
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> <f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> <f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar2" runat="server"> <f:Toolbar ID="Toolbar2" runat="server">
<Items> <Items>
<f:Button ID="BTN_refresh" runat="server" EnablePostBack="True" Text="刷新" Icon="box"> <f:Button ID="BTN_refresh" runat="server" EnablePostBack="True" Text="刷新" Icon="box">
</f:Button> </f:Button>
<%-- <f:Button ID="btnConfirm" runat="server" EnablePostBack="True" OnClick="btnConfirm_Click" Text="确认订单" Icon="CssAdd">
</f:Button>--%>
<f:Button ID="btnRelease" runat="server" EnablePostBack="True" OnClick="btnRelease_Click" Text="发布" Icon="CssAdd" OnClientClick="if(!confirm('是否要发布?'))return false;"> <f:Button ID="btnRelease" runat="server" EnablePostBack="True" OnClick="btnRelease_Click" Text="发布" Icon="CssAdd" OnClientClick="if(!confirm('是否要发布?'))return false;">
</f:Button> </f:Button>
<f:Button ID="btnReleaseCancel" runat="server" EnablePostBack="True" OnClick="btnReleaseCancel_Click" Text="取消发布" Icon="CssAdd" OnClientClick="if(!confirm('是否要取消发布?'))return false;"> <f:Button ID="btnReleaseCancel" runat="server" EnablePostBack="True" OnClick="btnReleaseCancel_Click" Text="取消发布" Icon="CssAdd" OnClientClick="if(!confirm('是否要取消发布?'))return false;">
@ -26,10 +24,14 @@
</f:Button> </f:Button>
<f:Button ID="btnReject" runat="server" EnablePostBack="True" OnClick="btnReject_Click" Text="看板作废" Icon="CssAdd" OnClientClick="if(!confirm('是否作废该订单?'))return false;"> <f:Button ID="btnReject" runat="server" EnablePostBack="True" OnClick="btnReject_Click" Text="看板作废" Icon="CssAdd" OnClientClick="if(!confirm('是否作废该订单?'))return false;">
</f:Button> </f:Button>
<f:Button ID="BTN_SAVE" runat="server" EnablePostBack="True" Text="保存" Icon="CssAdd" OnClick="BTN_SAVE_Click"> <f:Button ID="BTN_SAVE" runat="server" EnablePostBack="True" Text="保存修改明细" Icon="CssAdd" OnClick="BTN_SAVE_Click">
</f:Button>
<f:Button ID="ASK_SAVE" runat="server" EnablePostBack="True" Text="备注保存" Icon="CssAdd" OnClick="ASK_SAVE_Click">
</f:Button> </f:Button>
<f:Button ID="btnReduce" runat="server" EnablePostBack="True" OnClick="btnReduce_Click" Text="订单减产并发邮件" Hidden="true" Icon="CssAdd" OnClientClick="if(!confirm('是否要货单减产?'))return false;"> <f:Button ID="btnReduce" runat="server" EnablePostBack="True" OnClick="btnReduce_Click" Text="订单减产并发邮件" Hidden="true" Icon="CssAdd" OnClientClick="if(!confirm('是否要货单减产?'))return false;">
</f:Button> </f:Button>
<f:Button ID="btnDeleted" runat="server" Hidden="true" EnablePostBack="True" OnClick="btnDeleted_Click" Text="删除明细内容" Icon="CssAdd" OnClientClick="if(!confirm('是否删除,明细将不可恢复?'))return false;">
</f:Button>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
@ -40,35 +42,34 @@
<Items> <Items>
<f:TextBox runat="server" Label="单据状态" EmptyText="" Readonly="true" ID="TXT_State_DESC" /> <f:TextBox runat="server" Label="单据状态" EmptyText="" Readonly="true" ID="TXT_State_DESC" />
<f:TextBox runat="server" Label="要货看板号" EmptyText="" ID="TXT_AskBillNum" />
<f:TextBox runat="server" Label="订单编号" EmptyText="" ID="TXT_PoBillNum" /> <f:TextBox runat="server" Label="订单编号" EmptyText="" ID="TXT_PoBillNum" />
<f:TextBox runat="server" Label="供应商" EmptyText="" ID="TXT_VendName" />
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%"> <f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items> <Items>
<f:TextBox runat="server" Label="供应商编码" EmptyText="" ID="TXT_VendId" /> <f:TextBox runat="server" Label="供应商编码" EmptyText="" ID="TXT_VendId" />
<f:TextBox runat="server" Label="发往地点" EmptyText="" ID="TXT_Site" /> <f:TextBox runat="server" Label="供应商" EmptyText="" ID="TXT_VendName" />
<%-- <f:DropDownList ID="DDL_PORT" DataTextField="PORT_DESCRIPTION" DataValueField="PORT_NO" Required="true" runat="server" Label="收货口">
</f:DropDownList>--%>
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="要货日期" EmptyText="请选择日期" ID="DP_BeginTime" /> <f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="要货日期" EmptyText="请选择日期" ID="DP_BeginTime" />
<%--<f:DatePicker runat="server" Required ="true" Label="到货日期" EmptyText="请选择日期" ID="DP_EndTime" Readonly="false" CompareControl="DP_BeginTime" DateFormatString="yyyy-MM-dd HH:mm"
CompareOperator="GreaterThan" CompareMessage="到货应该大于订货日期"
ShowRedStar="True" />--%>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server" ColumnWidths="33% 33% 33%">
<Items> <Items>
<f:TextBox runat="server" Label="发往地点" EmptyText="" ID="TXT_Site" />
<f:TextBox ID="txtRemark" runat="server" Label="备注" Text=""> <f:TextBox ID="txtRemark" runat="server" Label="备注" Text="">
</f:TextBox> </f:TextBox>
<f:Label runat="server"></f:Label>
</Items> </Items>
</f:FormRow> </f:FormRow>
</Items> </Items>
</f:Form> </f:Form>
<f:Grid runat="server" ID="Grid_V_TB_ASK_DETAIL" <f:Grid runat="server" ID="Grid_V_TB_ASK_DETAIL"
DataKeyNames="UID,PoBillNum,PoLine,PartCode,PartDesc1,PartDesc2,AskBillNum,AskQty,ReduceQty" DataKeyNames="UID,PoBillNum,PoLine,PartCode,PartDesc1,PartDesc2,AskBillNum,AskQty,ReduceQty,EndTime"
IsDatabasePaging="True" AllowPaging="True" PageSize="10" OnPageIndexChange="Grid_V_TB_ASK_DETAIL_PageIndexChange" IsDatabasePaging="True" AllowPaging="True" PageSize="100" OnPageIndexChange="Grid_V_TB_ASK_DETAIL_PageIndexChange"
EnableRowSelectEvent="True" AutoScroll="True" SortField="PoLine" SortDirection="DESC" OnRowDataBound="Grid_V_TB_ASK_DETAIL_RowDataBound" AllowCellEditing="true" ClicksToEdit="2"> EnableRowSelectEvent="True" AutoScroll="True" SortField="PoLine" SortDirection="ASC" OnRowDataBound="Grid_V_TB_ASK_DETAIL_RowDataBound"
AllowCellEditing="true" ClicksToEdit="2" OnSort="Grid1_Sort" AllowSorting="true" BoxFlex="1">
<PageItems> <PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator> </f:ToolbarSeparator>
@ -76,16 +77,18 @@
</f:ToolbarText> </f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server"> runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="40" Value="40" />
<f:ListItem Text="80" Value="80" />
<f:ListItem Text="100" Value="100" /> <f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" /> <f:ListItem Text="200" Value="200" />
</f:DropDownList> </f:DropDownList>
</PageItems> </PageItems>
<Columns> <Columns>
<f:TemplateField Width="40px" HeaderText="选择">
<ItemTemplate>
<asp:CheckBox ID="chexkbox" Checked="false" runat="server"></asp:CheckBox>
</ItemTemplate>
</f:TemplateField>
<f:BoundField SortField="State" DataField="State" HeaderText="状态" ColumnID="State" Width="50px" Hidden="true" /> <f:BoundField SortField="State" DataField="State" HeaderText="状态" ColumnID="State" Width="50px" Hidden="true" />
<f:BoundField SortField="Line" DataField="PoLine" HeaderText="行号" ColumnID="Line" Width="40px" /> <f:BoundField SortField="PoLine" DataField="PoLine" HeaderText="行号" ColumnID="Line" Width="40px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode" Width="80px" /> <f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode" Width="80px" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="名称" ColumnID="PartDesc1" Width="150px" /> <f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="名称" ColumnID="PartDesc1" Width="150px" />
<f:BoundField SortField="PoUnit" DataField="PoUnit" HeaderText="单位" Hidden="true" ColumnID="PoUnit" Width="40px" /> <f:BoundField SortField="PoUnit" DataField="PoUnit" HeaderText="单位" Hidden="true" ColumnID="PoUnit" Width="40px" />
@ -101,7 +104,7 @@
<f:BoundField Width="80px" DataField="BeginTime" HeaderText="要货日期" ColumnID="BeginTime" /> <f:BoundField Width="80px" DataField="BeginTime" HeaderText="要货日期" ColumnID="BeginTime" />
<f:RenderField Width="100px" ColumnID="ReduceNumber" FieldType="Float" HeaderText="减产数量" > <f:RenderField Width="100px" ColumnID="ReduceNumber" FieldType="Float" HeaderText="减产数量" >
<Editor> <Editor>
<f:NumberBox ID="NumberBox1" runat="server" MinValue="-99999999" MaxValue="99999999" DecimalPrecision="2"> <f:NumberBox ID="NumberBox1" runat="server" MinValue="0" MaxValue="99999999" DecimalPrecision="2">
</f:NumberBox> </f:NumberBox>
</Editor> </Editor>
</f:RenderField> </f:RenderField>
@ -112,19 +115,15 @@
<f:BoundField Width="80px" DataField="ReceivedQty" DataFormatString="{0:F0}" HeaderText="合格数量" /> <f:BoundField Width="80px" DataField="ReceivedQty" DataFormatString="{0:F0}" HeaderText="合格数量" />
<f:BoundField Width="80px" DataField="RejectQty" DataFormatString="{0:F0}" HeaderText="退货数量" /> <f:BoundField Width="80px" DataField="RejectQty" DataFormatString="{0:F0}" HeaderText="退货数量" />
<f:BoundField Width="80px" DataField="InvoiceQty" DataFormatString="{0:F0}" HeaderText="开票数量" /> <f:BoundField Width="80px" DataField="InvoiceQty" DataFormatString="{0:F0}" HeaderText="开票数量" />
<f:BoundField SortField="EndTime" DataField="EndTime" HeaderText="到货日期" ColumnID="EndTime" /> <f:RenderField Width="120px" SortField="EndTime" ColumnID="EndTime" FieldType="Date" DataField="EndTime" HeaderText="到货日期" Renderer="Date" RendererArgument="yyyy-MM-dd">
<Editor>
<f:DatePicker ID="DatePicker1" Required="true" runat="server">
</f:DatePicker>
</Editor>
</f:RenderField>
<f:BoundField Width="80px" Hidden="true" DataField="ContractPrice" DataFormatString="{0}" HeaderText="合同价格" /> <f:BoundField Width="80px" Hidden="true" DataField="ContractPrice" DataFormatString="{0}" HeaderText="合同价格" />
<f:BoundField SortField="BlancePrice" Hidden="true" runat="server" HeaderText="合同差额" ColumnID="" DataField="BlancePrice" /> <f:BoundField SortField="BlancePrice" Hidden="true" runat="server" HeaderText="合同差额" ColumnID="" DataField="BlancePrice" />
<%-- <f:RenderField Width="100px" ColumnID="ReduceQty" FieldType="Float" HeaderText="已减数量"> <f:BoundField SortField="Remark" DataField="Remark" HeaderText="备注" ColumnID="Remark" />
<Editor>
<f:NumberBox ID="NumberBox2" runat="server" MinValue="0" MaxValue="99999999" DecimalPrecision="2" >
</f:NumberBox>
</Editor>
</f:RenderField>--%>
<%-- <f:BoundField SortField="TempQty" DataField="TempQty" HeaderText="待发数" ColumnID="TempQty" Width="60px" />
<f:BoundField SortField="ShipQty" DataField="ShippedQty" HeaderText="发货数" ColumnID="ShipQty" Width="60px" />
<f:BoundField SortField="ReceiveQty" DataField="ReceiveQty" HeaderText="收货数" ColumnID="ReceiveQty" Width="60px" />--%>
<f:BoundField SortField="RejectQty" DataField="Remark" HeaderText="说明" ColumnID="RejectQty" Hidden="true" />
<f:BoundField SortField="ReceivedPort_Desc" DataField="ReceivedPort_Desc" HeaderText="收货口" ColumnID="ReceivedPort_Desc" Hidden="true" /> <f:BoundField SortField="ReceivedPort_Desc" DataField="ReceivedPort_Desc" HeaderText="收货口" ColumnID="ReceivedPort_Desc" Hidden="true" />
</Columns> </Columns>
</f:Grid> </f:Grid>

180
SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL.aspx.cs

@ -21,25 +21,12 @@ namespace SCP.Views.沈阳金杯.PlanData
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
if (!string.IsNullOrEmpty(Request["AskBillNum"].Trim()))
{
F_PO_DETAIL.Hidden = false; F_PO_DETAIL.Hidden = false;
GetV_TB_POData(); GetV_TB_POData();
BindDetail(); BindDetail();
SetRoleRule(); SetRoleRule();
}
else
{
F_PO_DETAIL.Hidden = true;
SearchV_TB_ASK_DETAIL_VIEW((ret) => {
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
Grid_V_TB_ASK_DETAIL.DataSource = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(list.ToList());
Grid_V_TB_ASK_DETAIL.DataBind();
});
}
} }
} }
@ -82,14 +69,55 @@ namespace SCP.Views.沈阳金杯.PlanData
{ {
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL(); V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
_entity.AskBillNum= Request["AskBillNum"]; _entity.AskBillNum= Request["AskBillNum"];
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) => { SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed) if (_ret.State == ReturnStatus.Succeed)
{ {
p_action(_ret.Result); p_action(_ret.Result);
} }
}); });
} }
/// <summary>
/// 删除明细事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDeleted_Click(object sender, EventArgs e)
{
List<V_TB_ASK_DETAIL> _askList = new List<V_TB_ASK_DETAIL>();
if (Grid_V_TB_ASK_DETAIL.Rows.Count == 1)
{
Alert.Show("明细数量必须大于1,不能删除!");
return;
}
for (int i = 0, count = Grid_V_TB_ASK_DETAIL.Rows.Count; i < count; i++)
{
GridRow row = Grid_V_TB_ASK_DETAIL.Rows[i];
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
object[] rowDataKeys = Grid_V_TB_ASK_DETAIL.DataKeys[i];
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
System.Web.UI.WebControls.CheckBox _cb = (System.Web.UI.WebControls.CheckBox)row.FindControl("chexkbox");
if (_cb.Checked)
{
_askList.Add(_entity);
}
}
SCP_ASK_CONTROLLER.DEL_V_TB_ASK_DETAIL(_askList, (rs) =>
{
if (rs.State == ReturnStatus.Succeed)
{
if (rs.Result == true)
{
BindDetail();
}
else
{
Alert.Show("删除明细失败!");
}
}
});
}
public void GetV_TB_POData() public void GetV_TB_POData()
{ {
V_TB_ASK _entity = new V_TB_ASK(); V_TB_ASK _entity = new V_TB_ASK();
@ -111,6 +139,7 @@ namespace SCP.Views.沈阳金杯.PlanData
TXT_State.Text = _result.State==null?string.Empty: _result.State.Value.ToString(); TXT_State.Text = _result.State==null?string.Empty: _result.State.Value.ToString();
this.TXT_VendName.Text = _result.VendName; this.TXT_VendName.Text = _result.VendName;
this.txtRemark.Text = _result.Remark; this.txtRemark.Text = _result.Remark;
TXT_AskBillNum.Text = _result.AskBillNum;
DP_BeginTime.SelectedDate = _result.BeginTime; DP_BeginTime.SelectedDate = _result.BeginTime;
TXT_VendId.Text = _result.VendId; TXT_VendId.Text = _result.VendId;
//DDL_PORT.DataSource = ScpCache.PortList.Where(p => CurrentUser.FactoryList.Contains(p.FACTORY_ID)); //DDL_PORT.DataSource = ScpCache.PortList.Where(p => CurrentUser.FactoryList.Contains(p.FACTORY_ID));
@ -129,6 +158,7 @@ namespace SCP.Views.沈阳金杯.PlanData
BTN_SAVE.Hidden = false; BTN_SAVE.Hidden = false;
//btnConfirm.Hidden = true; //btnConfirm.Hidden = true;
btnReduce.Hidden = true; btnReduce.Hidden = true;
btnDeleted.Hidden = false;
} }
//发布 //发布
if (_result.State == (int)AskState.Release) if (_result.State == (int)AskState.Release)
@ -183,7 +213,8 @@ namespace SCP.Views.沈阳金杯.PlanData
} }
public void BindDetail() public void BindDetail()
{ {
SearchV_TB_ASK_DETAILData((ret) => { SearchV_TB_ASK_DETAILData((ret) =>
{
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count(); Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL); var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
Grid_V_TB_ASK_DETAIL.DataSource = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_ASK_CONTROLLER.LOAD_ASK_DETAIL_SUM(list.ToList())); Grid_V_TB_ASK_DETAIL.DataSource = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_ASK_CONTROLLER.LOAD_ASK_DETAIL_SUM(list.ToList()));
@ -286,10 +317,34 @@ namespace SCP.Views.沈阳金杯.PlanData
{ {
BindDetail(); BindDetail();
} }
protected void ASK_SAVE_Click(object sender, EventArgs e)
{
TB_ASK _list = new TB_ASK();
if (Session["Ask"] != null&& !string.IsNullOrEmpty( txtRemark.Text))
{
var _ask = Session["Ask"] as V_TB_ASK;
var ret = SCP_ASK_CONTROLLER.Save_TB_ASK(_ask.AskBillNum, txtRemark.Text);
if (ret.State == ReturnStatus.Succeed)
{
var list = ret.Result;
Alert.Show("保存成功!");
GetV_TB_POData();
BindDetail();
}
else
{
Alert.Show(string.Join(",", ret.MessageList.ToArray()));
}
}
else
{
Alert.Show("请刷新页面后点击保存!");
}
}
protected void BTN_SAVE_Click(object sender, EventArgs e) protected void BTN_SAVE_Click(object sender, EventArgs e)
{ {
List<TB_ASK_DETAIL> _list = new List<TB_ASK_DETAIL>(); List<TB_ASK_DETAIL> _list = new List<TB_ASK_DETAIL>();
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid_V_TB_ASK_DETAIL.GetModifiedDict();
for (int i = 0, count = Grid_V_TB_ASK_DETAIL.Rows.Count; i < count; i++) for (int i = 0, count = Grid_V_TB_ASK_DETAIL.Rows.Count; i < count; i++)
{ {
GridRow row = Grid_V_TB_ASK_DETAIL.Rows[i]; GridRow row = Grid_V_TB_ASK_DETAIL.Rows[i];
@ -302,6 +357,15 @@ namespace SCP.Views.沈阳金杯.PlanData
_txt.Text = "0"; _txt.Text = "0";
} }
_entity.AskQty = decimal.Parse(_txt.Text); _entity.AskQty = decimal.Parse(_txt.Text);
if (modifiedDict.Keys.Contains(i))
{
var modifyValue = modifiedDict[i];
if (modifyValue.Keys.Contains("EndTime"))
{
var _date = modifyValue["EndTime"];
_entity.EndTime = Convert.ToDateTime(_date);
}
}
if (_entity.AskQty > 0) if (_entity.AskQty > 0)
{ {
_list.Add(_entity); _list.Add(_entity);
@ -341,18 +405,22 @@ namespace SCP.Views.沈阳金杯.PlanData
GridRow row = Grid_V_TB_ASK_DETAIL.Rows[e.RowIndex]; GridRow row = Grid_V_TB_ASK_DETAIL.Rows[e.RowIndex];
System.Web.UI.WebControls.TextBox _txt = (System.Web.UI.WebControls.TextBox)row.FindControl("NB_PublishNum"); System.Web.UI.WebControls.TextBox _txt = (System.Web.UI.WebControls.TextBox)row.FindControl("NB_PublishNum");
_txt.Enabled = true; _txt.Enabled = true;
DatePicker1.Enabled = true;
} }
else else
{ {
GridRow row = Grid_V_TB_ASK_DETAIL.Rows[e.RowIndex]; GridRow row = Grid_V_TB_ASK_DETAIL.Rows[e.RowIndex];
System.Web.UI.WebControls.TextBox _txt = (System.Web.UI.WebControls.TextBox)row.FindControl("NB_PublishNum"); System.Web.UI.WebControls.TextBox _txt = (System.Web.UI.WebControls.TextBox)row.FindControl("NB_PublishNum");
_txt.Enabled =false; _txt.Enabled =false;
DatePicker1.Enabled = false;
} }
} }
protected void btnReduce_Click(object sender, EventArgs e) protected void btnReduce_Click(object sender, EventArgs e)
{ {
var _ask = Session["Ask"] as V_TB_ASK; var _ask = Session["Ask"] as V_TB_ASK;
StringBuilder _buffer = new StringBuilder();
_buffer.AppendFormat("订单编号【{0}】要货单号【{1}】<br>", _ask.PoBillNum, _ask.AskBillNum);
List<V_TB_ASK_DETAIL> _askList = new List<V_TB_ASK_DETAIL>(); List<V_TB_ASK_DETAIL> _askList = new List<V_TB_ASK_DETAIL>();
List<string> _lineList = new List<string>(); List<string> _lineList = new List<string>();
if (!string.IsNullOrEmpty(CurrentUser.Name)) if (!string.IsNullOrEmpty(CurrentUser.Name))
@ -398,6 +466,7 @@ namespace SCP.Views.沈阳金杯.PlanData
{ {
_lineList.Add(string.Format("减产数量不能小于!")); _lineList.Add(string.Format("减产数量不能小于!"));
} }
_buffer.AppendFormat("零件号【{0}】零件名称【{1}】本次减产数量【{2}】 累计减产数量【{3}】;<br>", _entity.PartCode, _entity.PartDesc1 + _entity.PartDesc2, _out.ToString(), _entity.ReduceQty.ToString());
} }
_askList.Add(_entity); _askList.Add(_entity);
@ -414,16 +483,8 @@ namespace SCP.Views.沈阳金杯.PlanData
var ret = SCP_ASK_CONTROLLER.Update_ReduceQty(_askList); var ret = SCP_ASK_CONTROLLER.Update_ReduceQty(_askList);
if (ret.State == ReturnStatus.Succeed) if (ret.State == ReturnStatus.Succeed)
{ {
StringBuilder _buffer = new StringBuilder(); Alert.Show("减产成功!");
if (_askList.Count > 0)
{
_buffer.AppendFormat("订单编号{0}要货单号{1}", _ask.PoBillNum, _ask.AskBillNum);
_askList.ForEach(p =>
{
_buffer.AppendFormat("{0}累计减产{1}\r\n", p.PartDesc1 + p.PartDesc2, p.ReduceQty.ToString());
});
BindDetail(); BindDetail();
}
SCP.Common.MailManager.SendMail(_ask.VendId, _buffer.ToString(), string.Format("要货看板编号{0}零件减产信息", _ask.AskBillNum)); SCP.Common.MailManager.SendMail(_ask.VendId, _buffer.ToString(), string.Format("要货看板编号{0}零件减产信息", _ask.AskBillNum));
} }
else else
@ -433,72 +494,11 @@ namespace SCP.Views.沈阳金杯.PlanData
} }
} }
} }
//protected void btnReduce_Click(object sender, EventArgs e) protected void Grid1_Sort(object sender, GridSortEventArgs e)
//{
// var _ask = Session["Ask"] as V_TB_ASK;
// List<V_TB_ASK_DETAIL> _askList = new List<V_TB_ASK_DETAIL>();
// for (int i = 0, count = Grid_V_TB_ASK_DETAIL.Rows.Count; i < count; i++)
// {
// GridRow row = Grid_V_TB_ASK_DETAIL.Rows[i];
// V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
// object[] rowDataKeys = Grid_V_TB_ASK_DETAIL.DataKeys[i];
// _entity.UID = ConvertHelper.To<Int64>(rowDataKeys[0]);
// _entity.PoLine = ConvertHelper.To<int>(rowDataKeys[2]);
// _entity.AskQty = ConvertHelper.To<Decimal>(rowDataKeys[7]);
// _entity.PartCode = rowDataKeys[3].ToString();
// _entity.PartDesc1 = rowDataKeys[4].ToString();
// _entity.PartDesc2 = rowDataKeys[5].ToString();
// _entity.ReduceQty = ConvertHelper.To<decimal>(rowDataKeys[8]);
// _entity.AskBillNum = _ask.AskBillNum;
// _entity.PoBillNum = _ask.PoBillNum;
// System.Web.UI.WebControls.TextBox _txt = (System.Web.UI.WebControls.TextBox)row.FindControl("NB_PublishNum");
// _entity.AskQty = decimal.Parse(_txt.Text);
// _askList.Add(_entity);
// }
// var ret = SCP_ASK_CONTROLLER.Save_ASK_MODIF_QTY(_ask, _askList);
// if (ret.State == ReturnStatus.Succeed)
// {
// if (ret.Result == true)
// {
// if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
// {
// SCP.Common.MailManager.SendMail(_ask.VendId, string.Format("要货看板编号{0}零件信息要货数量有变更", _ask.AskBillNum), string.Format("要货看板编号{0}零件信息有变更", _ask.AskBillNum), CurrentUser.FactoryList.FirstOrDefault());
// }
// BindDetail();
// Alert.Show("数量修改成功,请联系供应商,并已经发邮件给供应商!");
// }
// else
// {
// Alert.Show(string.Join("<br>", ret.MessageList));
// }
// }
//}
public void SearchV_TB_ASK_DETAIL_VIEW(Action<IQueryable<V_TB_ASK_DETAIL>> p_action)
{ {
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL(); Grid_V_TB_ASK_DETAIL.SortDirection = e.SortDirection;
_entity.AskBillNum = Request["AskBillNum"]; Grid_V_TB_ASK_DETAIL.SortField = e.SortField;
if (string.IsNullOrEmpty(Request["AskBillNum"].Trim())) BindDetail();
{
if (!string.IsNullOrEmpty("PartCode"))
{
_entity.PartCode = Request["PartCode"];
}
if (!string.IsNullOrEmpty(Request["State"]))
{
_entity.State = int.Parse(Request["State"]);
}
}
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) => {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
} }
} }

63
SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.Views..PlanData { namespace SCP.Views..PlanData
{
public partial class SCP_ASK_DETAIL { public partial class SCP_ASK_DETAIL
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -93,6 +95,15 @@ namespace SCP.Views.沈阳金杯.PlanData {
/// </remarks> /// </remarks>
protected global::FineUI.Button BTN_SAVE; protected global::FineUI.Button BTN_SAVE;
/// <summary>
/// ASK_SAVE 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button ASK_SAVE;
/// <summary> /// <summary>
/// btnReduce 控件。 /// btnReduce 控件。
/// </summary> /// </summary>
@ -102,6 +113,15 @@ namespace SCP.Views.沈阳金杯.PlanData {
/// </remarks> /// </remarks>
protected global::FineUI.Button btnReduce; protected global::FineUI.Button btnReduce;
/// <summary>
/// btnDeleted 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDeleted;
/// <summary> /// <summary>
/// F_PO_DETAIL 控件。 /// F_PO_DETAIL 控件。
/// </summary> /// </summary>
@ -121,22 +141,22 @@ namespace SCP.Views.沈阳金杯.PlanData {
protected global::FineUI.TextBox TXT_State_DESC; protected global::FineUI.TextBox TXT_State_DESC;
/// <summary> /// <summary>
/// TXT_PoBillNum 控件。 /// TXT_AskBillNum 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_PoBillNum; protected global::FineUI.TextBox TXT_AskBillNum;
/// <summary> /// <summary>
/// TXT_VendName 控件。 /// TXT_PoBillNum 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_VendName; protected global::FineUI.TextBox TXT_PoBillNum;
/// <summary> /// <summary>
/// TXT_VendId 控件。 /// TXT_VendId 控件。
@ -148,13 +168,13 @@ namespace SCP.Views.沈阳金杯.PlanData {
protected global::FineUI.TextBox TXT_VendId; protected global::FineUI.TextBox TXT_VendId;
/// <summary> /// <summary>
/// TXT_Site 控件。 /// TXT_VendName 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_Site; protected global::FineUI.TextBox TXT_VendName;
/// <summary> /// <summary>
/// DP_BeginTime 控件。 /// DP_BeginTime 控件。
@ -165,6 +185,15 @@ namespace SCP.Views.沈阳金杯.PlanData {
/// </remarks> /// </remarks>
protected global::FineUI.DatePicker DP_BeginTime; protected global::FineUI.DatePicker DP_BeginTime;
/// <summary>
/// TXT_Site 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Site;
/// <summary> /// <summary>
/// txtRemark 控件。 /// txtRemark 控件。
/// </summary> /// </summary>
@ -210,6 +239,15 @@ namespace SCP.Views.沈阳金杯.PlanData {
/// </remarks> /// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize; protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// chexkbox 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chexkbox;
/// <summary> /// <summary>
/// NB_PublishNum 控件。 /// NB_PublishNum 控件。
/// </summary> /// </summary>
@ -228,6 +266,15 @@ namespace SCP.Views.沈阳金杯.PlanData {
/// </remarks> /// </remarks>
protected global::FineUI.NumberBox NumberBox1; protected global::FineUI.NumberBox NumberBox1;
/// <summary>
/// DatePicker1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DatePicker1;
/// <summary> /// <summary>
/// Window1 控件。 /// Window1 控件。
/// </summary> /// </summary>

91
SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL_PARTCODE.aspx

@ -0,0 +1,91 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ASK_DETAIL_PARTCODE.aspx.cs" Inherits="SCP.Views.沈阳金杯.PlanData.SCP_ASK_DETAIL_PARTCODE" %>
<!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" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="BTN_refresh" runat="server" EnablePostBack="True" Text="刷新" Icon="box">
</f:Button>
<f:Button ID="btnReduce" runat="server" EnablePostBack="True" OnClick="btnReduce_Click" Text="订单减产并发邮件" Icon="CssAdd" OnClientClick="if(!confirm('是否要货单减产?'))return false;">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid runat="server" ID="Grid_V_TB_ASK_DETAIL"
DataKeyNames="UID,PoBillNum,PoLine,PartCode,PartDesc1,PartDesc2,AskBillNum,AskQty,ReduceQty,EndTime,VendId,State"
IsDatabasePaging="True" AllowPaging="True" PageSize="100" OnPageIndexChange="Grid_V_TB_ASK_DETAIL_PageIndexChange"
EnableRowSelectEvent="True" AutoScroll="True" SortField="PoLine" SortDirection="ASC"
AllowCellEditing="true" ClicksToEdit="2" OnSort="Grid1_Sort" AllowSorting="true" BoxFlex="1">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" 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:TemplateField Width="40px" HeaderText="选择" >
<ItemTemplate>
<asp:checkbox ID="chexkbox" Checked="false" runat="server" >
</asp:checkbox>
</ItemTemplate>
</f:TemplateField> --%>
<f:BoundField SortField="State" DataField="State" HeaderText="状态" ColumnID="State" Hidden="true" Width="50px"/>
<f:BoundField SortField="State_DESC" DataField="State_DESC" HeaderText="状态" ColumnID="State_DESC" Width="50px"/>
<f:BoundField SortField="AskBillNum" DataField="AskBillNum" HeaderText="要货看板号" ColumnID="AskBillNum" Width="100px" />
<f:BoundField SortField="PoLine" DataField="PoLine" HeaderText="行号" ColumnID="Line" Width="40px" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode" Width="80px" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="名称" ColumnID="PartDesc1" Width="150px" />
<f:BoundField SortField="PoUnit" DataField="PoUnit" HeaderText="单位" Hidden="true" ColumnID="PoUnit" Width="40px" />
<f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="标包数量" ColumnID="PackQty" Width="80px" DataFormatString="{0:F}" />
<f:BoundField SortField="CurrencyDesc" DataField="CurrencyDesc" HeaderText="币种" Hidden="true" ColumnID="CurrencyDesc" Width="40px" />
<f:BoundField SortField="Price" DataField="Price" HeaderText="价格" ColumnID="Price" Width="80px" Hidden="true" />
<f:TemplateField HeaderText="要货数量" Width="70px" ColumnID="AskQty" >
<ItemTemplate>
<asp:TextBox ID="NB_PublishNum" runat="server" Width="60px" Text='<%# Eval("AskQty") %>' onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:BoundField Width="80px" DataField="BeginTime" HeaderText="要货日期" ColumnID="BeginTime" />
<f:RenderField Width="100px" ColumnID="ReduceNumber" FieldType="Float" HeaderText="减产数量" >
<Editor>
<f:NumberBox ID="NumberBox1" runat="server" MinValue="0" MaxValue="99999999" DecimalPrecision="2" >
</f:NumberBox>
</Editor>
</f:RenderField>
<f:BoundField SortField="ReduceQty" DataField="ReduceQty" HeaderText="已减数量" ColumnID="ReceiveQty" Width="60px" DataFormatString="{0:F0}" />
<f:BoundField Width="80px" DataField="ShippedQty" DataFormatString="{0:F0}" HeaderText="已发货数量" />
<f:BoundField Width="80px" DataField="OnRoadQty" DataFormatString="{0:F0}" HeaderText="在途数量" />
<f:BoundField Width="80px" DataField="ArriveQty" DataFormatString="{0:F0}" HeaderText="到货数量" />
<f:BoundField Width="80px" DataField="ReceivedQty" DataFormatString="{0:F0}" HeaderText="合格数量" />
<f:BoundField Width="80px" DataField="RejectQty" DataFormatString="{0:F0}" HeaderText="退货数量" />
<f:BoundField Width="80px" DataField="InvoiceQty" DataFormatString="{0:F0}" HeaderText="开票数量" />
<f:RenderField Width="120px" SortField="EndTime" ColumnID="EndTime" FieldType="Date" DataField="EndTime" HeaderText="到货日期" Renderer="Date" RendererArgument="yyyy-MM-dd" >
<Editor>
<f:DatePicker ID="DatePicker1" Required="true" runat="server">
</f:DatePicker>
</Editor>
</f:RenderField>
<f:BoundField SortField="Remark" DataField="Remark" HeaderText="备注" ColumnID="Remark"/>
<f:BoundField SortField="ReceivedPort_Desc" DataField="ReceivedPort_Desc" HeaderText="收货口" ColumnID="ReceivedPort_Desc" Hidden="true" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

244
SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL_PARTCODE.aspx.cs

@ -0,0 +1,244 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using CK.SCP.Controller;
using FineUI;
using System.Text;
namespace SCP.Views..PlanData
{
public partial class SCP_ASK_DETAIL_PARTCODE : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SearchV_TB_ASK_DETAIL_VIEW((ret) =>
{
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
Grid_V_TB_ASK_DETAIL.DataSource = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_ASK_CONTROLLER.LOAD_ASK_DETAIL_SUM(list.ToList()));
Grid_V_TB_ASK_DETAIL.DataBind();
});
}
}
private void SetRoleRule()
{
IsPriceVisible(Grid_V_TB_ASK_DETAIL, "价格");
}
public void SearchV_TB_ASK_DETAILData(Action<IQueryable<V_TB_ASK_DETAIL>> p_action)
{
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
_entity.AskBillNum = Request["AskBillNum"];
if (!string.IsNullOrEmpty(CurrentUser.Name))
{
if (CurrentUser.Name != "admin" && !CurrentUser.RoleList.Contains("采购部门主管"))
{
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
{
if (CurrentUser.FactoryList.FirstOrDefault() == "0210")
{
if (!CurrentUser.RoleList.Contains("要货看板所有记录"))
{
_entity.CreateUser = CurrentUser.Name;
}
}
}
}
}
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
public void BindDetail()
{
SearchV_TB_ASK_DETAIL_VIEW((ret) =>
{
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
Grid_V_TB_ASK_DETAIL.DataSource = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_ASK_CONTROLLER.LOAD_ASK_DETAIL_SUM(list.ToList()));
Grid_V_TB_ASK_DETAIL.DataBind();
});
}
protected void Grid_V_TB_ASK_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
{
BindDetail();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_ASK_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail();
}
protected void btnReduce_Click(object sender, EventArgs e)
{
var dictionarys = new Dictionary<string, StringBuilder>();
List<V_TB_ASK_DETAIL> _askList = new List<V_TB_ASK_DETAIL>();
List<string> _lineList = new List<string>();
if (!string.IsNullOrEmpty(CurrentUser.Name))
{
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid_V_TB_ASK_DETAIL.GetModifiedDict();
for (int i = 0, count = Grid_V_TB_ASK_DETAIL.Rows.Count; i < count; i++)
{
GridRow row = Grid_V_TB_ASK_DETAIL.Rows[i];
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
object[] rowDataKeys = Grid_V_TB_ASK_DETAIL.DataKeys[i];
_entity.UID = ConvertHelper.To<Int64>(rowDataKeys[0]);
_entity.PoLine = ConvertHelper.To<int>(rowDataKeys[2]);
_entity.AskQty = ConvertHelper.To<Decimal>(rowDataKeys[7]);
_entity.PartCode = rowDataKeys[3].ToString();
_entity.PartDesc1 = rowDataKeys[4].ToString();
_entity.PartDesc2 = rowDataKeys[5].ToString();
_entity.ReduceQty = ConvertHelper.To<decimal>(rowDataKeys[8]);
_entity.AskBillNum = rowDataKeys[6].ToString();
_entity.PoBillNum = rowDataKeys[1].ToString();
_entity.VendId = rowDataKeys[10].ToString();
_entity.State = ConvertHelper.To<int>(rowDataKeys[11]);
if (modifiedDict.Keys.Contains(i))
{
var modifyValue = modifiedDict[i];
if (modifyValue.Keys.Contains("ReduceNumber"))
{
if (_entity.State == (int)AskState.Release || _entity.State == (int)AskState.New || _entity.State == (int)AskState.Reject)
{
_lineList.Add(string.Format("要货看板{0}产品名称:{1}的状态无法减产,请重新编辑!", _entity.AskBillNum, _entity.PartDesc1));
}
var _reduceNumber = modifyValue["ReduceNumber"];
decimal _out = 0;
bool _result = decimal.TryParse(_reduceNumber.ToString(), out _out);
if (_result == false)
{
_lineList.Add(string.Format("产品名称:{0}减产数量:{1}", _entity.PartDesc1, _reduceNumber.ToString()));
}
if (_out == 0)
{
continue;
}
decimal _qty = (_entity.ReduceQty == null) ? 0 : (decimal)_entity.ReduceQty;
_entity.ReduceQty = _qty + _out;
if (_entity.ReduceQty > _entity.AskQty)
{
_lineList.Add(string.Format("减产数量不能大于要货数量!"));
}
if (_entity.ReduceQty < 0)
{
_lineList.Add(string.Format("减产数量不能小于!"));
}
StringBuilder itm = new StringBuilder();
if (!dictionarys.TryGetValue(_entity.VendId, out itm))
{
StringBuilder _buffer = new StringBuilder();
_buffer.AppendFormat("订单编号【{0}】要货单号【{1}】零件号【{2}】零件名称【{3}】本次减产数量【{4}】累计减产数量【{5}】;<br>", _entity.PoBillNum, _entity.AskBillNum, _entity.PartCode, _entity.PartDesc1 + _entity.PartDesc2, _out.ToString(), _entity.ReduceQty.ToString(), Environment.NewLine);
dictionarys.Add(_entity.VendId, _buffer);
}
else
{
itm.AppendFormat("订单编号【{0}】要货单号【{1}】零件号【{2}】 零件名称【{3} 】本次减产数量【{4}】累计减产数量【{5}】;<br>", _entity.PoBillNum, _entity.AskBillNum, _entity.PartCode, _entity.PartDesc1 + _entity.PartDesc2, _out.ToString(), _entity.ReduceQty.ToString(), Environment.NewLine);
}
}
_askList.Add(_entity);
}
}
if (_lineList.Count > 0)
{
Alert.Show(string.Join("<br>", _lineList));
return;
}
if (_askList.Count > 0)
{
var ret = SCP_ASK_CONTROLLER.Update_ReduceQty(_askList);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("减产成功!");
BindDetail();
foreach (var itm in dictionarys)
{
SCP.Common.MailManager.SendMail(itm.Key, itm.Value.ToString(), "要货看板减产信息");
}
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
}
}
}
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
Grid_V_TB_ASK_DETAIL.SortDirection = e.SortDirection;
Grid_V_TB_ASK_DETAIL.SortField = e.SortField;
BindDetail();
}
public void SearchV_TB_ASK_DETAIL_VIEW(Action<IQueryable<V_TB_ASK_DETAIL>> p_action)
{
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
if (!string.IsNullOrEmpty(Request["AskBillNum"]))
{
_entity.PartCode = Request["AskBillNum"];
}
if (!string.IsNullOrEmpty(Request["PartCode"]))
{
_entity.PartCode = Request["PartCode"];
}
if (!string.IsNullOrEmpty(Request["State"]))
{
_entity.State = int.Parse(Request["State"]);
}
if (!string.IsNullOrEmpty(Request["VendName"]))
{
_entity.State = int.Parse(Request["VendName"]);
}
if (!string.IsNullOrEmpty(CurrentUser.Name))
{
if (CurrentUser.Name != "admin" && !CurrentUser.RoleList.Contains("采购部门主管"))
{
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
{
if (CurrentUser.FactoryList.FirstOrDefault() == "0210")
{
if (!CurrentUser.RoleList.Contains("要货看板所有记录"))
{
_entity.CreateUser = CurrentUser.Name;
}
}
}
}
}
_entity.UserInAddress = CurrentUser.FactoryList;
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
//protected void Grid_V_TB_ASK_DETAIL_RowDataBound(object sender, GridRowEventArgs e)
//{
// var itm = e.DataItem as V_TB_ASK_DETAIL;
// if(itm.State == (int)AskState.Release|| itm.State == (int)AskState.New|| itm.State == (int)AskState.Reject)
// {
// FineUI.NumberBox numbox = (FineUI.NumberBox) Grid_V_TB_ASK_DETAIL.Rows[e.RowIndex].FindControl("NumberBox1");
// numbox.Readonly = true;
// }
//}
}
}

125
SCP/Views/沈阳金杯/PlanData/SCP_ASK_DETAIL_PARTCODE.aspx.designer.cs

@ -0,0 +1,125 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..PlanData
{
public partial class SCP_ASK_DETAIL_PARTCODE
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// BTN_refresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_refresh;
/// <summary>
/// btnReduce 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnReduce;
/// <summary>
/// Grid_V_TB_ASK_DETAIL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_ASK_DETAIL;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// NB_PublishNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox NB_PublishNum;
/// <summary>
/// NumberBox1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.NumberBox NumberBox1;
/// <summary>
/// DatePicker1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DatePicker1;
}
}

55
SCP/Views/沈阳金杯/PlanData/SCP_ASN.aspx

@ -10,7 +10,7 @@
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> <f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> <f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items> <Items>
<f:Form runat="server"> <f:Form runat="server">
<Toolbars> <Toolbars>
@ -29,34 +29,20 @@
<Items> <Items>
<f:Form runat="server"> <f:Form runat="server">
<Rows> <Rows>
<f:FormRow runat="server">
<Items>
<f:DropDownList runat="server" ID="ddl" Label="状态">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="新建" Value="0" />
<f:ListItem Text="已发货" Value="1" />
<f:ListItem Text="已收货" Value="2" />
<f:ListItem Text="已作废" Value="-1" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server">
<Items> <Items>
<f:Label runat="server" Label="发货单号" /> <f:Label runat="server" Label="发货单号" />
<f:TextBox ID="txtBill" runat="server" /> <f:TextBox ID="TXT_AsnBill" runat="server" />
<f:Label runat="server" Label="供应商" /> <f:Label runat="server" Label="供应商编号" />
<f:TextBox ID="TXT_VenderName" runat="server" /> <f:TextBox ID="TXT_VenderCode" runat="server" />
<f:Label runat="server" Label="订单号" /> <f:Label runat="server" Label="订单号" />
<f:TextBox ID="txtPO" runat="server" /> <f:TextBox ID="TXT_PoBill" runat="server" />
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server" Hidden="true">
<Items> <Items>
<f:Label runat="server" Label="发往地点" />
<f:TextBox ID="txtShipTosite" runat="server" />
<f:DatePicker ID="dateShip" runat="server" Required="True" Label="发货时间" /> <f:DatePicker ID="dateShip" runat="server" Required="True" Label="发货时间" />
<f:Label runat="server" Label="发货时间" /> <f:DatePicker ID="dateReceive" runat="server" Required="true" Label="收货时间" />
<f:DatePicker ID="dateReceive" runat="server" Required="true" />
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server">
@ -70,9 +56,9 @@
</f:Form> </f:Form>
</Items> </Items>
</f:GroupPanel> </f:GroupPanel>
<f:Grid ID="Grid_V_TB_ASN" ShowBorder="true" ShowHeader="true" PageSize="20" BoxFlex="1" CssClass="maingrid" <f:Grid ID="Grid_V_TB_ASN" ShowBorder="true" ShowHeader="false" PageSize="20" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,AsnBillNum,AskBillNum,PoBillNum,VendId,State,Remark,ShipTime,ShipUser,ReceiveTime,ReceiveUser,ErpBillNum,ModType,Contacter,Buyer,BuyerPhone,VendName,Site,State_DESC,ModType_DESC,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,GUID" runat="server" DataKeyNames="UID,AsnBillNum,AskBillNum,PoBillNum,VendId,State,Remark,ShipTime,ShipUser,ReceiveTime,ReceiveUser,ErpBillNum,ModType,Contacter,Buyer,BuyerPhone,VendName,Site,State_DESC,ModType_DESC,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,GUID"
IsDatabasePaging="true" AllowPaging="true" SortDirection="DESC" SortField="ShipTime" IsDatabasePaging="true" AllowPaging="true" SortDirection="DESC" SortField="ShipTime" OnSort="Grid1_Sort" AllowSorting="true"
AutoScroll="True" EnableRowDoubleClickEvent="True" OnPageIndexChange="Grid_V_TB_ASN_PageIndexChange"> AutoScroll="True" EnableRowDoubleClickEvent="True" OnPageIndexChange="Grid_V_TB_ASN_PageIndexChange">
<PageItems> <PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
@ -81,7 +67,7 @@
</f:ToolbarText> </f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server"> runat="server">
<f:ListItem Text="20" Value="10" /> <f:ListItem Text="20" Value="20" />
<f:ListItem Text="40" Value="40" /> <f:ListItem Text="40" Value="40" />
<f:ListItem Text="80" Value="80" /> <f:ListItem Text="80" Value="80" />
<f:ListItem Text="100" Value="100" /> <f:ListItem Text="100" Value="100" />
@ -89,16 +75,17 @@
</f:DropDownList> </f:DropDownList>
</PageItems> </PageItems>
<Columns> <Columns>
<f:BoundField Width = "100px" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" /> <f:BoundField Width = "100px" SortField="State_DESC" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" />
<f:BoundField runat="server" HeaderText="发货单号" ColumnID="" DataField="AsnBillNum" /> <f:BoundField runat="server" SortField="AsnBillNum" HeaderText="发货单号" ColumnID="" DataField="AsnBillNum" />
<f:BoundField runat="server" HeaderText="车牌号" ColumnID="" DataField="PlateNumber"></f:BoundField> <f:BoundField runat="server" SortField="PlateNumber" HeaderText="车牌号" ColumnID="" DataField="PlateNumber"></f:BoundField>
<f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendName" /> <f:BoundField runat="server" SortField="VendId" HeaderText="供应商编码" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="订单号" ColumnID="" DataField="PoBillNum" /> <f:BoundField runat="server" SortField="VendName" HeaderText="供应商" ColumnID="" DataField="VendName" />
<f:BoundField Width = "100px" DataField = "ShipTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "发货时间" /> <f:BoundField runat="server" SortField="PoBillNum" HeaderText="订单号" ColumnID="" DataField="PoBillNum" />
<f:BoundField Width = "100px" DataField = "ShipUser" DataFormatString = "{0}" HeaderText = "发货人" /> <f:BoundField Width = "100px" SortField="ShipTime" DataField = "ShipTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "发货时间" />
<f:BoundField Width = "100px" DataField = "ReceiveTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "收货时间" /> <f:BoundField Width = "100px" SortField="ShipUser" DataField = "ShipUser" DataFormatString = "{0}" HeaderText = "发货人" />
<f:BoundField Width = "100px" DataField = "ReceiveUser" DataFormatString = "{0}" HeaderText = "收货人" /> <f:BoundField Width = "100px" SortField="ReceiveTime" DataField = "ReceiveTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "收货时间" />
<f:BoundField runat="server" HeaderText="发往地点" ColumnID="" DataField="Site_Desc" /> <f:BoundField Width = "100px" SortField="ReceiveUser" DataField = "ReceiveUser" DataFormatString = "{0}" HeaderText = "收货人" />
<f:BoundField runat="server" SortField="Site_Desc" HeaderText="发往地点" ColumnID="" DataField="Site_Desc" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" /> <f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns> </Columns>
</f:Grid> </f:Grid>

48
SCP/Views/沈阳金杯/PlanData/SCP_ASN.aspx.cs

@ -22,16 +22,16 @@ namespace SCP.Views.沈阳金杯.PlanData
} }
public void LoadData() public void LoadData()
{ {
if (!CurrentUser.RoleList.Contains("采购人员")) //if (!CurrentUser.RoleList.Contains("采购人员"))
{ //{
Alert.Show("当前用户角色不能操作该模块!"); // Alert.Show("当前用户角色不能操作该模块!");
return; // return;
} //}
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0) //if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
{ //{
Alert.Show("当前用户未选择地点!"); // Alert.Show("当前用户未选择地点!");
return; // return;
} //}
BindASN(); BindASN();
} }
@ -48,7 +48,26 @@ namespace SCP.Views.沈阳金杯.PlanData
{ {
V_TB_ASN _entity = new V_TB_ASN(); V_TB_ASN _entity = new V_TB_ASN();
_entity.IsDeleted = false; _entity.IsDeleted = false;
_entity.VendName = TXT_VenderName.Text; if (!string.IsNullOrEmpty(TXT_VenderCode.Text))
{
_entity.VendId = TXT_VenderCode.Text;
}
if (!string.IsNullOrEmpty(TXT_AsnBill.Text))
{
_entity.AsnBillNum = TXT_AsnBill.Text;
}
if (!string.IsNullOrEmpty(TXT_PoBill.Text))
{
_entity.PoBillNum = TXT_PoBill.Text;
}
if (dateShip.SelectedDate != null)
{
_entity.ShipTime = dateShip.SelectedDate;
}
if (dateReceive.SelectedDate != null)
{
_entity.ReceiveTime = dateReceive.SelectedDate;
}
_entity.UserInVendIds = CurrentUser.VenderList; _entity.UserInVendIds = CurrentUser.VenderList;
SCP_ASN_CONTROLLER.Get_V_TB_ASN_List(_entity, (_ret) => { SCP_ASN_CONTROLLER.Get_V_TB_ASN_List(_entity, (_ret) => {
if (_ret.State == ReturnStatus.Succeed) if (_ret.State == ReturnStatus.Succeed)
@ -57,7 +76,12 @@ namespace SCP.Views.沈阳金杯.PlanData
} }
}); });
} }
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
Grid_V_TB_ASN.SortDirection = e.SortDirection;
Grid_V_TB_ASN.SortField = e.SortField;
BindASN();
}
protected void btnBarCodeList_Click(object sender, EventArgs e) protected void btnBarCodeList_Click(object sender, EventArgs e)
{ {
if (Grid_V_TB_ASN.SelectedRowIndexArray.Count() == 0) if (Grid_V_TB_ASN.SelectedRowIndexArray.Count() == 0)

36
SCP/Views/沈阳金杯/PlanData/SCP_ASN.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.Views..PlanData { namespace SCP.Views..PlanData
{
public partial class SCP_ASN { public partial class SCP_ASN
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -76,49 +78,31 @@ namespace SCP.Views.沈阳金杯.PlanData {
protected global::FineUI.GroupPanel gp1; protected global::FineUI.GroupPanel gp1;
/// <summary> /// <summary>
/// ddl 控件。 /// TXT_AsnBill 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DropDownList ddl; protected global::FineUI.TextBox TXT_AsnBill;
/// <summary> /// <summary>
/// txtBill 控件。 /// TXT_VenderCode 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox txtBill; protected global::FineUI.TextBox TXT_VenderCode;
/// <summary> /// <summary>
/// TXT_VenderName 控件。 /// TXT_PoBill 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_VenderName; protected global::FineUI.TextBox TXT_PoBill;
/// <summary>
/// txtPO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtPO;
/// <summary>
/// txtShipTosite 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtShipTosite;
/// <summary> /// <summary>
/// dateShip 控件。 /// dateShip 控件。

101
SCP/Views/沈阳金杯/PlanData/SCP_FORECAST.aspx

@ -0,0 +1,101 @@
<%@ 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="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<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="BulletTick" OnClick="btnSave_Click" ></f:Button>
<f:Button ID="btnCancleSave" runat="server" Hidden="true" Text="取消确认" Icon="BulletCross" 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" OnSort="Grid_V_TB_FORECAST_Sort" AllowSorting="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" SortField="UID" HeaderText="UID" Hidden="true" ColumnID="" DataField="UID" />
<f:BoundField runat="server" SortField="State_DESC" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" SortField="VendId" HeaderText="供应商编号" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" SortField="PartCode" HeaderText="零件编号" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" SortField="Month" 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" SortField="State" HeaderText="状态" Hidden="true" ColumnID="" DataField="State" />
<f:BoundField runat="server" SortField="CreateUser" HeaderText="创建者" ColumnID="" DataField="CreateUser" />
<f:BoundField Width="100px" SortField="CreateTime" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

245
SCP/Views/沈阳金杯/PlanData/SCP_FORECAST.aspx.cs

@ -0,0 +1,245 @@
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_SYJB>(ExcelHelper.RemoveEmpty(_dt)).ToList();
var ret = SCP_FORECAST_CONTROLLER.EXCEL_FORECAST_MOD_SYJB(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);
}
}
protected void Grid_V_TB_FORECAST_Sort(object sender, GridSortEventArgs e)
{
Grid_V_TB_FORECAST.SortDirection = e.SortDirection;
Grid_V_TB_FORECAST.SortField = e.SortField;
BindData();
}
}
}

82
SCP/Views/沈阳金杯/SCP_PO_ARRIVE.aspx.designer.cs → SCP/Views/沈阳金杯/PlanData/SCP_FORECAST.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP. { namespace SCP.Views..PlanData
{
public partial class SCP_PO_ARRIVE { public partial class SCP_FORECAST
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -31,174 +33,174 @@ namespace SCP.沈阳金杯 {
protected global::FineUI.Panel Panel1; protected global::FineUI.Panel Panel1;
/// <summary> /// <summary>
/// Toolbar2 控件。 /// Toolbar1 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Toolbar Toolbar2; protected global::FineUI.Toolbar Toolbar1;
/// <summary> /// <summary>
/// BTN_REFRESH 控件。 /// ToolbarSeparator1 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button BTN_REFRESH; protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary> /// <summary>
/// BTN_RELESE 控件。 /// btnRefresh 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button BTN_RELESE; protected global::FineUI.Button btnRefresh;
/// <summary> /// <summary>
/// btn_query 控件。 /// btnSave 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button btn_query; protected global::FineUI.Button btnSave;
/// <summary> /// <summary>
/// btn_export 控件。 /// btnCancleSave 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button btn_export; protected global::FineUI.Button btnCancleSave;
/// <summary> /// <summary>
/// TXT_State_DESC 控件。 /// btnDelete 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_State_DESC; protected global::FineUI.Button btnDelete;
/// <summary> /// <summary>
/// TXT_PoBillNum 控件。 /// FileUp 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_PoBillNum; protected global::FineUI.FileUpload FileUp;
/// <summary> /// <summary>
/// TXT_VendName 控件。 /// btnInput 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_VendName; protected global::FineUI.Button btnInput;
/// <summary> /// <summary>
/// DP_BeginTime 控件。 /// extForm1 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DatePicker DP_BeginTime; protected global::FineUI.Form extForm1;
/// <summary> /// <summary>
/// DP_EndTime 控件。 /// FormRow_2 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DatePicker DP_EndTime; protected global::FineUI.FormRow FormRow_2;
/// <summary> /// <summary>
/// TXT_Site 控件。 /// TextPartCode 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_Site; protected global::FineUI.TextBox TextPartCode;
/// <summary> /// <summary>
/// txtRemark 控件。 /// TextVendId 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox txtRemark; protected global::FineUI.TextBox TextVendId;
/// <summary> /// <summary>
/// HF_GRID_INDEX 控件。 /// ddl_Day 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.HiddenField HF_GRID_INDEX; protected global::FineUI.DropDownList ddl_Day;
/// <summary> /// <summary>
/// Grid_V_TB_PO_DETAIL 控件。 /// DDL_State 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Grid Grid_V_TB_PO_DETAIL; protected global::FineUI.DropDownList DDL_State;
/// <summary> /// <summary>
/// ToolbarSeparator1 控件。 /// Button1 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1; protected global::FineUI.Button Button1;
/// <summary> /// <summary>
/// ToolbarText1 控件。 /// Grid_V_TB_FORECAST 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.ToolbarText ToolbarText1; protected global::FineUI.Grid Grid_V_TB_FORECAST;
/// <summary> /// <summary>
/// ddlGridPageSize 控件。 /// ToolbarSeparator2 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize; protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
/// <summary> /// <summary>
/// Window1 控件。 /// ToolbarText1 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Window Window1; protected global::FineUI.ToolbarText ToolbarText1;
/// <summary> /// <summary>
/// WindowUpload 控件。 /// ddlGridPageSize 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Window WindowUpload; protected global::FineUI.DropDownList ddlGridPageSize;
} }
} }

52
SCP/Views/沈阳金杯/PlanData/SCP_PRODUCT_DETAIL.aspx

@ -0,0 +1,52 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PRODUCT_DETAIL.aspx.cs" Inherits="SCP.Views.沈阳金杯.PlanData.SCP_PRODUCT_DETAIL" %>
<!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 ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Label ID="Label2" LabelWidth="60px" runat="server" Label="零件号">
</f:Label>
<f:TextBox ID="txtPartcode" runat="server" Label="" Text="">
</f:TextBox>
<f:Button ID="btnSearch" runat="server" Text="查找" OnClick="btnSearch_Click" Icon="SystemSearch">
</f:Button>
<f:Button ID="Button1" runat="server" Text="导出" OnClick="btnOutput_Click" Icon="PageExcel">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="false" Title="" ShowHeader="False" SortField="UID" BoxFlex="1"
AllowPaging="true" PageSize="20" IsDatabasePaging="true" OnPageIndexChange="Grid1_PageIndexChange"
ShowBorder="False" AllowSorting="true" DataKeyNames="UID,PartCode,PartDesc1,VendId,qty">
<Columns>
<f:BoundField SortField="UID" DataField="UID" Width="250px" Hidden="true" HeaderText="UID" ColumnID="UID" />
<f:BoundField SortField="PartCode" DataField="PartCode" Width="250px" HeaderText="零件号" ColumnID="PartCode" />
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" Width="250px" HeaderText="零件名称" ColumnID="PartDesc1" />
<f:BoundField SortField="VendId" DataField="VendId" HeaderText="供应商编号" Width="250px" ColumnID="VendId" />
<f:BoundField SortField="qty" DataField="qty" HeaderText="库存数量" Width="250px" ColumnID="qty" DataFormatString="{0:#.####}" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="400px" Width="700px">
</f:Window>
<script type="text/javascript">
</script>
</form>
</body>
</html>

102
SCP/Views/沈阳金杯/PlanData/SCP_PRODUCT_DETAIL.aspx.cs

@ -0,0 +1,102 @@
using ChangKeTec.Wms.Models.Wms;
using CK.SCP.Controller;
using System;
using System.Collections.Generic;
using System.Linq;
namespace SCP.Views..PlanData
{
public partial class SCP_PRODUCT_DETAIL : PageBase
{
/// <summary>
/// 页面加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDetail();
}
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindDetail()
{
SearchV_TB_ASN_DETAILData((ret) =>
{
Grid1.RecordCount = ret.Count();
var list = SortAndPage<VIEW_STOCK_VEND>(ret, Grid1);
Grid1.DataSource = list;
Grid1.DataBind();
});
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_TB_ASN_DETAILData(Action<IQueryable<VIEW_STOCK_VEND>> p_action)
{
VIEW_STOCK_VEND _entity = new VIEW_STOCK_VEND();
_entity.PartCode = txtPartcode.Text;
_entity.UserInVendIds = CurrentUser.VenderList;
SCP_WMS_CONTROLLER.Get_VIEW_STOCK_DETAIL(_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)
{
BindDetail();
}
protected void Grid1_PageIndexChange(object sender, FineUI.GridPageEventArgs e)
{
BindDetail();
}
/// <summary>
/// 导出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOutput_Click(object sender, EventArgs e)
{
List<VIEW_STOCK_VEND> _ls = new List<VIEW_STOCK_VEND>();
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
VIEW_STOCK_VEND inv = new VIEW_STOCK_VEND();
object[] rowDataKeys = Grid1.DataKeys[i];
inv.PartCode = rowDataKeys[1].ToString();//零件号
inv.PartDesc1 = rowDataKeys[2].ToString();//零件名称
inv.VendId = rowDataKeys[3].ToString();//供应商编码
if (rowDataKeys[4] != null)
{
inv.qty = decimal.Parse(rowDataKeys[4].ToString());//数量
}
_ls.Add(inv);
}
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "PartCode", "零件号" },
{ "PartDesc1", "零件名称" },
{ "VendId", "供应商编号" },
{ "qty", "库存数量" }
};
string url = EntityListToExcel2003(cellheader, _ls, "库存明细");
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save