Browse Source

锦州项目合并

master
lvzb 4 years ago
parent
commit
8a0da15b0b
  1. 1
      Controller/CK.SCP.Controller.csproj
  2. 10
      Controller/PublicDataController.cs
  3. 6
      Controller/SCP_ASK_CONTROLLER.cs
  4. 34
      Controller/SCP_EXCEL_CONTROLLER.cs
  5. 445
      Controller/SCP_FORECAST_CONTROLLER.cs
  6. 30
      Controller/SCP_INFO_CONTROLLER.cs
  7. 1
      Controller/SCP_INVOICE_CONTROLLER.cs
  8. 6
      Controller/SCP_PO_CONTROLLER.cs
  9. 13
      Controller/SCP_RECEIVE_CONTROLLER.cs
  10. 192
      Controller/SCP_REPORT_CONTROLLER.cs
  11. 74
      Controller/SCP_WMS_CONTROLLER.cs
  12. 77
      Controller/UniApiController.cs
  13. 5
      Models/CK.SCP.Models.csproj
  14. 2
      Models/ScpEntities.cs
  15. 3
      Models/ScpEntity/ExcelExportEnttity/SCP_ASK_DETAIL_EXPORT.cs
  16. 16
      Models/ScpEntity/ExcelExportEnttity/SCP_FORECAST_EXPORT.cs
  17. 24
      Models/ScpEntity/ExcelExportEnttity/SCP_OTD_REPORT_EXPORT.cs
  18. 3
      Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs
  19. 2
      Models/ScpEntity/SCP_OTD_EXPORT.cs
  20. 23
      Models/ScpEntity/TB_FORECAST.cs
  21. 2
      Models/ScpEntity/TB_INVOICE_DETAIL.cs
  22. 6
      Models/ScpEntity/TB_RECEIVE_DETAIL_QAD.cs
  23. 6
      Models/ScpEntity/TB_RECEIVE_QAD.cs
  24. 2
      Models/ScpEntity/TS_BARCODE_CUSTOM.cs
  25. 22
      Models/ScpEntity/V_FORECAST_REPORT.cs
  26. 3
      Models/ScpEntity/V_TB_ASK_DETAIL.cs
  27. 48
      Models/ScpEntity/V_TB_FORECAST.cs
  28. 2
      Models/ScpEntity/V_TB_INCOMPLETE_ASK.cs
  29. 28
      Models/ScpEntity/V_TB_PO_INCOMPLETE.cs
  30. 2
      Models/ScpEntity/V_TB_RECEIVE_LIST.cs
  31. 2
      Models/UniApiEntity/xxscm_inv_det.cs
  32. 2
      Models/UniApiEntity/xxwms_arv_det.cs
  33. 2
      Models/UniApiEntity/xxwms_rc_det.cs
  34. 33
      Models/WmsEntity/VIEW_STOCK_QTY.cs
  35. 2
      Models/WmsEntity/VIEW_STOCK_VEND.cs
  36. 1
      Models/WmsEntity/WmsEntities.cs
  37. 18
      SCP.sln
  38. 2
      SCP/Admin/user.aspx
  39. 4
      SCP/Admin/user_new.aspx
  40. 118
      SCP/Business/PageBase.cs
  41. 11
      SCP/Common/MailHelper.cs
  42. 80
      SCP/SCP.csproj
  43. 16
      SCP/Views/BasicData/SCP_INFO_EDIT.aspx.cs
  44. 10
      SCP/Views/BasicData/SCP_VenderUser.aspx
  45. 2
      SCP/Views/BasicData/SCP_VenderUser.aspx.cs
  46. 27
      SCP/Views/BasicData/SCP_VenderUser.aspx.designer.cs
  47. 2
      SCP/Views/PlanData/SCP_ASK.aspx
  48. 4
      SCP/Views/PlanData/SCP_ASK_DETAIL.aspx
  49. 113
      SCP/Views/PlanData/SCP_FORECAST.aspx
  50. 239
      SCP/Views/PlanData/SCP_FORECAST.aspx.cs
  51. 197
      SCP/Views/PlanData/SCP_FORECAST.aspx.designer.cs
  52. 20
      SCP/Views/PlanData/SCP_PO_DETAIL_OUT.aspx
  53. 4
      SCP/Views/PlanData/SCP_PO_DETAIL_OUT.aspx.cs
  54. 73
      SCP/Views/PlanData/SCP_UNI_API.aspx
  55. 100
      SCP/Views/PlanData/SCP_UNI_API.aspx.cs
  56. 152
      SCP/Views/PlanData/SCP_UNI_API.aspx.designer.cs
  57. 94
      SCP/Views/Report/SCP_OTD_REPORT.aspx
  58. 137
      SCP/Views/Report/SCP_OTD_REPORT.aspx.cs
  59. 179
      SCP/Views/Report/SCP_OTD_REPORT.aspx.designer.cs
  60. 3
      SCP/Views/SupplierData/SCP_ASK.aspx.cs
  61. 3
      SCP/Views/SupplierData/SCP_ASK_DETAIL.aspx
  62. 113
      SCP/Views/SupplierData/SCP_FORECAST.aspx
  63. 240
      SCP/Views/SupplierData/SCP_FORECAST.aspx.cs
  64. 197
      SCP/Views/SupplierData/SCP_FORECAST.aspx.designer.cs
  65. 10
      SCP/Views/SupplierData/SCP_INFO_EDIT.aspx.cs
  66. 7
      SCP/Views/SupplierData/SCP_INVOICE_CREATE.aspx
  67. 6
      SCP/Views/SupplierData/SCP_INVOICE_CREATE.aspx.cs
  68. 9
      SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx
  69. 30
      SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx.cs
  70. 81
      SCP/Views/SupplierData/SCP_STOCK.aspx
  71. 92
      SCP/Views/SupplierData/SCP_STOCK.aspx.cs
  72. 142
      SCP/Views/SupplierData/SCP_STOCK.aspx.designer.cs
  73. 75
      SCP/Views/SupplierData/SCP_STOCK_DETAIL.aspx
  74. 116
      SCP/Views/SupplierData/SCP_STOCK_DETAIL.aspx.cs
  75. 179
      SCP/Views/SupplierData/SCP_STOCK_DETAIL.aspx.designer.cs
  76. 54
      SCP/Views/SupplierData/SCP_UNPAID.aspx
  77. 17
      SCP/Views/SupplierData/SCP_UNPAID.aspx.cs
  78. 69
      SCP/Views/SupplierData/SCP_UNPAID.aspx.designer.cs
  79. 2
      SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM.aspx
  80. 2
      SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx
  81. 15
      SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx.designer.cs
  82. 8
      SCP/Views/WarehouseData/SCP_RECEIVE.aspx
  83. 41
      SCP/Views/WarehouseData/SCP_RECEIVE.aspx.cs
  84. 1
      SCP/Views/WarehouseData/SCP_RECEIVE_DETAIL.aspx
  85. 21
      SCP/Views/WarehouseData/SCP_RECEIVE_DETAIL.aspx.cs
  86. 2
      SCP/Views/WarehouseData/SCP_RECEIVE_DETAIL_VIEW.aspx.cs
  87. 1
      SCP/Views/沈阳金杯/Report/SCP_INCOMPLETE_ASK.aspx
  88. 132
      SCP/Views/锦州锦恒/SupplierData/SCP_ASN.aspx
  89. 168
      SCP/Views/锦州锦恒/SupplierData/SCP_ASN.aspx.cs
  90. 287
      SCP/Views/锦州锦恒/SupplierData/SCP_ASN.aspx.designer.cs
  91. 184
      SCP/Views/锦州锦恒/SupplierData/SCP_ASN_DETAIL.aspx
  92. 561
      SCP/Views/锦州锦恒/SupplierData/SCP_ASN_DETAIL.aspx.cs
  93. 323
      SCP/Views/锦州锦恒/SupplierData/SCP_ASN_DETAIL.aspx.designer.cs
  94. 38
      SCP/Views/锦州锦恒/SupplierData/SCP_SELECT_MAKE.aspx
  95. 33
      SCP/Views/锦州锦恒/SupplierData/SCP_SELECT_MAKE.aspx.cs
  96. 80
      SCP/Views/锦州锦恒/SupplierData/SCP_SELECT_MAKE.aspx.designer.cs
  97. 64
      SCP/Views/锦州锦恒/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx
  98. 130
      SCP/Views/锦州锦恒/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.cs
  99. 161
      SCP/Views/锦州锦恒/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.designer.cs
  100. 11
      SCP/Web.config

1
Controller/CK.SCP.Controller.csproj

@ -58,6 +58,7 @@
<Compile Include="SCP_BARCODE_CONTROLLER_CUSTOM.cs" /> <Compile Include="SCP_BARCODE_CONTROLLER_CUSTOM.cs" />
<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_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" />

10
Controller/PublicDataController.cs

@ -81,7 +81,7 @@ namespace CK.SCP.Controller
{ {
public static string GetUserlistSql(string p_roleName, string p_Domain) public static string GetUserlistSql(string p_roleName, string p_Domain, string p_username)
{ {
StringBuilder _builder = new StringBuilder(); StringBuilder _builder = new StringBuilder();
_builder.Append("select u.*from Users u "); _builder.Append("select u.*from Users u ");
@ -90,18 +90,22 @@ namespace CK.SCP.Controller
_builder.Append("Inner join FactoryUsers fu on u.ID = fu.UserID "); _builder.Append("Inner join FactoryUsers fu on u.ID = fu.UserID ");
_builder.Append("inner join TA_FACTORY f on fu.FACTORY_ID = f.ID "); _builder.Append("inner join TA_FACTORY f on fu.FACTORY_ID = f.ID ");
_builder.AppendFormat("where r.id = '{0}' AND F.FactoryId = '{1}' ",p_roleName,p_Domain); _builder.AppendFormat("where r.id = '{0}' AND F.FactoryId = '{1}' ",p_roleName,p_Domain);
if (!string.IsNullOrEmpty(p_username))
{
_builder.AppendFormat(" AND u.Name like '%{0}%'" , p_username);
}
return _builder.ToString(); return _builder.ToString();
} }
public static void Get_UserList(string p_roleName, string p_Domain,Action<ResultObject<IQueryable<User>>> p_action) public static void Get_UserList(string p_username,string p_roleName, string p_Domain,Action<ResultObject<IQueryable<User>>> p_action)
{ {
ResultObject<IQueryable<User>> _ret = new ResultObject<IQueryable<User>>(); ResultObject<IQueryable<User>> _ret = new ResultObject<IQueryable<User>>();
try try
{ {
using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance()) using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance())
{ {
string sql = GetUserlistSql(p_roleName, p_Domain); string sql = GetUserlistSql(p_roleName, p_Domain, p_username);
IQueryable<User> q = db.Database.SqlQuery<User>(sql).AsQueryable(); IQueryable<User> q = db.Database.SqlQuery<User>(sql).AsQueryable();
_ret.State = ReturnStatus.Succeed; _ret.State = ReturnStatus.Succeed;

6
Controller/SCP_ASK_CONTROLLER.cs

@ -353,7 +353,10 @@ namespace CK.SCP.Controller
{ {
q = q.Where(p => p.AskBillNum == p_entity.AskBillNum); q = q.Where(p => p.AskBillNum == p_entity.AskBillNum);
} }
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
}
if (!string.IsNullOrEmpty(p_entity.CreateUser)) if (!string.IsNullOrEmpty(p_entity.CreateUser))
{ {
q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser)); q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser));
@ -543,6 +546,7 @@ namespace CK.SCP.Controller
} }
}); });
_detail.OnRoadQty = Convert.ToDecimal(_detail.Qty) - _detail.ArriveQty; _detail.OnRoadQty = Convert.ToDecimal(_detail.Qty) - _detail.ArriveQty;
_detail.DepositQty = _detail.ArriveQty - _detail.ReceivedQty;
} }
} }
} }

34
Controller/SCP_EXCEL_CONTROLLER.cs

@ -113,6 +113,9 @@ namespace CK.SCP.Controller
po_detail. = itm.DockCode; po_detail. = itm.DockCode;
po_detail. = itm.ProjectId; po_detail. = itm.ProjectId;
po_detail. = string.Empty; po_detail. = string.Empty;
po_detail. = "0";
po_detail. = "0";
po_detail. = "0";
_exportDetailList.Add(po_detail); _exportDetailList.Add(po_detail);
}); });
@ -201,6 +204,9 @@ namespace CK.SCP.Controller
//_entity.价格 = itm.Price.ToString(); //_entity.价格 = itm.Price.ToString();
_entity. = itm.AskQty.ToString(); _entity. = itm.AskQty.ToString();
_entity. = string.IsNullOrEmpty(itm.Remark)?string.Empty:itm.Remark.ToString(); _entity. = string.IsNullOrEmpty(itm.Remark)?string.Empty:itm.Remark.ToString();
_entity. = itm.OneMonth.ToString();
_entity.= itm.TwoMonth.ToString();
_entity. = itm.ThreeMonth.ToString();
_exportDetailList.Add(_entity); _exportDetailList.Add(_entity);
}); });
@ -321,6 +327,34 @@ 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;
}
} }
} }

445
Controller/SCP_FORECAST_CONTROLLER.cs

@ -0,0 +1,445 @@
using CK.SCP.Models;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Utils;
using System;
using System.Collections.Generic;
using System.Data.Entity.Core;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Controller
{
public class SCP_FORECAST_CONTROLLER
{
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_action"></param>
public static void Get_V_TB_FORECAST_List(V_TB_FORECAST p_entity, Action<ResultObject<IQueryable<V_TB_FORECAST>>> p_action)
{
ResultObject<IQueryable<V_TB_FORECAST>> _ret = new ResultObject<IQueryable<V_TB_FORECAST>>();
try
{
using (Models.ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TB_FORECAST> q = db.V_TB_FORECAST;
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
q = q.Where(p => p.VendId == p_entity.VendId);
}
if (p_entity.BillStateList != null && p_entity.BillStateList.Count > 0)
{
q = q.Where(p => p_entity.BillStateList.Contains((int)p.State));
}
if (!string.IsNullOrEmpty(p_entity.State_DESC))
{
q = q.Where(p => p.State_DESC.Contains(p_entity.State_DESC));
}
//if (!string.IsNullOrEmpty(p_entity.Month))
//{
// q = q.Where(p => p.Month == p_entity.Month);
//}
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
{
q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
}
if (!string.IsNullOrEmpty(p_entity.CreateUser))
{
q = q.Where(p => p.CreateUser == p_entity.CreateUser);
}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", e.Message);
throw e;
}
}
/// <summary>
/// EXCEL导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="p_creator"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_FORECAST_MOD(List<SCP_FORECAST_EXPORT> p_order_list, string p_creator, string site)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
int number = 1;
List<string> lineError = new List<string>();
List<string> ErrorList = new List<string>();
var _lst = p_order_list;
_lst.ForEach
(p =>
{
var _ls = CheckExcelMode_Forecast(db, p);
if (_ls.Count > 0)
{
lineError.Add(number.ToString());
ErrorList.Add(string.Join("<br>", _ls.ToArray()));
}
number++;
});
if (lineError.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.AddRange(ErrorList);
_ret.Result = false;
}
else
{
_lst.ForEach(p =>
{
// var _item = db.TB_FORECAST.SingleOrDefault(t => t.PartCode == p.零件编号.ToUpper() && t.VendId == p.供应商编码 && t.Month == p.月份) ??
// new TB_FORECAST { PartCode = p.零件编号.ToUpper(), VendId = p.供应商编码, Month = p.月份, GUID = System.Guid.NewGuid() };
var _item = new TB_FORECAST();
_item.PoType = p.;
_item.VendId = p.;
_item.GUID = System.Guid.NewGuid();
_item.PartCode = p.;
_item.PoLine =Int32.Parse(p.);
_item.ShippdedPlace = p.;
_item.Unit = p.;
_item.Qty = decimal.Parse(p.);
_item.ProductStatus = p.;
_item.IsUrgent = p.;
_item.ShippdedTime = DateTime.Parse(p.);
_item.ShippdedPlace = p.;
_item.MonthQty = decimal.Parse(p.);
_item.MonthQty1 = decimal.Parse(p.1);
_item.MonthQty2 = decimal.Parse(p.2);
_item.MonthQty3 = decimal.Parse(p.3);
_item.Ontime = p.;
_item.Datetime = p.;
_item.Remark = p.;
_item.IsDeleted = false;
_item.CreateUser = p_creator;
_item.CreateTime = DateTime.Now;
_item.State = (int)ForecastState.New;
_item.UpdateInfo = "";
_item.Site = site;
db.TB_FORECAST.AddOrUpdate(_item);
});
if (_ret.MessageList.Count == 0)
{
int state = db.SaveChanges();
if (state != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
/// <summary>
/// 导入验证
/// </summary>
/// <param name="db"></param>
/// <param name="p_excel"></param>
/// <returns></returns>
private static List<string> CheckExcelMode_Forecast(ScpEntities db, SCP_FORECAST_EXPORT p_excel)
{
List<string> ErrorList = new List<string>();
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.1) ||
string.IsNullOrEmpty(p_excel.2) ||
string.IsNullOrEmpty(p_excel.3))
{
ErrorList.Add(string.Format("零件编号【{0}】有填写为空!", p_excel.));
}
return ErrorList;
}
public static ResultObject<bool> Save_TB_FORECAST_STATE(List<long> p_list, string p_user, ForecastState State)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (State == ForecastState.Confirm)
{
var _ls = db.TB_FORECAST.Where(p => p_list.Contains(p.UID)).ToList();
int count = _ls.Count(p => p.State == (int)ForecastState.New);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p =>
{
p.State = (int)ForecastState.Confirm;
p.UpdateTime = DateTime.Now;
p.UpdateUser = p_user;
p.UpdateInfo = "供应商确认";
}
);
db.TB_FORECAST.AddOrUpdate(p => p.UID, _ls.ToArray());
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "选择的记录,有已经确认的数据!";
}
}
if (State == ForecastState.Reject)
{
var _ls = db.TB_FORECAST.Where(p => p_list.Contains(p.UID)).ToList();
int count = _ls.Count(p => p.State == (int)ForecastState.New);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p =>
{
p.State = (int)ForecastState.Reject;
p.UpdateTime = DateTime.Now;
p.UpdateUser = p_user;
p.UpdateInfo = "作废";
p.IsDeleted = true ;
}
);
db.TB_FORECAST.AddOrUpdate(p => p.UID, _ls.ToArray());
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "选择的记录,有已经确认的数据!";
}
}
if (State == ForecastState.New)
{
var _ls = db.TB_FORECAST.Where(p => p_list.Contains(p.UID)).ToList();
int count = _ls.Count(p => p.State == (int)ForecastState.Confirm);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p =>
{
p.State = (int)ForecastState.New;
p.UpdateTime = DateTime.Now;
p.UpdateUser = p_user;
p.UpdateInfo = "取消确认";
}
);
db.TB_FORECAST.AddOrUpdate(p => p.UID, _ls.ToArray());
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "选择的记录,有不是确认的数据!";
}
}
if (string.IsNullOrEmpty(_ret.Message))
{
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "数据更新失败!";
}
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
}
}

30
Controller/SCP_INFO_CONTROLLER.cs

@ -260,14 +260,25 @@ namespace CK.SCP.Controller
public static bool SaveInfo(TA_INFO model) public static ResultObject<bool> SaveInfo(TA_INFO model)
{ {
ResultObject<bool> _ret = new ResultObject<bool>();
try try
{ {
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{ {
db.TA_Info.AddOrUpdate(model); db.TA_Info.AddOrUpdate(model);
db.SaveChanges(); 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)//捕获实体验证异常 catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
@ -282,13 +293,18 @@ namespace CK.SCP.Controller
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); 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_INFO_CONTROLLER), "SaveInfo", sb.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INFO_CONTROLLER), "SaveInfo", 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.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INFO_CONTROLLER), "SaveInfo", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INFO_CONTROLLER), "SaveInfo", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
} }
@ -296,6 +312,9 @@ namespace CK.SCP.Controller
{ {
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INFO_CONTROLLER), "SaveInfo", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INFO_CONTROLLER), "SaveInfo", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
@ -312,10 +331,13 @@ namespace CK.SCP.Controller
} }
catch (Exception e) catch (Exception e)
{ {
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INFO_CONTROLLER), "SaveInfo", e.Message); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INFO_CONTROLLER), "SaveInfo", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e; throw e;
} }
return true; return _ret;
} }
public static bool UpdateInfo(TA_INFO model) public static bool UpdateInfo(TA_INFO model)

1
Controller/SCP_INVOICE_CONTROLLER.cs

@ -985,6 +985,7 @@ namespace CK.SCP.Controller
invocieDetail.PoBillNum = p.PoBillNum; invocieDetail.PoBillNum = p.PoBillNum;
invocieDetail.PoLineNum = p.PoLine; invocieDetail.PoLineNum = p.PoLine;
invocieDetail.RecvBillNum = p.RecvBillNum; invocieDetail.RecvBillNum = p.RecvBillNum;
invocieDetail.ErpRecvBillNum = p.ErpRecvBillNum;
invocieDetail.CreateUser = invoice.CreateUser; invocieDetail.CreateUser = invoice.CreateUser;
invocieDetail.CreateTime = invoice.CreateTime; invocieDetail.CreateTime = invoice.CreateTime;
invocieDetail.PoUnit = p.PoUnit; //自己改数据库 invocieDetail.PoUnit = p.PoUnit; //自己改数据库

6
Controller/SCP_PO_CONTROLLER.cs

@ -671,7 +671,6 @@ namespace CK.SCP.Controller
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.))
{ {
@ -1012,12 +1011,13 @@ namespace CK.SCP.Controller
_t_ASK_Detail.GUID = Guid.NewGuid(); _t_ASK_Detail.GUID = Guid.NewGuid();
_t_ASK_Detail.Remark = _ask.Site; _t_ASK_Detail.Remark = _ask.Site;
_t_ASK_Detail.UpdateInfo = itm.; _t_ASK_Detail.UpdateInfo = itm.;
_t_ASK_Detail.Extend1 = itm.;
_t_ASK_Detail.Extend2 = itm.;
_t_ASK_Detail.Extend3 = itm.;
db.TB_ASK_DETAIL.Add(_t_ASK_Detail); db.TB_ASK_DETAIL.Add(_t_ASK_Detail);
_ls.Add(_t_ASK_Detail); _ls.Add(_t_ASK_Detail);
// _number++; // _number++;
}); });
} }
else else
{ {

13
Controller/SCP_RECEIVE_CONTROLLER.cs

@ -60,7 +60,7 @@ 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)); q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser)||p.CreateUser==null);
} }
if (p_entity.IsDeleted != false) if (p_entity.IsDeleted != false)
{ {
@ -642,9 +642,9 @@ namespace CK.SCP.Controller
{ {
p.OperName = userName; p.OperName = userName;
p.State = (int)ReceiveState.Check; p.State = (int)ReceiveState.Check;
var _list = db.TB_RECEIVE_DETAIL.Where(itm => itm.RecvBillNum == p.RecvBillNum && itm.Remark == p_site).ToList(); var _list = db.TB_RECEIVE_DETAIL_QAD.Where(itm => itm.RecvBillNum == p.RecvBillNum && itm.Site == p_site).ToList();
_list.ForEach(itm => itm.State = (int)ReceiveState.Check); _list.ForEach(itm => itm.State = (int)ReceiveState.Check);
db.TB_RECEIVE_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray()); db.TB_RECEIVE_DETAIL_QAD.AddOrUpdate(itm => itm.UID, _list.ToArray());
#region 收货审核提醒供应商提起发票申请 #region 收货审核提醒供应商提起发票申请
TB_PENING_ITEMS _item = new TB_PENING_ITEMS(); TB_PENING_ITEMS _item = new TB_PENING_ITEMS();
_item.ROLE_NAME = "供应商"; _item.ROLE_NAME = "供应商";
@ -692,7 +692,7 @@ namespace CK.SCP.Controller
p.OperName = userName; p.OperName = userName;
p.State = (int)ReceiveState.Reject; p.State = (int)ReceiveState.Reject;
p.IsDeleted = true; p.IsDeleted = true;
var _list = db.TB_RECEIVE_DETAIL.Where(itm => itm.RecvBillNum == p.RecvBillNum && p.Site == p_site).ToList(); var _list = db.TB_RECEIVE_DETAIL_QAD.Where(itm => itm.RecvBillNum == p.RecvBillNum && p.Site == p_site).ToList();
_list.ForEach(itm => _list.ForEach(itm =>
{ {
itm.State = (int)ReceiveState.Reject; itm.State = (int)ReceiveState.Reject;
@ -700,7 +700,7 @@ namespace CK.SCP.Controller
} }
); );
db.TB_RECEIVE_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray()); db.TB_RECEIVE_DETAIL_QAD.AddOrUpdate(itm => itm.UID, _list.ToArray());
} }
@ -1652,7 +1652,8 @@ namespace CK.SCP.Controller
var _ls = p_list.Select(p => p.UID).ToList(); var _ls = p_list.Select(p => p.UID).ToList();
var _list=db.TB_RECEIVE_DETAIL.Where(p => _ls.Contains(p.UID)).ToList(); var _list=db.TB_RECEIVE_DETAIL.Where(p => _ls.Contains(p.UID)).ToList();
_list.ForEach(p => { _list.ForEach(p =>
{
var _entity=p_list.Where(itm => itm.UID == p.UID).FirstOrDefault(); var _entity=p_list.Where(itm => itm.UID == p.UID).FirstOrDefault();
if (_entity != null) if (_entity != null)
{ {

192
Controller/SCP_REPORT_CONTROLLER.cs

@ -630,7 +630,7 @@ namespace CK.SCP.Controller
StringBuilder _builder = new StringBuilder(); StringBuilder _builder = new StringBuilder();
_builder.Append(" SELECT A.UID, A.RecvBillNum, A.PoLine, A.PartCode, A.Batch, A.Qty, A.DockCode, A.Remark, A.CreateTime, A.CreateUser, "); _builder.Append(" SELECT A.UID, A.RecvBillNum, A.PoLine, A.PartCode, A.Batch, A.Qty, A.DockCode, A.Remark, A.CreateTime, A.CreateUser, ");
_builder.Append(" A.IsDeleted, A.GUID, A.AsnBillNum, A.Site, A.VendId, A.ShipTime, A.OperName, A.PartDesc1, A.State, A.PoBillNum, "); _builder.Append(" A.IsDeleted, A.GUID, A.AsnBillNum, A.Site, A.VendId, A.ShipTime, A.OperName, A.PartDesc1, A.State, A.PoBillNum, ");
_builder.Append(" B.VendName, B.Site_Desc, p.Price, p.Currency, A.Unit, A.VendBatch, A.PoUnit, A.LocUnit, A.BillType_DESC, "); _builder.Append(" B.VendName, B.Site_Desc, isnull(p.Price,0) as Price, p.Currency, A.Unit, A.VendBatch, A.PoUnit, A.LocUnit, A.BillType_DESC, ");
_builder.Append(" B.State_DESC, p.BeginTime,SUM(isnull(C.Qty,0)) as InvQty,an.AskBillNum "); _builder.Append(" B.State_DESC, p.BeginTime,SUM(isnull(C.Qty,0)) as InvQty,an.AskBillNum ");
_builder.Append(" FROM dbo.V_TB_RECEIVE_DETAIL AS A LEFT OUTER JOIN "); _builder.Append(" FROM dbo.V_TB_RECEIVE_DETAIL AS A LEFT OUTER JOIN ");
_builder.Append(" dbo.V_TB_RECEIVE AS B ON A.RecvBillNum = B.RecvBillNum LEFT OUTER JOIN "); _builder.Append(" dbo.V_TB_RECEIVE AS B ON A.RecvBillNum = B.RecvBillNum LEFT OUTER JOIN ");
@ -761,27 +761,27 @@ namespace CK.SCP.Controller
_builder.Append(" on s1.AskBillNum=s2.AskBillNum and s1.PartCode=s2.PartCode and s1.PoLine=s2.PoLine"); _builder.Append(" on s1.AskBillNum=s2.AskBillNum and s1.PartCode=s2.PartCode and s1.PoLine=s2.PoLine");
return _builder.ToString(); return _builder.ToString();
} }
//public static string Get_V_SCP_FORECAST_REPORT_SQL(V_FORECAST_REPORT p_entity) public static string Get_V_SCP_FORECAST_REPORT_SQL(V_FORECAST_REPORT p_entity)
//{ {
// StringBuilder _builder = new StringBuilder(); StringBuilder _builder = new StringBuilder();
// _builder.Append(" select B.PartCode,B.VendId,B.AskQty,B.Month, ISNULL(c.MonthQty1,0) as MonthQty1 ,ISNULL(c.MonthQty2,0) as MonthQty2 ,ISNULL(c.MonthQty3,0) as MonthQty3 from ( "); _builder.Append(" select B.PartCode,B.VendId,B.AskQty,B.Month, ISNULL(c.MonthQty1,0) as MonthQty1 ,ISNULL(c.MonthQty2,0) as MonthQty2 ,ISNULL(c.MonthQty3,0) as MonthQty3 from ( ");
// _builder.Append(" (selecT PartCode,VendId ,MONTH(BeginTime) as Month,sum(AskQty) as AskQty from V_TB_ASK_DETAIL A "); _builder.Append(" (selecT PartCode,VendId ,MONTH(BeginTime) as Month,sum(AskQty) as AskQty from V_TB_ASK_DETAIL A ");
// _builder.Append(" where A.IsDeleted=0 group by A.PartCode,A.VendId ,MONTH(A.BeginTime)) B LEFT OUTER JOIN "); _builder.Append(" where A.IsDeleted=0 group by A.PartCode,A.VendId ,MONTH(A.BeginTime)) B LEFT OUTER JOIN ");
// _builder.Append(" TB_FORECAST c on B.PartCode=c.PartCode and B.VendId=c.VendId and b.Month=c.Month and c.IsDeleted=0 and c.State=1 ) where 1=1 "); _builder.Append(" TB_FORECAST c on B.PartCode=c.PartCode and B.VendId=c.VendId and b.Month=c.Month and c.IsDeleted=0 and c.State=1 ) where 1=1 ");
// if (!string.IsNullOrEmpty(p_entity.PartCode)) if (!string.IsNullOrEmpty(p_entity.PartCode))
// { {
// _builder.AppendFormat(" And B.PartCode='{0}'", p_entity.PartCode); _builder.AppendFormat(" And B.PartCode='{0}'", p_entity.PartCode);
// } }
// if (!string.IsNullOrEmpty(p_entity.VendId)) if (!string.IsNullOrEmpty(p_entity.VendId))
// { {
// _builder.AppendFormat(" And B.VendId='{0}'", p_entity.VendId); _builder.AppendFormat(" And B.VendId='{0}'", p_entity.VendId);
// } }
// if (p_entity.Month!=0) if (p_entity.Month!=0)
// { {
// _builder.AppendFormat(" And B.Month='{0}'", p_entity.Month); _builder.AppendFormat(" And B.Month='{0}'", p_entity.Month);
// } }
// return _builder.ToString(); return _builder.ToString();
//} }
/// <summary> /// <summary>
/// 按零件编号获取及时率语句(沈阳) /// 按零件编号获取及时率语句(沈阳)
/// </summary> /// </summary>
@ -791,13 +791,13 @@ namespace CK.SCP.Controller
{ {
StringBuilder _builder = new StringBuilder(); StringBuilder _builder = new StringBuilder();
_builder.Append(" select h.PartCode ,sum (h.Qty) as ArriveQty , SUM(AskQty) as AskQty ,(SUM(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 sum(Qty)=0 Then 0 ELSE (sum (NntimelyQty)/sum(Qty)) END) as OTD , sum (h.Qty)/sum(AskQty) AS ArriveOTD from ( SELECT 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, (CASE WHEN DATEDIFF(day, A.ShipTime, p.EndTime) > 0 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(" 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 "); _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 ");
if (p_entity.BeginTime != null) if (p_entity.BeginTime != null)
{ {
_builder.AppendFormat(" where p.EndTime>='{0}'", p_entity.BeginTime); _builder.AppendFormat(" AND p.EndTime>='{0}'", p_entity.BeginTime);
} }
if (p_entity.EndTime != null) if (p_entity.EndTime != null)
{ {
@ -807,7 +807,11 @@ namespace CK.SCP.Controller
{ {
_builder.AppendFormat(" AND p.PartCode='{0}'", p_entity.PartCode); _builder.AppendFormat(" AND p.PartCode='{0}'", p_entity.PartCode);
} }
_builder.Append(") as h group by h.PartCode"); if (!string.IsNullOrEmpty(p_entity.VendId))
{
_builder.AppendFormat(" AND p.VendId='{0}'", p_entity.VendId);
}
_builder.Append(") as h group by h.PartCode ,h.VendId ,h.AskBillNum,h.EndTime,h.Site,h.AskQty");
return _builder.ToString(); return _builder.ToString();
} }
@ -819,88 +823,88 @@ namespace CK.SCP.Controller
public static string Get_V_SCP_OTD_REPORT_SQL_VendId(SCP_OTD_EXPORT p_entity) public static string Get_V_SCP_OTD_REPORT_SQL_VendId(SCP_OTD_EXPORT p_entity)
{ {
StringBuilder _builder = new StringBuilder(); StringBuilder _builder = new StringBuilder();
_builder.Append(" select h.VendId ,sum (h.Qty) as ArriveQty , SUM(AskQty) as AskQty ,(SUM(AskQty) -sum (h.Qty)) as Qty ,sum(h.NntimelyQty) as NntimelyQty , "); _builder.Append(" select h.AskBillNum ,h.EndTime, h.Site, h.VendId ,sum (h.Qty) as ArriveQty , AskQty ,(AskQty -sum (h.Qty)) as Qty ,sum(h.NntimelyQty) as NntimelyQty , ");
_builder.Append(" (CASE WHEN sum(Qty)=0 Then 0 ELSE (sum (NntimelyQty)/sum(Qty)) END) as OTD , sum (h.Qty)/sum(AskQty) AS ArriveOTD from ( SELECT p.VendId, p.AskBillNum, 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, ISNULL(A.Qty,0) as Qty, ");
_builder.Append(" p.AskQty, (CASE WHEN DATEDIFF(day, A.ShipTime, p.EndTime) > 0 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(" 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 "); _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(" where p.EndTime>='{0}'", p_entity.BeginTime); _builder.AppendFormat(" AND p.EndTime>='{0}'", p_entity.BeginTime);
} }
if (p_entity.EndTime != null) if (p_entity.EndTime != null)
{ {
_builder.AppendFormat(" AND p.EndTime<='{0}' ", p_entity.EndTime); _builder.AppendFormat(" AND p.EndTime<='{0}' ", p_entity.EndTime);
} }
if (!string.IsNullOrEmpty(p_entity.PartCode)) if (!string.IsNullOrEmpty(p_entity.VendId))
{ {
_builder.AppendFormat(" AND p.VendId='{0}'", p_entity.VendId); _builder.AppendFormat(" AND p.VendId='{0}'", p_entity.VendId);
} }
_builder.Append(") as h group by h.VendId"); _builder.Append(") as h group by h.VendId,h.Site,h.AskQty,h.AskBillNum,h.EndTime");
return _builder.ToString(); return _builder.ToString();
} }
//public static void Get_V_SCP_FORECAST_REPORT_List(V_FORECAST_REPORT p_entity, Action<ResultObject<IQueryable<V_FORECAST_REPORT>>> p_action) public static void Get_V_SCP_FORECAST_REPORT_List(V_FORECAST_REPORT p_entity, Action<ResultObject<IQueryable<V_FORECAST_REPORT>>> p_action)
//{ {
// ResultObject<IQueryable<V_FORECAST_REPORT>> _ret = new ResultObject<IQueryable<V_FORECAST_REPORT>>(); ResultObject<IQueryable<V_FORECAST_REPORT>> _ret = new ResultObject<IQueryable<V_FORECAST_REPORT>>();
// try try
// { {
// using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
// { {
// string _sql = Get_V_SCP_FORECAST_REPORT_SQL(p_entity); string _sql = Get_V_SCP_FORECAST_REPORT_SQL(p_entity);
// IQueryable<V_FORECAST_REPORT> q = db.Database.SqlQuery<V_FORECAST_REPORT>(_sql).AsQueryable(); IQueryable<V_FORECAST_REPORT> q = db.Database.SqlQuery<V_FORECAST_REPORT>(_sql).AsQueryable();
// _ret.State = ReturnStatus.Succeed; _ret.State = ReturnStatus.Succeed;
// _ret.Result = q; _ret.Result = q;
// p_action(_ret); p_action(_ret);
// } }
// } }
// catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 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())
// { {
// error.ValidationErrors.ToList().ForEach(i => error.ValidationErrors.ToList().ForEach(i =>
// { {
// sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
// }); });
// } }
// _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_SCP_FORECAST_REPORT_List", sb.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_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_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_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_SCP_FORECAST_REPORT_List", ex.ToString()); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_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;
// throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
// } }
// else else
// { {
// if (ex.InnerException != null) throw ex.InnerException; if (ex.InnerException != null) throw ex.InnerException;
// } }
// } }
// catch (Exception e) catch (Exception e)
// { {
// _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_SCP_FORECAST_REPORT_List", e.Message); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", e.Message);
// throw e; throw e;
// } }
//} }
/// <summary> /// <summary>
/// 获取及时率数据 /// 获取及时率数据
/// </summary> /// </summary>

74
Controller/SCP_WMS_CONTROLLER.cs

@ -104,6 +104,80 @@ namespace CK.SCP.Controller
} }
} }
public static void Get_VIEW_STOCK_DETAIL(VIEW_STOCK_QTY p_entity, Action<ResultObject<IQueryable<VIEW_STOCK_QTY>>> p_action)
{
ResultObject<IQueryable<VIEW_STOCK_QTY>> _ret = new ResultObject<IQueryable<VIEW_STOCK_QTY>>();
try
{
using (WmsEntities db = EntitiesFactory.CreateWmsInstance())
{
IQueryable<VIEW_STOCK_QTY> q = db.VIEW_STOCK_QTY;
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));
}
if (p_entity.BeginTime != null && !p_entity.BeginTime.ToString().Contains("0001/1/1"))
{
q = q.Where(p => p.LogTime >= p_entity.BeginTime);
}
if (p_entity.EndTime != null && !p_entity.EndTime.ToString().Contains("0001/1/1"))
{
q = q.Where(p => p.LogTime <= p_entity.EndTime);
}
_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_DETAIL", 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_DETAIL", 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_DETAIL", 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_DETAIL", e.Message);
throw e;
}
}
public static void Get_VIEW_STOCK_DETAIL(VIEW_STOCK_VEND p_entity, Action<ResultObject<IQueryable<VIEW_STOCK_VEND>>> p_action) public static void Get_VIEW_STOCK_DETAIL(VIEW_STOCK_VEND p_entity, Action<ResultObject<IQueryable<VIEW_STOCK_VEND>>> p_action)
{ {
ResultObject<IQueryable<VIEW_STOCK_VEND>> _ret = new ResultObject<IQueryable<VIEW_STOCK_VEND>>(); ResultObject<IQueryable<VIEW_STOCK_VEND>> _ret = new ResultObject<IQueryable<VIEW_STOCK_VEND>>();

77
Controller/UniApiController.cs

@ -1,16 +1,91 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.Entity.Core;
using System.Linq; using System.Linq;
using System.Text;
using CK.SCP.Models; using CK.SCP.Models;
using CK.SCP.Models.Enums; using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity; using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.UniApiEntity; using CK.SCP.Models.UniApiEntity;
using CK.SCP.Utils;
namespace CK.SCP.Controller namespace CK.SCP.Controller
{ {
public static class UniApiController public static class UniApiController
{ {
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>>();
try
{
using (Models.ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<TS_UNI_API> q = db.TS_UNI_API;
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
q = q.Where(p => p.VendId == p_entity.VendId);
}
if (!string.IsNullOrEmpty(p_entity.BillNum))
{
q = q.Where(p => p.BillNum == p_entity.BillNum);
}
q = q.Where(p => p.State == p_entity.State);
q = q.Where(p => p.InterfaceType == p_entity.InterfaceType);
_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(UniApiController), "Get_TS_UNI_API_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(UniApiController), "Get_TS_UNI_API_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(UniApiController), "Get_TS_UNI_API_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(UniApiController), "Get_TS_UNI_API_List", e.Message);
throw e;
}
}
public static void RemoveList(ScpEntities db, List<TS_UNI_API> uniApiList) public static void RemoveList(ScpEntities db, List<TS_UNI_API> uniApiList)
{ {
db.TS_UNI_API.RemoveRange(uniApiList); db.TS_UNI_API.RemoveRange(uniApiList);

5
Models/CK.SCP.Models.csproj

@ -332,6 +332,7 @@
<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_OTD_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" />
@ -370,6 +371,7 @@
<Compile Include="ScpEntity\TS_BARCODE_CUSTOM.cs" /> <Compile Include="ScpEntity\TS_BARCODE_CUSTOM.cs" />
<Compile Include="ScpEntity\TS_BARCODE_RULE_CUSTOM.cs" /> <Compile Include="ScpEntity\TS_BARCODE_RULE_CUSTOM.cs" />
<Compile Include="ScpEntity\V_ARRIVE_PRINT.cs" /> <Compile Include="ScpEntity\V_ARRIVE_PRINT.cs" />
<Compile Include="ScpEntity\V_FORECAST_REPORT.cs" />
<Compile Include="ScpEntity\V_Pie_Chart.cs" /> <Compile Include="ScpEntity\V_Pie_Chart.cs" />
<Compile Include="ScpEntity\V_SUPPLIERS_REGUALARLY.cs" /> <Compile Include="ScpEntity\V_SUPPLIERS_REGUALARLY.cs" />
<Compile Include="ScpEntity\V_TA_VENDER.cs" /> <Compile Include="ScpEntity\V_TA_VENDER.cs" />
@ -410,6 +412,7 @@
<Compile Include="ScpEntity\V_TB_ARRIVE_DETAIL.cs" /> <Compile Include="ScpEntity\V_TB_ARRIVE_DETAIL.cs" />
<Compile Include="ScpEntity\V_TB_ASK.cs" /> <Compile Include="ScpEntity\V_TB_ASK.cs" />
<Compile Include="ScpEntity\V_TB_ASK_DETAIL_PACKAGE.cs" /> <Compile Include="ScpEntity\V_TB_ASK_DETAIL_PACKAGE.cs" />
<Compile Include="ScpEntity\V_TB_FORECAST.cs" />
<Compile Include="ScpEntity\V_TB_INVOICE_ASK.cs" /> <Compile Include="ScpEntity\V_TB_INVOICE_ASK.cs" />
<Compile Include="ScpEntity\V_TB_PALLET.cs" /> <Compile Include="ScpEntity\V_TB_PALLET.cs" />
<Compile Include="ScpEntity\V_TB_PALLET_DETAIL .cs" /> <Compile Include="ScpEntity\V_TB_PALLET_DETAIL .cs" />
@ -423,7 +426,6 @@
<Compile Include="ScpEntity\V_TB_INVOICE_DETAIL_RED.cs" /> <Compile Include="ScpEntity\V_TB_INVOICE_DETAIL_RED.cs" />
<Compile Include="ScpEntity\V_TB_PO.cs" /> <Compile Include="ScpEntity\V_TB_PO.cs" />
<Compile Include="ScpEntity\V_TB_PO_DETAIL.cs" /> <Compile Include="ScpEntity\V_TB_PO_DETAIL.cs" />
<Compile Include="ScpEntity\V_TB_PO_INCOMPLETE.cs" />
<Compile Include="ScpEntity\V_TB_PO_PLAN.cs" /> <Compile Include="ScpEntity\V_TB_PO_PLAN.cs" />
<Compile Include="ScpEntity\V_TB_PO_PLAN_DETAIL.cs" /> <Compile Include="ScpEntity\V_TB_PO_PLAN_DETAIL.cs" />
<Compile Include="ScpEntity\V_TB_RETURN.cs" /> <Compile Include="ScpEntity\V_TB_RETURN.cs" />
@ -694,6 +696,7 @@
<Compile Include="WmsEntity\VIEW_STOCK_FREEZE.cs" /> <Compile Include="WmsEntity\VIEW_STOCK_FREEZE.cs" />
<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_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" />

2
Models/ScpEntities.cs

@ -118,7 +118,7 @@ namespace CK.SCP.Models
public virtual DbSet<V_TA_VEND_PART> V_TA_VEND_PART { get; set; } public virtual DbSet<V_TA_VEND_PART> V_TA_VEND_PART { get; set; }
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<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; }

3
Models/ScpEntity/ExcelExportEnttity/SCP_ASK_DETAIL_EXPORT.cs

@ -20,6 +20,9 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
public string {get;set;} //"AskQty" public string {get;set;} //"AskQty"
public string { get; set; } //"ReMark" public string { get; set; } //"ReMark"
public string { get; set; } //"OneMonth"
public string { get; set; } //"TwoMonth"
public string { get; set; } //"ThreeMonth"
} }
} }

16
Models/ScpEntity/ExcelExportEnttity/SCP_FORECAST_EXPORT.cs

@ -8,11 +8,23 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
{ {
public class SCP_FORECAST_EXPORT public class SCP_FORECAST_EXPORT
{ {
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; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string 1 { get; set; } public string 1 { get; set; }
public string 2 { get; set; } public string 2 { get; set; }
public string 3 { get; set; } public string 3 { get; set; }
public string { get; set; } public string { get; set; }
public string { get; set; }
public string { get; set; }
} }
} }

24
Models/ScpEntity/ExcelExportEnttity/SCP_OTD_REPORT_EXPORT.cs

@ -0,0 +1,24 @@
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_REPORT_EXPORT
{
public string { get; set; }
public string { get; set; } //VendId
public string { get; set; } //VendId
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; } //ArriveQty
public string { get; set; } //AskQty
public string { get; set; } //Qty
public string { get; set; } //NntimelyQty
public string { get; set; }//OTD
public string { get; set; }//ArriveOTD
}
}

3
Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs

@ -46,6 +46,9 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
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; }

2
Models/ScpEntity/SCP_OTD_EXPORT.cs

@ -32,5 +32,7 @@ namespace CK.SCP.Models.ScpEntity
public decimal ArriveOTD { get; set; }//到货率 public decimal ArriveOTD { get; set; }//到货率
public Nullable<System.DateTime> BeginTime { get; set; }//开始时间 public Nullable<System.DateTime> BeginTime { get; set; }//开始时间
public Nullable<System.DateTime> EndTime { get; set; } //结束时间 public Nullable<System.DateTime> EndTime { get; set; } //结束时间
public string AskBillNum { get; set; } = "";//看板号
public string Site { get; set; }
} }
} }

23
Models/ScpEntity/TB_FORECAST.cs

@ -21,14 +21,24 @@ namespace CK.SCP.Models.ScpEntity
/// 零件编号 /// 零件编号
/// </summary> /// </summary>
[StringLength(50)] [StringLength(50)]
public string PartCode { get; set; } public string PoType { get; set; }
/// <summary> [StringLength(50)]
/// 供应商编号 /// 供应商编号
/// </summary> /// </summary>
public string VendId { get; set; } public string VendId { get; set; }
/// <summary> [StringLength(50)]
/// N+1 public string PartCode { get; set; }
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
@ -41,7 +51,10 @@ namespace CK.SCP.Models.ScpEntity
/// <summary> /// <summary>
/// 月份 /// 月份
/// </summary> /// </summary>
public string Month { get; set; } public string Ontime { get; set; }
public string Datetime { get; set; }
[StringLength(50)]
public string Remark { get; set; }
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>

2
Models/ScpEntity/TB_INVOICE_DETAIL.cs

@ -15,6 +15,8 @@ namespace CK.SCP.Models.ScpEntity
[StringLength(50)] [StringLength(50)]
public string RecvBillNum { get; set; } public string RecvBillNum { get; set; }
[StringLength(50)] [StringLength(50)]
public string ErpRecvBillNum { get; set; }
[StringLength(50)]
public string AsnBillNum { get; set; } public string AsnBillNum { get; set; }
[StringLength(50)] [StringLength(50)]
public string PoBillNum { get; set; } public string PoBillNum { get; set; }

6
Models/ScpEntity/TB_RECEIVE_DETAIL_QAD.cs

@ -9,8 +9,7 @@ namespace CK.SCP.Models.ScpEntity
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; } public long UID { get; set; }
[StringLength(50)] [StringLength(50)]
[Key]
[Column(Order = 0)]
public string RecvBillNum { get; set; } public string RecvBillNum { get; set; }
[Key] [Key]
[Column(Order = 1)] [Column(Order = 1)]
@ -45,7 +44,8 @@ namespace CK.SCP.Models.ScpEntity
public string PoUnit { get; set; } public string PoUnit { get; set; }
[StringLength(50)] [StringLength(50)]
public string LocUnit { get; set; } public string LocUnit { get; set; }
[Key]
[Column(Order = 0)]
public string ErpRecvBillNum { get; set; } public string ErpRecvBillNum { get; set; }
/// <summary> /// <summary>

6
Models/ScpEntity/TB_RECEIVE_QAD.cs

@ -10,8 +10,7 @@ namespace CK.SCP.Models.ScpEntity
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; } public long UID { get; set; }
[StringLength(50)] [StringLength(50)]
[Key]
[Column(Order = 0)]
public string RecvBillNum { get; set; } public string RecvBillNum { get; set; }
[StringLength(50)] [StringLength(50)]
public string PoBillNum { get; set; } public string PoBillNum { get; set; }
@ -36,7 +35,8 @@ namespace CK.SCP.Models.ScpEntity
[StringLength(50)] [StringLength(50)]
public string OperName { get; set; } public string OperName { get; set; }
public int BillType { get; set; } public int BillType { get; set; }
[Key]
[Column(Order = 0)]
public string ErpRecvBillNum { get; set; } public string ErpRecvBillNum { get; set; }

2
Models/ScpEntity/TS_BARCODE_CUSTOM.cs

@ -77,7 +77,7 @@ namespace CK.SCP.Models.ScpEntity
[DisplayName("供应商名称")] [DisplayName("供应商名称")]
public string VendName => ScpCache.GetVendName(VendId, Site)+"(×Ô¶¨Òå)"; public string VendName => ScpCache.GetVendName(VendId, Site)+"(×Ô¶¨Òå)";
[DisplayName("零件名称")] [DisplayName("零件名称")]

22
Models/ScpEntity/V_FORECAST_REPORT.cs

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity
{
public class V_FORECAST_REPORT
{
public string VendId { get; set; } //供应商编号
public string PartCode { get; set; } //零件号
public decimal AskQty { get; set; } //订单要货数量
public int Month { get; set; } //月份
public decimal MonthQty1 { get; set; } //N+1
public decimal MonthQty2 { get; set; } //N+2
public decimal MonthQty3 { get; set; } //N+3
[NotMapped]
public string VendName => ScpCache.GetVendName(VendId);//供应商名称
}
}

3
Models/ScpEntity/V_TB_ASK_DETAIL.cs

@ -84,6 +84,9 @@ namespace CK.SCP.Models.ScpEntity
public decimal? ReduceQty { get; set; } public decimal? ReduceQty { get; set; }
public decimal OneMonth { get; set; }
public decimal TwoMonth { get; set; }
public decimal ThreeMonth { get; set; }
public int ValidityDays { get; set; } public int ValidityDays { get; set; }

48
Models/ScpEntity/V_TB_FORECAST.cs

@ -0,0 +1,48 @@
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 V_TB_FORECAST : RecordEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[StringLength(50)]
public string PoType { get; set; }
[StringLength(50)]
public string VendId { get; set; }
[StringLength(50)]
public string PartCode { 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 decimal MonthQty1 { get; set; }
public decimal MonthQty2 { get; set; }
public decimal MonthQty3 { get; set; }
public string Ontime { get; set; }
public string Datetime { get; set; }
[StringLength(50)]
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; }
}
}

2
Models/ScpEntity/V_TB_INCOMPLETE_ASK.cs

@ -30,6 +30,8 @@
[NotMapped] [NotMapped]
public decimal ReceivedQty { get; set; }//合格数量 public decimal ReceivedQty { get; set; }//合格数量
[NotMapped] [NotMapped]
public decimal DepositQty { get; set; }//寄存数量
[NotMapped]
public decimal OnRoadQty { get; set; }//在途数量 public decimal OnRoadQty { get; set; }//在途数量
public DateTime? BeginTime { get; set; } public DateTime? BeginTime { get; set; }

28
Models/ScpEntity/V_TB_PO_INCOMPLETE.cs

@ -1,28 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace CK.SCP.Models.ScpEntity
{
using System;
using System.Collections.Generic;
public partial class V_TB_PO_INCOMPLETE
{
public string PoBillNum { get; set; }
public Nullable<System.DateTime> EndTime { get; set; }
public string Buyer { get; set; }
public string Site { get; set; }
public string VendId { get; set; }
public string PartCode { get; set; }
public decimal PlanQty { get; set; }
public decimal QTY { get; set; }
public string VendName { get; set; }
public string partdesc { get; set; }
}
}

2
Models/ScpEntity/V_TB_RECEIVE_LIST.cs

@ -55,7 +55,7 @@ namespace CK.SCP.Models.ScpEntity
public string ProjectId { get; set; } public string ProjectId { get; set; }
public Nullable<System.DateTime> BeginTime { get; set; } public Nullable<System.DateTime> BeginTime { get; set; }
[NotMapped]
public decimal CanQty { get; set; } public decimal CanQty { get; set; }
[NotMapped] [NotMapped]

2
Models/UniApiEntity/xxscm_inv_det.cs

@ -14,7 +14,7 @@ namespace CK.SCP.Models.UniApiEntity
public string xxscm_inv_seq { get; set; } public string xxscm_inv_seq { get; set; }
[Required(AllowEmptyStrings = true)] [Required(AllowEmptyStrings = true)]
[StringLength(58)] [StringLength(50)]
public string xxscm_inv_domain { get; set; } public string xxscm_inv_domain { get; set; }
[Required(AllowEmptyStrings = true)] [Required(AllowEmptyStrings = true)]

2
Models/UniApiEntity/xxwms_arv_det.cs

@ -37,7 +37,7 @@ namespace CK.SCP.Models.UniApiEntity
public decimal xxwms_arv_conv { get; set; } public decimal xxwms_arv_conv { get; set; }
[StringLength(100)] [StringLength(100)]
public string xxwms_arv_lot { get; set; } public string xxwms_arv_lot { get; set; }
[StringLength(20)] [StringLength(50)]
public string xxwms_arv_vend_batch { get; set; } public string xxwms_arv_vend_batch { get; set; }
[StringLength(1)] [StringLength(1)]
public string xxwms_arv_qadread { get; set; } public string xxwms_arv_qadread { get; set; }

2
Models/UniApiEntity/xxwms_rc_det.cs

@ -64,7 +64,7 @@ namespace CK.SCP.Models.UniApiEntity
public string xxwms_rc_lot { get; set; } public string xxwms_rc_lot { get; set; }
[Required(AllowEmptyStrings = true)] [Required(AllowEmptyStrings = true)]
[StringLength(20)] [StringLength(100)]
public string xxwms_rc_vend_batch { get; set; } public string xxwms_rc_vend_batch { get; set; }
[StringLength(1)] [StringLength(1)]

33
Models/WmsEntity/VIEW_STOCK_QTY.cs

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ChangKeTec.Wms.Models.Wms
{
public partial class VIEW_STOCK_QTY
{
[Key]
[Column(Order = 0)]
[StringLength(50)]
public string PartCode { get; set; }
[Key]
[Column(Order = 1)]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public System.DateTime LogTime { get; set; }
public decimal qty { get; set; }
public string VendId { get; set; }
public string status { get; set; }
[NotMapped]
public DateTime? BeginTime { get; set; }
[NotMapped]
public DateTime? EndTime { get; set; }
[NotMapped]
public List<string> UserInVendIds { set; get; }
}
}

2
Models/WmsEntity/VIEW_STOCK_VEND.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
@ -12,6 +13,7 @@ namespace ChangKeTec.Wms.Models.Wms
public long UID { get; set; } public long UID { get; set; }
[StringLength(50)] [StringLength(50)]
[DisplayName("零件名称")]
public string PartCode { get; set; } public string PartCode { get; set; }
[StringLength(50)] [StringLength(50)]
public string PartDesc1 { get; set; } public string PartDesc1 { get; set; }

1
Models/WmsEntity/WmsEntities.cs

@ -21,6 +21,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<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; }

18
SCP.sln

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio Version 16
VisualStudioVersion = 14.0.25420.1 VisualStudioVersion = 16.0.29424.173
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCP", "SCP\SCP.csproj", "{B5ECC9CB-5122-458B-A8B4-B1D3B679E40D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCP", "SCP\SCP.csproj", "{B5ECC9CB-5122-458B-A8B4-B1D3B679E40D}"
EndProject EndProject
@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.Controller", "Contro
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.Models", "Models\CK.SCP.Models.csproj", "{74DCE5F2-A501-45F2-B4F9-494AA1867226}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.Models", "Models\CK.SCP.Models.csproj", "{74DCE5F2-A501-45F2-B4F9-494AA1867226}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.UniApi", "UniApi\CK.SCP.UniApi.csproj", "{B870B746-D647-4B84-8F84-6281D3A55FCB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.Common", "Common\CK.SCP.Common.csproj", "{3D6090AB-2F0C-4350-AEF3-59DD73EAB1AA}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.Common", "Common\CK.SCP.Common.csproj", "{3D6090AB-2F0C-4350-AEF3-59DD73EAB1AA}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.Utils", "Utils\CK.SCP.Utils.csproj", "{4C6A951D-AD7F-47CE-B2CE-32C205D8D6BA}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.Utils", "Utils\CK.SCP.Utils.csproj", "{4C6A951D-AD7F-47CE-B2CE-32C205D8D6BA}"
@ -33,18 +31,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "数据库脚本", "数据
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "库存查询脚本", "库存查询脚本", "{8D2819CE-1334-4EFE-A50F-E23BC8DDD71D}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "库存查询脚本", "库存查询脚本", "{8D2819CE-1334-4EFE-A50F-E23BC8DDD71D}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
..\..\..\Desktop\SCP项目\VIEW_PRODUCT_DETAIL.sql = ..\..\..\Desktop\SCP项目\VIEW_PRODUCT_DETAIL.sql ..\..\Desktop\SCP项目\VIEW_PRODUCT_DETAIL.sql = ..\..\Desktop\SCP项目\VIEW_PRODUCT_DETAIL.sql
..\..\..\Desktop\SCP项目\Wms数据库设置.ini = ..\..\..\Desktop\SCP项目\Wms数据库设置.ini ..\..\Desktop\SCP项目\Wms数据库设置.ini = ..\..\Desktop\SCP项目\Wms数据库设置.ini
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "权限库备份", "权限库备份", "{137B27CF-8F56-49BB-9705-060995312716}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "权限库备份", "权限库备份", "{137B27CF-8F56-49BB-9705-060995312716}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
..\..\..\Desktop\权限系统.sql = ..\..\..\Desktop\权限系统.sql ..\..\Desktop\权限系统.sql = ..\..\Desktop\权限系统.sql
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SCP库备份", "SCP库备份", "{636001CD-8969-4077-9A44-E681C4ADF8BD}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SCP库备份", "SCP库备份", "{636001CD-8969-4077-9A44-E681C4ADF8BD}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
..\..\..\Desktop\SCP系统脚本.sql = ..\..\..\Desktop\SCP系统脚本.sql ..\..\Desktop\SCP系统脚本.sql = ..\..\Desktop\SCP系统脚本.sql
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.GrupUniApi", "UniApiGroup\CK.SCP.GrupUniApi.csproj", "{6A22F275-D490-46B3-B183-35408BF106C4}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.GrupUniApi", "UniApiGroup\CK.SCP.GrupUniApi.csproj", "{6A22F275-D490-46B3-B183-35408BF106C4}"
@ -69,10 +67,6 @@ Global
{74DCE5F2-A501-45F2-B4F9-494AA1867226}.Debug|Any CPU.Build.0 = Debug|Any CPU {74DCE5F2-A501-45F2-B4F9-494AA1867226}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74DCE5F2-A501-45F2-B4F9-494AA1867226}.Release|Any CPU.ActiveCfg = Release|Any CPU {74DCE5F2-A501-45F2-B4F9-494AA1867226}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74DCE5F2-A501-45F2-B4F9-494AA1867226}.Release|Any CPU.Build.0 = Release|Any CPU {74DCE5F2-A501-45F2-B4F9-494AA1867226}.Release|Any CPU.Build.0 = Release|Any CPU
{B870B746-D647-4B84-8F84-6281D3A55FCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B870B746-D647-4B84-8F84-6281D3A55FCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B870B746-D647-4B84-8F84-6281D3A55FCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B870B746-D647-4B84-8F84-6281D3A55FCB}.Release|Any CPU.Build.0 = Release|Any CPU
{3D6090AB-2F0C-4350-AEF3-59DD73EAB1AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3D6090AB-2F0C-4350-AEF3-59DD73EAB1AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D6090AB-2F0C-4350-AEF3-59DD73EAB1AA}.Debug|Any CPU.Build.0 = Debug|Any CPU {3D6090AB-2F0C-4350-AEF3-59DD73EAB1AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D6090AB-2F0C-4350-AEF3-59DD73EAB1AA}.Release|Any CPU.ActiveCfg = Release|Any CPU {3D6090AB-2F0C-4350-AEF3-59DD73EAB1AA}.Release|Any CPU.ActiveCfg = Release|Any CPU

2
SCP/Admin/user.aspx

@ -90,7 +90,7 @@
<f:CheckBoxField DataField="Enabled" SortField="Enabled" HeaderText="启用" RenderAsStaticField="true" <f:CheckBoxField DataField="Enabled" SortField="Enabled" HeaderText="启用" RenderAsStaticField="true"
Width="50px" /> Width="50px" />
<f:BoundField DataField="Gender" SortField="Gender" Width="50px" HeaderText="性别" /> <f:BoundField DataField="Gender" SortField="Gender" Width="50px" HeaderText="性别" Hidden="true" />
<f:BoundField DataField="Email" SortField="Email" Width="150px" HeaderText="邮箱" /> <f:BoundField DataField="Email" SortField="Email" Width="150px" HeaderText="邮箱" />
<f:BoundField DataField="Remark" ExpandUnusedSpace="true" HeaderText="备注" /> <f:BoundField DataField="Remark" ExpandUnusedSpace="true" HeaderText="备注" />
<f:WindowField TextAlign="Center" Icon="Information" ToolTip="查看详细信息" Title="查看详细信息" <f:WindowField TextAlign="Center" Icon="Information" ToolTip="查看详细信息" Title="查看详细信息"

4
SCP/Admin/user_new.aspx

@ -37,8 +37,8 @@
</f:FormRow> </f:FormRow>
<f:FormRow runat="server"> <f:FormRow runat="server">
<Items> <Items>
<f:RadioButtonList ID="ddlGender" Label="性别" Required="true" ShowRedStar="true" runat="server"> <f:RadioButtonList ID="ddlGender" Label="性别" Required="true" ShowRedStar="true" runat="server" hidden="true" >
<f:RadioItem Text="男" Value="男" /> <f:RadioItem Text="男" Value="男" Selected="true" />
<f:RadioItem Text="女" Value="女" /> <f:RadioItem Text="女" Value="女" />
</f:RadioButtonList> </f:RadioButtonList>
<f:CheckBox ID="cbxEnabled" runat="server" Label="是否启用"> <f:CheckBox ID="cbxEnabled" runat="server" Label="是否启用">

118
SCP/Business/PageBase.cs

@ -1617,7 +1617,21 @@ namespace SCP
} }
// 3.4 填充到Excel的单元格里 // 3.4 填充到Excel的单元格里
rowTmp.CreateCell(i).SetCellValue(cellValue); if (properotyInfo.PropertyType.FullName == "System.Decimal")
{
rowTmp.CreateCell(i, CellType.Numeric).SetCellValue(Convert.ToDouble(cellValue));
}
else
{
rowTmp.CreateCell(i, CellType.String).SetCellValue(cellValue);
}
if (properotyInfo.Name.Contains("日期")||properotyInfo.Name.Contains("时间"))
{
ICellStyle style = workbook.CreateCellStyle();
IDataFormat dataFormatCustom = workbook.CreateDataFormat();
style.DataFormat = dataFormatCustom.GetFormat("@");
rowTmp.Cells[i].CellStyle = style;
}
} }
rowIndex++; rowIndex++;
} }
@ -1662,6 +1676,106 @@ namespace SCP
} }
} }
} }
#region 将list转换为datatable
public static DataTable ToDataTable<T>(List<T> items)
{
var tb = new DataTable(typeof(T).Name);
PropertyInfo[] props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo prop in props)
{
Type t = GetCoreType(prop.PropertyType);
tb.Columns.Add(prop.Name, t);
}
foreach (T item in items)
{
var values = new object[props.Length];
for (int i = 0; i < props.Length; i++)
{
values[i] = props[i].GetValue(item, null);
}
tb.Rows.Add(values);
}
return tb;
}
public static bool IsNullable(Type t)
{
return !t.IsValueType || (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>));
}
public static Type GetCoreType(Type t)
{
if (t != null && IsNullable(t))
{
if (!t.IsValueType)
{
return t;
}
else
{
return Nullable.GetUnderlyingType(t);
}
}
else
{
return t;
}
}
public string GetHtmlString(DataTable dt)
{
StringBuilder sb = new StringBuilder();
sb.Append("<html><head>");
sb.Append("<title>Excel转换为Table</title>");
sb.Append("<meta http-equiv='content-type' content='text/html; charset=GB2312'> ");
sb.Append("<style type=text/css>");
sb.Append("td{font-size: 9pt;border:solid 1 #000000;}");
sb.Append("table{padding:3 0 3 0;border:solid 1 #000000;margin:0 0 0 0;BORDER-COLLAPSE: collapse;}");
sb.Append("</style>");
sb.Append("</head>");
sb.Append("<body>");
sb.Append("<table cellSpacing='0' cellPadding='0' width ='100%' border='1'>");
sb.Append("<tr valign='middle'>");
sb.Append("<td><b></b></td>");
foreach (DataColumn column in dt.Columns)
{
sb.Append("<td><b><span>" + column.ColumnName + "</span></b></td>");
}
sb.Append("</tr>");
int iColsCount = dt.Columns.Count;
int rowsCount = dt.Rows.Count - 1;
for (int j = 0; j <= rowsCount; j++)
{
sb.Append("<tr>");
sb.Append("<td>" + ((int)(j + 1)).ToString() + "</td>");
for (int k = 0; k <= iColsCount - 1; k++)
{
sb.Append("<td>");
object obj = dt.Rows[j][k];
if (obj == DBNull.Value)
{
obj = "&nbsp;";//如果是NULL则在HTML里面使用一个空格替换之
}
if (obj.ToString() == "")
{
obj = "&nbsp;";
}
string strCellContent = obj.ToString().Trim();
sb.Append("<span>" + strCellContent + "</span>");
sb.Append("</td>");
}
sb.Append("</tr>");
}
sb.Append("</table>");
sb.Append("<script src='https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js'></script>");
sb.Append("<script type='text/javascript'>");
sb.Append("$('table tbody').on('click', 'td', function (e) {");
sb.Append("var row = $(this).parent().prevAll().length-1 ;");
sb.Append("var column = $(this).prevAll().length-1 ;");
sb.Append("var str = 'dt.Rows[' + row + '][' + column + '].ToString()';");
sb.Append("console.log(str);alert(str);");
sb.Append("});");
sb.Append("</script>");
sb.Append("</body></html>");
return sb.ToString();
}
#endregion
} }
} }

11
SCP/Common/MailHelper.cs

@ -18,18 +18,8 @@ namespace SCP.Common
{ {
try try
{ {
int _count = 0;
//using (ScpEntities scpdb = EntitiesFactory.CreateScpInstance())
//{
// string sqlString = "SELECT ParamName,ParamValue\n" +
// " FROM [TA_FACTORY_CONFIG] a left join TB_FACTORY b on a.FactoryId=b.ErpDomain left join TA_CONFIG c on a.ConfigId=c.UID\n" +
// " where b.ErpDomain='{0}' and ParamName='收货自动审核' and ParamValue='允许'";
// _count = scpdb.Database.ExecuteSqlCommand(string.Format(sqlString, p_site));
//}
using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance()) using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance())
{ {
if (p_site == "CNH")
{
//if (_count > 0) //if (_count > 0)
//{ //{
StringBuilder _buffer = new StringBuilder(); StringBuilder _buffer = new StringBuilder();
@ -65,7 +55,6 @@ namespace SCP.Common
} }
} }
//} //}
}
catch(Exception e) catch(Exception e)
{ {
LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "MailManager", e.Message); LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "MailManager", e.Message);

80
SCP/SCP.csproj

@ -2915,6 +2915,7 @@
<Content Include="Views\PlanData\ASN_STATE.aspx" /> <Content Include="Views\PlanData\ASN_STATE.aspx" />
<Content Include="Views\PlanData\SCP_ASK.aspx" /> <Content Include="Views\PlanData\SCP_ASK.aspx" />
<Content Include="Views\PlanData\SCP_ASK_ADD.aspx" /> <Content Include="Views\PlanData\SCP_ASK_ADD.aspx" />
<Content Include="Views\PlanData\SCP_FORECAST.aspx" />
<Content Include="Views\PlanData\SCP_PART_LIFE.aspx" /> <Content Include="Views\PlanData\SCP_PART_LIFE.aspx" />
<Content Include="Views\PlanData\SCP_PART_LIFE_DETAIL.aspx" /> <Content Include="Views\PlanData\SCP_PART_LIFE_DETAIL.aspx" />
<Content Include="Views\PlanData\SCP_INCOMPLETE_ASK.aspx" /> <Content Include="Views\PlanData\SCP_INCOMPLETE_ASK.aspx" />
@ -2926,8 +2927,11 @@
<Content Include="Views\PlanData\SCP_PO_PLAN_EXTEND_EDIT.aspx" /> <Content Include="Views\PlanData\SCP_PO_PLAN_EXTEND_EDIT.aspx" />
<Content Include="Views\PlanData\SCP_RECEIVE_EXTEND.aspx" /> <Content Include="Views\PlanData\SCP_RECEIVE_EXTEND.aspx" />
<Content Include="Views\PlanData\SCP_ASK_UNCOMPLETE.aspx" /> <Content Include="Views\PlanData\SCP_ASK_UNCOMPLETE.aspx" />
<Content Include="Views\PlanData\SCP_UNI_API.aspx" />
<Content Include="Views\Report\SCP_OTD_REPORT.aspx" />
<Content Include="Views\Report\SCP_RECVICE_YEAR_REPORT.aspx" /> <Content Include="Views\Report\SCP_RECVICE_YEAR_REPORT.aspx" />
<Content Include="Views\Report\SCP_RECVICE_REPORT.aspx" /> <Content Include="Views\Report\SCP_RECVICE_REPORT.aspx" />
<Content Include="Views\SupplierData\SCP_FORECAST.aspx" />
<Content Include="Views\SupplierData\SCP_PO_PLAN_EXTEND_VIEW.aspx" /> <Content Include="Views\SupplierData\SCP_PO_PLAN_EXTEND_VIEW.aspx" />
<Content Include="Views\SupplierData\SCP_PO_PLAN_VIEW.aspx" /> <Content Include="Views\SupplierData\SCP_PO_PLAN_VIEW.aspx" />
<Content Include="Views\PlanData\SCP_PO_PLAN_EXTEND_DETAIL.aspx" /> <Content Include="Views\PlanData\SCP_PO_PLAN_EXTEND_DETAIL.aspx" />
@ -4489,10 +4493,12 @@
<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_STOCK.aspx" /> <Content Include="Views\SupplierData\SCP_STOCK.aspx" />
<Content Include="Views\SupplierData\SCP_STOCK_DETAIL.aspx" />
<Content Include="Views\SupplierData\SCP_TIMELY_DELIVERY.aspx" /> <Content Include="Views\SupplierData\SCP_TIMELY_DELIVERY.aspx" />
<Content Include="Views\SupplierData\SCP_TS_BARCODE.aspx" /> <Content Include="Views\SupplierData\SCP_TS_BARCODE.aspx" />
<Content Include="Views\SupplierData\SCP_SHIP_DETAIL_BARCODE.aspx" /> <Content Include="Views\SupplierData\SCP_SHIP_DETAIL_BARCODE.aspx" />
<Content Include="ViewSwitcher.ascx" /> <Content Include="ViewSwitcher.ascx" />
<Content Include="Views\SupplierData\SCP_UNPAID.aspx" />
<Content Include="Views\WarehouseData\SCP_INVOICE_VIEW.aspx" /> <Content Include="Views\WarehouseData\SCP_INVOICE_VIEW.aspx" />
<Content Include="Views\WarehouseData\SCP_INVOICE_RECVICE.aspx" /> <Content Include="Views\WarehouseData\SCP_INVOICE_RECVICE.aspx" />
<Content Include="Views\WarehouseData\SCP_INVOICE_VIEW_DETAIL.aspx" /> <Content Include="Views\WarehouseData\SCP_INVOICE_VIEW_DETAIL.aspx" />
@ -4547,6 +4553,10 @@
<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_CREATE.aspx" /> <Content Include="Views\重庆北汽模塑\SupplierData\SCP_ASN_CREATE.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_ASN.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_ASN_DETAIL.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_SELECT_MAKE.aspx" />
<Content Include="Views\锦州锦恒\SupplierData\SCP_SHIP_DETAIL_BARCODE.aspx" />
<Content Include="Views\长春安通林\SCP_ASK.aspx" /> <Content Include="Views\长春安通林\SCP_ASK.aspx" />
<Content Include="Views\长春安通林\SCP_ASK_AUDIT.aspx" /> <Content Include="Views\长春安通林\SCP_ASK_AUDIT.aspx" />
<Content Include="Views\长春安通林\SCP_ASK_AUDIT_DETAIL.aspx" /> <Content Include="Views\长春安通林\SCP_ASK_AUDIT_DETAIL.aspx" />
@ -5107,6 +5117,13 @@
<Compile Include="Views\PlanData\SCP_ASK_ADD.aspx.designer.cs"> <Compile Include="Views\PlanData\SCP_ASK_ADD.aspx.designer.cs">
<DependentUpon>SCP_ASK_ADD.aspx</DependentUpon> <DependentUpon>SCP_ASK_ADD.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_PART_LIFE.aspx.cs"> <Compile Include="Views\PlanData\SCP_PART_LIFE.aspx.cs">
<DependentUpon>SCP_PART_LIFE.aspx</DependentUpon> <DependentUpon>SCP_PART_LIFE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5183,6 +5200,20 @@
<Compile Include="Views\PlanData\SCP_ASK_UNCOMPLETE.aspx.designer.cs"> <Compile Include="Views\PlanData\SCP_ASK_UNCOMPLETE.aspx.designer.cs">
<DependentUpon>SCP_ASK_UNCOMPLETE.aspx</DependentUpon> <DependentUpon>SCP_ASK_UNCOMPLETE.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\PlanData\SCP_UNI_API.aspx.cs">
<DependentUpon>SCP_UNI_API.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\PlanData\SCP_UNI_API.aspx.designer.cs">
<DependentUpon>SCP_UNI_API.aspx</DependentUpon>
</Compile>
<Compile Include="Views\Report\SCP_OTD_REPORT.aspx.cs">
<DependentUpon>SCP_OTD_REPORT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\Report\SCP_OTD_REPORT.aspx.designer.cs">
<DependentUpon>SCP_OTD_REPORT.aspx</DependentUpon>
</Compile>
<Compile Include="Views\Report\SCP_RECVICE_YEAR_REPORT.aspx.cs"> <Compile Include="Views\Report\SCP_RECVICE_YEAR_REPORT.aspx.cs">
<DependentUpon>SCP_RECVICE_YEAR_REPORT.aspx</DependentUpon> <DependentUpon>SCP_RECVICE_YEAR_REPORT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5197,6 +5228,13 @@
<Compile Include="Views\Report\SCP_RECVICE_REPORT.aspx.designer.cs"> <Compile Include="Views\Report\SCP_RECVICE_REPORT.aspx.designer.cs">
<DependentUpon>SCP_RECVICE_REPORT.aspx</DependentUpon> <DependentUpon>SCP_RECVICE_REPORT.aspx</DependentUpon>
</Compile> </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_PO_PLAN_EXTEND_VIEW.aspx.cs"> <Compile Include="Views\SupplierData\SCP_PO_PLAN_EXTEND_VIEW.aspx.cs">
<DependentUpon>SCP_PO_PLAN_EXTEND_VIEW.aspx</DependentUpon> <DependentUpon>SCP_PO_PLAN_EXTEND_VIEW.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5476,6 +5514,13 @@
<Compile Include="Views\SupplierData\SCP_STOCK.aspx.designer.cs"> <Compile Include="Views\SupplierData\SCP_STOCK.aspx.designer.cs">
<DependentUpon>SCP_STOCK.aspx</DependentUpon> <DependentUpon>SCP_STOCK.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\SupplierData\SCP_STOCK_DETAIL.aspx.cs">
<DependentUpon>SCP_STOCK_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SCP_STOCK_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_STOCK_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SCP_TIMELY_DELIVERY.aspx.cs"> <Compile Include="Views\SupplierData\SCP_TIMELY_DELIVERY.aspx.cs">
<DependentUpon>SCP_TIMELY_DELIVERY.aspx</DependentUpon> <DependentUpon>SCP_TIMELY_DELIVERY.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5504,6 +5549,13 @@
<Compile Include="ViewSwitcher.ascx.designer.cs"> <Compile Include="ViewSwitcher.ascx.designer.cs">
<DependentUpon>ViewSwitcher.ascx</DependentUpon> <DependentUpon>ViewSwitcher.ascx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\SupplierData\SCP_UNPAID.aspx.cs">
<DependentUpon>SCP_UNPAID.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SCP_UNPAID.aspx.designer.cs">
<DependentUpon>SCP_UNPAID.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>
@ -5868,6 +5920,34 @@
<Compile Include="Views\重庆北汽模塑\SupplierData\SCP_ASK.aspx.designer.cs"> <Compile Include="Views\重庆北汽模塑\SupplierData\SCP_ASK.aspx.designer.cs">
<DependentUpon>SCP_ASK.aspx</DependentUpon> <DependentUpon>SCP_ASK.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_ASN.aspx.cs">
<DependentUpon>SCP_ASN.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_ASN.aspx.designer.cs">
<DependentUpon>SCP_ASN.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_ASN_DETAIL.aspx.cs">
<DependentUpon>SCP_ASN_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_ASN_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_ASN_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_SELECT_MAKE.aspx.cs">
<DependentUpon>SCP_SELECT_MAKE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_SELECT_MAKE.aspx.designer.cs">
<DependentUpon>SCP_SELECT_MAKE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_SHIP_DETAIL_BARCODE.aspx.cs">
<DependentUpon>SCP_SHIP_DETAIL_BARCODE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\锦州锦恒\SupplierData\SCP_SHIP_DETAIL_BARCODE.aspx.designer.cs">
<DependentUpon>SCP_SHIP_DETAIL_BARCODE.aspx</DependentUpon>
</Compile>
<Compile Include="Views\长春安通林\SCP_ASK.aspx.cs"> <Compile Include="Views\长春安通林\SCP_ASK.aspx.cs">
<DependentUpon>SCP_ASK.aspx</DependentUpon> <DependentUpon>SCP_ASK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

16
SCP/Views/BasicData/SCP_INFO_EDIT.aspx.cs

@ -91,8 +91,8 @@ namespace SCP.BasicData
this.txtSupplierCode.DataTextField = "VendName"; this.txtSupplierCode.DataTextField = "VendName";
this.txtSupplierCode.DataValueField = "VendId"; this.txtSupplierCode.DataValueField = "VendId";
this.txtSupplierCode.DataBind(); this.txtSupplierCode.DataBind();
this.txtSupplierCode.Items.Insert(0, new FineUI.ListItem("--无供应商--", "")); //this.txtSupplierCode.Items.Insert(0, new FineUI.ListItem("--无供应商--", ""));
this.txtSupplierCode.Items.Insert(1, new FineUI.ListItem("--所有供应商--", "")); this.txtSupplierCode.Items.Insert(0, new FineUI.ListItem("--所有供应商--", ""));
this.txtAddTime.Text = DateTime.Now.ToString(); this.txtAddTime.Text = DateTime.Now.ToString();
} }
@ -182,7 +182,7 @@ namespace SCP.BasicData
} }
else else
{ {
if (!string.IsNullOrEmpty(txtSupplierCode.SelectedText) && txtSupplierCode.SelectedText.Contains("--无供应商--")) if (string.IsNullOrEmpty(txtSupplierCode.SelectedText))
{ {
Alert.Show("选择了无供应商选项!"); Alert.Show("选择了无供应商选项!");
@ -206,10 +206,18 @@ namespace SCP.BasicData
Upload(txtFileName, "", model); Upload(txtFileName, "", model);
} }
SCP_INFO_CONTROLLER.SaveInfo(model); var ret = SCP_INFO_CONTROLLER.SaveInfo(model);
if (ret.State == ReturnStatus.Succeed)
{
Alert.ShowInParent("保存成功!");
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
BindField(); BindField();
}
else
{
Alert.Show(ret.Message);
}
} }
} }

10
SCP/Views/BasicData/SCP_VenderUser.aspx

@ -34,6 +34,16 @@
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true" EnableCollapse="true" <f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true" EnableCollapse="true"
Title="左侧面板(有提示信息)" ShowBorder="true" ShowHeader="false" Width="400px" AutoScroll="true"> Title="左侧面板(有提示信息)" ShowBorder="true" ShowHeader="false" Width="400px" AutoScroll="true">
<Items> <Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Tollbar3" runat="server">
<Items>
<f:TextBox ID="TextBox_Users" runat="server" Label = "用户名称" EmptyText = ""> </f:TextBox>
<f:Button ID="btnSearch_Users" runat="server" Text="查找" OnClick="btnSearchUser_Click" Icon="SystemSearch"></f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Grid ID = "Grid_User" Title = "用户列表" EnableRowSelectEvent="true" OnRowSelect="Grid_User_RowSelect" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "true" Width = "500px" runat ="server" <f:Grid ID = "Grid_User" Title = "用户列表" EnableRowSelectEvent="true" OnRowSelect="Grid_User_RowSelect" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "true" Width = "500px" runat ="server"
DataKeyNames = "ID,Name,Email,Password,Gender,ChineseName,EnglishName" SortField="ID" DataKeyNames = "ID,Name,Email,Password,Gender,ChineseName,EnglishName" SortField="ID"
OnPageIndexChange="Grid_TB_CONTRACT_PageIndexChange"> OnPageIndexChange="Grid_TB_CONTRACT_PageIndexChange">

2
SCP/Views/BasicData/SCP_VenderUser.aspx.cs

@ -93,7 +93,7 @@ namespace SCP.Views.BasicData
private void BindUser() private void BindUser()
{ {
BindVenderList(factoryList.SelectedValue); BindVenderList(factoryList.SelectedValue);
PublicDataController.Get_UserList(roleList.SelectedValue, factoryList.SelectedValue, (rs) => PublicDataController.Get_UserList(TextBox_Users.Text,roleList.SelectedValue, factoryList.SelectedValue, (rs) =>
{ {
if (rs.State == ReturnStatus.Succeed) if (rs.State == ReturnStatus.Succeed)
{ {

27
SCP/Views/BasicData/SCP_VenderUser.aspx.designer.cs

@ -120,6 +120,33 @@ namespace SCP.Views.BasicData {
/// </remarks> /// </remarks>
protected global::FineUI.Panel panelLeftRegion; protected global::FineUI.Panel panelLeftRegion;
/// <summary>
/// Tollbar3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Tollbar3;
/// <summary>
/// TextBox_Users 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextBox_Users;
/// <summary>
/// btnSearch_Users 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSearch_Users;
/// <summary> /// <summary>
/// Grid_User 控件。 /// Grid_User 控件。
/// </summary> /// </summary>

2
SCP/Views/PlanData/SCP_ASK.aspx

@ -71,7 +71,7 @@
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend1" Hidden="true" /> <f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend1" Hidden="true" />
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend2" Hidden="true" /> <f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend2" Hidden="true" />
<f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend3" Hidden="true" /> <f:TextBox runat = "server" Label = "子网站" EmptyText = "" ID = "TXT_Extend3" Hidden="true" />
<f:TextBox runat = "server" Label = "看板编号" EmptyText = "" ID = "TXT_AskBill" Hidden="true" /> <f:TextBox runat = "server" Label = "看板编号" EmptyText = "" ID = "TXT_AskBill" />
<f:DropDownList ID="ddl_Vender" runat="server" Label="供应商" EnableEdit="true" ></f:DropDownList> <f:DropDownList ID="ddl_Vender" runat="server" Label="供应商" EnableEdit="true" ></f:DropDownList>
<f:TextBox runat = "server" Label = "送货地点" EmptyText = "" ID = "TXT_Site_Desc" /> <f:TextBox runat = "server" Label = "送货地点" EmptyText = "" ID = "TXT_Site_Desc" />
</Items> </Items>

4
SCP/Views/PlanData/SCP_ASK_DETAIL.aspx

@ -109,7 +109,9 @@
<f:BoundField SortField="ReduceQty" DataField="ReduceQty" HeaderText="已减数量" ColumnID="ReceiveQty" Width="60px" Hidden="true" DataFormatString = "{0:F}" /> <f:BoundField SortField="ReduceQty" DataField="ReduceQty" HeaderText="已减数量" ColumnID="ReceiveQty" Width="60px" Hidden="true" DataFormatString = "{0:F}" />
<f:BoundField SortField="ReceivedPort" DataField="ReceivedPort" HeaderText="库位" ColumnID="ReceivedPort" /> <f:BoundField SortField="ReceivedPort" DataField="ReceivedPort" HeaderText="库位" ColumnID="ReceivedPort" />
<f:BoundField DataField="UpdateInfo" HeaderText="备注"/> <f:BoundField DataField="UpdateInfo" HeaderText="备注"/>
<f:BoundField SortField="OneMonth" DataField="OneMonth" HeaderText="预测一" ColumnID="OneMonth" />
<f:BoundField SortField="TwoMonth" DataField="TwoMonth" HeaderText="预测二" ColumnID="TwoMonth" />
<f:BoundField SortField="ThreeMonth" DataField="ThreeMonth" HeaderText="预测三" ColumnID="ThreeMonth" />
</Columns> </Columns>
</f:Grid> </f:Grid>

113
SCP/Views/PlanData/SCP_FORECAST.aspx

@ -0,0 +1,113 @@
<%@ 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="CssValid" OnClick="btnSave_Click" ></f:Button>
<f:Button ID="btnCancleSave" runat="server" Hidden="true" Text="取消确认" Icon="CssGo" OnClick="BtnCancleSave_Click" OnClientClick="if(!confirm('是否取消确认?'))return false;"></f:Button>
<f:Button ID="btnDelete" runat="server" Text="删除" Icon="CssDelete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否删除?'))return false;" ></f:Button>
<f:ToolbarSeparator runat="server" />
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload>
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Form BodyPadding="10px" Height="50px" ID="extForm1"
runat="server" Title="" ShowHeader="false">
<Rows>
<f:FormRow ColumnWidths="33% 33% 33% " ID="FormRow_2" runat="server">
<Items>
<f:TextBox runat="server" Label="零件号" ID="TextPartCode">
</f:TextBox>
<f:TextBox runat="server" Label="供应商编码" ID="TextVendId">
</f:TextBox>
<%-- <f:DropDownList ID="ddl_Day" runat="server" Label="查询月份">
<f:ListItem Text="全部" Value="0" Selected="true" />
<f:ListItem Text="1月" Value="1" />
<f:ListItem Text="2月" Value="2" />
<f:ListItem Text="3月" Value="3" />
<f:ListItem Text="4月" Value="4" />
<f:ListItem Text="5月" Value="5" />
<f:ListItem Text="6月" Value="6" />
<f:ListItem Text="7月" Value="7" />
<f:ListItem Text="8月" Value="8" />
<f:ListItem Text="9月" Value="9" />
<f:ListItem Text="10月" Value="10" />
<f:ListItem Text="11月" Value="11" />
<f:ListItem Text="12月" Value="12" />
</f:DropDownList>--%>
<f:DropDownList runat="server" ID="DDL_State" Label="状态">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="新建" Value="0" />
<f:ListItem Text="已确认" Value="1" />
</f:DropDownList>
<f:Button runat="server" ID="Button1" Text="查询" OnClick="btnSearch_Click"></f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Grid ID="Grid_V_TB_FORECAST" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableCheckBoxSelect="true"
runat="server" DataKeyNames="UID,PartCode,Month,MonthQty1,MonthQty2,MonthQty3,State,CreateUser,CreateTime"
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_FORECAST_PageIndexChange"
AutoScroll="True" EnableRowDoubleClickEvent="True">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="UID" Hidden="true" ColumnID="" DataField="UID" />
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" HeaderText="订单" ColumnID="" DataField="PoType" />
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="零件编号" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" HeaderText="图号" ColumnID="" DataField="PoLine" />
<f:BoundField runat="server" HeaderText="规格" ColumnID="" DataField="Specifications" />
<f:BoundField runat="server" HeaderText="单位" ColumnID="" DataField="Unit" />
<f:BoundField runat="server" HeaderText="当次订单数量" DataFormatString="{0:F0}" ColumnID="" DataField="Qty" />
<f:BoundField runat="server" HeaderText="产品状态" ColumnID="" DataField="ProductStatus" />
<f:BoundField runat="server" HeaderText="紧急" ColumnID="" DataField="IsUrgent" />
<f:BoundField Width="100px" DataField="ShippdedTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="要求到货日期" />
<f:BoundField runat="server" HeaderText="到货地" ColumnID="" DataField="ShippdedPlace" />
<f:BoundField runat="server" HeaderText="当月" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty" />
<f:BoundField runat="server" HeaderText="N+1" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty1" />
<f:BoundField runat="server" HeaderText="N+2" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty2" />
<f:BoundField runat="server" HeaderText="N+3" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty3" />
<f:BoundField runat="server" HeaderText="是否按期交货" ColumnID="" DataField="Ontime" />
<f:BoundField runat="server" HeaderText="不能按期交付日期" ColumnID="" DataField="Datetime" />
<f:BoundField runat="server" HeaderText="状态" Hidden="true" ColumnID="" DataField="State" />
<f:BoundField runat="server" HeaderText="创建者" ColumnID="" DataField="CreateUser" />
<f:BoundField Width="100px" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

239
SCP/Views/PlanData/SCP_FORECAST.aspx.cs

@ -0,0 +1,239 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Utils;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.Enums;
namespace SCP.Views.PlanData
{
public partial class SCP_FORECAST : PageBase
{
/// <summary>
/// 页面加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
/// <summary>
/// 加载数据
/// </summary>
public void LoadData()
{
BindData();
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindData()
{
SearchV_TB_FORECAST_Data((result) =>
{
Grid_V_TB_FORECAST.RecordCount = result.Count();
var list = SortAndPage<V_TB_FORECAST>(result, Grid_V_TB_FORECAST);
Grid_V_TB_FORECAST.DataSource = list;
Grid_V_TB_FORECAST.DataBind();
});
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_TB_FORECAST_Data(Action<IQueryable<V_TB_FORECAST>> p_action)
{
V_TB_FORECAST _entity = new V_TB_FORECAST();
_entity.IsDeleted = false;
if (!string.IsNullOrEmpty(TextPartCode.Text))
{
_entity.PartCode = TextPartCode.Text;
}
if (!string.IsNullOrEmpty(TextVendId.Text))
{
_entity.VendId = TextVendId.Text;
}
//if (ddl_Day.SelectedValue != "0")
//{
// _entity.Month = ddl_Day.SelectedValue;
//}
_entity.UserInAddress = CurrentUser.FactoryList;
_entity.UserInVendIds = CurrentUser.VenderList;
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_entity.BillStateList = new List<int>() { int.Parse(DDL_State.SelectedValue) };
}
SCP_FORECAST_CONTROLLER.Get_V_TB_FORECAST_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid_V_TB_FORECAST_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
/// <summary>
/// 导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnInput_Click(object sender, EventArgs e)
{
try
{
string _fileName = FileUp.FileName;
if (string.IsNullOrEmpty(_fileName))
{
Alert.Show("选择文件为空!");
return;
}
string _lx = _fileName.Split('.')[1];
Stream _stream = FileUp.PostedFile.InputStream;
DataTable _dt = new DataTable();
if (_lx == "xls")
{
_dt = ExcelHelper.GetDataTable(_stream);
}
else
{
_dt = ExcelHelper.GetDataTableOfXlsx(_stream);
}
var list = ConvertHelper.ToList<SCP_FORECAST_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
var ret = SCP_FORECAST_CONTROLLER.EXCEL_FORECAST_MOD(list, CurrentUser.Name, CurrentUser.FactoryList[0]);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{
BindData();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
}
}
catch (Exception ex)
{
Alert.Show(ex.Message);
}
}
/// <summary>
/// 确认数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Confirm);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
/// <summary>
/// 删除数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Reject);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
/// <summary>
/// 取消确认
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnCancleSave_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.New);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
}
}

197
SCP/Views/PlanData/SCP_FORECAST.aspx.designer.cs

@ -0,0 +1,197 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.PlanData
{
public partial class SCP_FORECAST
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// btnRefresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRefresh;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSave;
/// <summary>
/// btnCancleSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCancleSave;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDelete;
/// <summary>
/// FileUp 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FileUpload FileUp;
/// <summary>
/// btnInput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnInput;
/// <summary>
/// extForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Form extForm1;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// TextPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPartCode;
/// <summary>
/// TextVendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextVendId;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// Grid_V_TB_FORECAST 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_FORECAST;
/// <summary>
/// ToolbarSeparator2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

20
SCP/Views/PlanData/SCP_PO_DETAIL_OUT.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">
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar2" runat="server"> <f:Toolbar ID="Toolbar2" runat="server">
<Items> <Items>
@ -42,10 +42,10 @@
</Items> </Items>
</f:Form> </f:Form>
<f:Panel ID="Panel2" <f:Panel ID="Panel2"
runat="server" BodyPadding="0px" ShowBorder="true" ShowHeader="false" Layout="Column"> runat="server" BodyPadding="0px" ShowBorder="true" BoxFlex="1" ShowHeader="false" Layout="HBox" AutoScroll="True">
<Items> <Items>
<f:Panel ID="Panel3" <f:Panel ID="Panel3"
runat="server" BodyPadding="0px" ShowBorder="true" ShowHeader="false" Layout="VBox" ColumnWidth="45%"> runat="server" BodyPadding="0px" ShowBorder="true" ShowHeader="false" BoxFlex="1" Layout="VBox" AutoScroll="True" >
<Items> <Items>
<f:Toolbar ID="Toolbar1" runat="server"> <f:Toolbar ID="Toolbar1" runat="server">
<Items> <Items>
@ -57,8 +57,9 @@
<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"
AllowPaging="True" AllowPaging="True"
IsDatabasePaging="true" PageSize="100" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange"> IsDatabasePaging="true" PageSize="50" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange">
<PageItems> <PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator> </f:ToolbarSeparator>
@ -66,7 +67,8 @@
</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="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="500" Value="500" /> <f:ListItem Text="500" Value="500" />
<f:ListItem Text="1000" Value="1000" /> <f:ListItem Text="1000" Value="1000" />
</f:DropDownList> </f:DropDownList>
@ -78,7 +80,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 = "100px" DataField = "VendName" DataFormatString = "{0}" HeaderText = "供应商" /> <f:BoundField Width="300px" DataField="VendName" DataFormatString="{0}" HeaderText="供应商" />
</Columns> </Columns>
</f:Grid> </f:Grid>
</Items> </Items>
@ -86,7 +88,7 @@
<f:Panel ID="Panel4" <f:Panel ID="Panel4"
runat="server" BodyPadding="0px" ShowBorder="true" ShowHeader="false" Layout="VBox" ColumnWidth="50%"> runat="server" BodyPadding="0px" ShowBorder="true" ShowHeader="false" Layout="VBox" BoxFlex="1" >
<Items> <Items>
<f:Toolbar ID="Toolbar3" runat="server"> <f:Toolbar ID="Toolbar3" runat="server">
<Items> <Items>
@ -99,8 +101,8 @@
<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"
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>

4
SCP/Views/PlanData/SCP_PO_DETAIL_OUT.aspx.cs

@ -67,6 +67,7 @@ namespace SCP.PlanData
} }
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{ {
Grid_V_TB_PO_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail(); BindDetail();
} }
@ -112,6 +113,9 @@ namespace SCP.PlanData
{"域名" ,"域名" }, {"域名" ,"域名" },
{"站点" ,"站点" }, {"站点" ,"站点" },
{"收货口" ,"收货口" }, {"收货口" ,"收货口" },
{"预测一" ,"预测一" },
{"预测二" ,"预测二" },
{"预测三" ,"预测三" },
{"备注" ,"备注" } {"备注" ,"备注" }
}; };

73
SCP/Views/PlanData/SCP_UNI_API.aspx

@ -0,0 +1,73 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_UNI_API.aspx.cs" Inherits="SCP.Views.PlanData.SCP_UNI_API" %>
<!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>
</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% " ID="FormRow_2" runat="server">
<Items>
<f:TextBox runat="server" Label="发票号" ID="TextInvBill">
</f:TextBox>
<f:TextBox runat="server" Label="零件号" ID="TextPartCode">
</f:TextBox>
<f:TextBox runat="server" Label="供应商编码" ID="TextVendId">
</f:TextBox>
<f:Button runat="server" ID="Button1" Text="查询" OnClick="btnSearch_Click"></f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Grid ID="Grid_UNI_API" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableCheckBoxSelect="true"
runat="server" DataKeyNames="UID,BillNum,Invoice,VendId,PartCode,Receiver,Qty,Price"
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_UNI_API_PageIndexChange"
AutoScroll="True" EnableRowDoubleClickEvent="True">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="UID" Hidden="true" ColumnID="" DataField="UID" />
<f:BoundField runat="server" HeaderText="发票号" ColumnID="" DataField="BillNum" />
<f:BoundField runat="server" HeaderText="金税票号" ColumnID="" DataField="Invoice" />
<f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="零件编码" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" HeaderText="ERP收货单号" ColumnID="" DataField="Receiver" />
<f:BoundField runat="server" HeaderText="数量" DataFormatString="{0:F0}" ColumnID="" DataField="Qty" />
<f:BoundField runat="server" HeaderText="单价" ColumnID="" DataField="Price" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

100
SCP/Views/PlanData/SCP_UNI_API.aspx.cs

@ -0,0 +1,100 @@
using CK.SCP.Controller;
using CK.SCP.Models.Enums;
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.PlanData
{
public partial class SCP_UNI_API : 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_TS_UNIAPI_Data((result) =>
{
Grid_UNI_API.RecordCount = result.Count();
var list = SortAndPage<TS_UNI_API>(result, Grid_UNI_API);
Grid_UNI_API.DataSource = list;
Grid_UNI_API.DataBind();
});
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_TS_UNIAPI_Data(Action<IQueryable<TS_UNI_API>> p_action)
{
TS_UNI_API _entity = new TS_UNI_API();
_entity.State = 1;
_entity.InterfaceType = UniApiType.Invoice.ToString();
if (!string.IsNullOrEmpty(TextPartCode.Text))
{
_entity.PartCode = TextPartCode.Text;
}
if (!string.IsNullOrEmpty(TextVendId.Text))
{
_entity.VendId = TextVendId.Text;
}
if (!string.IsNullOrEmpty(TextInvBill.Text))
{
_entity.BillNum = TextInvBill.Text;
}
// _entity.UserInAddress = CurrentUser.FactoryList;
// _entity.UserInVendIds = CurrentUser.VenderList;
UniApiController.Get_TS_UNI_API_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_UNI_API.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid_UNI_API_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid_UNI_API.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
}
}

152
SCP/Views/PlanData/SCP_UNI_API.aspx.designer.cs

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

94
SCP/Views/Report/SCP_OTD_REPORT.aspx

@ -0,0 +1,94 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_OTD_REPORT.aspx.cs" Inherits="SCP.Views.Report.SCP_OTD_REPORT" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" 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="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_Click" >
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Form BodyPadding="10px" Height="40px" ID="extForm1" runat="server" Title="" ShowHeader="false">
<Rows>
<f:FormRow ColumnWidths="16% 16% 16% 16% 16% 16%" ID="FormRow_1" runat="server">
<Items>
<f:TextBox LabelWidth="50px" runat="server" Label="供应商" ID="TextVendId" >
</f:TextBox>
<f:TextBox LabelWidth="50px" runat="server" Label="零件号" ID="TextPartCode">
</f:TextBox>
<f:DatePicker LabelWidth="80px" runat="server" Label="到货日期" ID="TextBeginTime"></f:DatePicker>
<f:DatePicker LabelWidth="80px" runat="server" Label="至" ID="TextEndTime"></f:DatePicker>
<f:DropDownList LabelWidth="100px" runat="server" ID="TextM" Label="到货月份">
<f:ListItem Text="-" Value="0"/>
<f:ListItem Text="一月" Value="01" />
<f:ListItem Text="二月" Value="02" />
<f:ListItem Text="三月" Value="03" />
<f:ListItem Text="四月" Value="04" />
<f:ListItem Text="五月" Value="05" />
<f:ListItem Text="六月" Value="06" />
<f:ListItem Text="七月" Value="07" />
<f:ListItem Text="八月" Value="08" />
<f:ListItem Text="九月" Value="09" />
<f:ListItem Text="十月" Value="10" />
<f:ListItem Text="十一月" Value="11" />
<f:ListItem Text="十二月" Value="12" />
</f:DropDownList>
<f:Button runat="server" ID="btnQuery" Text="查询" OnClick="btnSearch_Click"></f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="PartCode,PartName,AskQty,ArriveQty,Qty,NntimelyQty,OTD,ArriveOTD"
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_PageIndexChange"
AutoScroll="True" EnableRowDoubleClickEvent="True" OnSort="Grid1_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="AskBillNum" HeaderText="要货看板看号" Width="150px" ColumnID="" DataField="AskBillNum" />
<f:BoundField runat="server" SortField="VendId" HeaderText="供应商编号" Width="150px" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" SortField="VendName" HeaderText="供应商名称" Width="150px" ColumnID="" DataField="VendName" />
<f:BoundField runat="server" SortField="PartCode" HeaderText="零件号" Width="150px" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" SortField="PartName" HeaderText="零件名称" Width="150px" ColumnID="" DataField="PartName" />
<f:BoundField runat="server" SortField="EndTime" DataField = "EndTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "到货日期" />
<f:BoundField runat="server" HeaderText="订单要货数量" Width="150px" ColumnID="" DataField="AskQty" />
<f:BoundField runat="server" HeaderText="到货数量" Width="150px" ColumnID="" DataField="ArriveQty" />
<f:BoundField runat="server" HeaderText="差额" Width="150px" ColumnID="" DataField="Qty" />
<f:BoundField runat="server" HeaderText="及时到货数量" Width="150px" ColumnID="" DataField="NntimelyQty" />
<f:BoundField runat="server" HeaderText="及时率" Width="150px" ColumnID="" DataField="OTD" />
<f:BoundField runat="server" HeaderText="完成率" Width="150px" ColumnID="" DataField="ArriveOTD" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

137
SCP/Views/Report/SCP_OTD_REPORT.aspx.cs

@ -0,0 +1,137 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Views.Report
{
public partial class SCP_OTD_REPORT : PageBase
{
/// <summary>
/// 加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TextBeginTime.SelectedDate = DateTime.Now.AddDays(1 - DateTime.Now.Day);//当前时间的月初
TextEndTime.SelectedDate = DateTime.Now;//当前时间
LoadData();
}
}
/// <summary>
/// 加载数据
/// </summary>
public void LoadData()
{
BindData();
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindData()
{
SearchV_OTD_REPORT_Data((result) => {
Grid1.RecordCount = result.Count();
var list = SortAndPage<SCP_OTD_EXPORT>(result, Grid1);
Grid1.DataSource = list;
Grid1.DataBind();
});
}
/// <summary>
/// 查询数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_OTD_REPORT_Data(Action<IQueryable<SCP_OTD_EXPORT>> p_action)
{
SCP_OTD_EXPORT _entity = new SCP_OTD_EXPORT();
if (!string.IsNullOrEmpty(TextM.SelectedValue))
{
if (TextM.SelectedValue != "0")
{
TextBeginTime.SelectedDate = DateTime.Parse(DateTime.Now.ToString(DateTime.Now.Year + "-" + TextM.SelectedValue + "-01"));
TextEndTime.SelectedDate = DateTime.Parse(DateTime.Now.ToString(DateTime.Now.Year + "-" + TextM.SelectedValue + "-01")).AddMonths(1).AddDays(-1);
}
}
if (TextBeginTime.SelectedDate != null)
{
_entity.BeginTime = (DateTime)TextBeginTime.SelectedDate;
}
if (TextEndTime.SelectedDate != null)
{
_entity.EndTime = (DateTime)TextEndTime.SelectedDate;
}
if (TextPartCode.Text != null)
{
_entity.PartCode = TextPartCode.Text;
}
if (TextVendId.Text != null)
{
_entity.VendId = TextVendId.Text;
}
SCP_REPORT_CONTROLLER.Get_V_SCP_OTD_REPORT_List(1, _entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
/// <summary>
/// 查询事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
/// <summary>
/// 分页条数change事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
/// <summary>
/// 页面索引change事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindData();
}
protected void btnOutput_Click(object sender, EventArgs e)
{
SearchV_OTD_REPORT_Data((result) => {
Grid1.RecordCount = result.Count();
List<SCP_OTD_EXPORT> _ls = result.ToList();
DataSet ds = SCP_EXCEL_CONTROLLER.GET_OTD_REPORT_EXECEL(_ls);
PageBase.DataSetToExcel(ds, "供应商及时率");
});
}
}
}

179
SCP/Views/Report/SCP_OTD_REPORT.aspx.designer.cs

@ -0,0 +1,179 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.Report
{
public partial class SCP_OTD_REPORT
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// btnRefresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRefresh;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// extForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Form extForm1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// TextVendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextVendId;
/// <summary>
/// TextPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPartCode;
/// <summary>
/// TextBeginTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker TextBeginTime;
/// <summary>
/// TextEndTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker TextEndTime;
/// <summary>
/// TextM 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList TextM;
/// <summary>
/// btnQuery 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnQuery;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary>
/// ToolbarSeparator2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

3
SCP/Views/SupplierData/SCP_ASK.aspx.cs

@ -277,7 +277,10 @@ namespace SCP.Views.SupplierData
protected void Window1_Close(object sender, WindowCloseEventArgs e) protected void Window1_Close(object sender, WindowCloseEventArgs e)
{ {
if (Session["Ask"] != null)
{
Session["Ask"] = null; Session["Ask"] = null;
}
BindAsk(); BindAsk();
} }

3
SCP/Views/SupplierData/SCP_ASK_DETAIL.aspx

@ -96,6 +96,9 @@
<f:BoundField SortField="ReceiveQty" DataField="ReceiveQty" HeaderText="收货数" ColumnID="ReceiveQty" Width="60px" />--%> <f:BoundField SortField="ReceiveQty" DataField="ReceiveQty" HeaderText="收货数" ColumnID="ReceiveQty" Width="60px" />--%>
<f:BoundField SortField="Remrk" DataField="Remark" HeaderText="说明" ColumnID="RejectQty" /> <f:BoundField SortField="Remrk" DataField="Remark" HeaderText="说明" ColumnID="RejectQty" />
<f:BoundField SortField="ReceivedPort_Desc" DataField="ReceivedPort_Desc" HeaderText="收货口" ColumnID="ReceivedPort_Desc" /> <f:BoundField SortField="ReceivedPort_Desc" DataField="ReceivedPort_Desc" HeaderText="收货口" ColumnID="ReceivedPort_Desc" />
<f:BoundField SortField="OneMonth" DataField="OneMonth" HeaderText="预测一" ColumnID="OneMonth" />
<f:BoundField SortField="TwoMonth" DataField="TwoMonth" HeaderText="预测二" ColumnID="TwoMonth" />
<f:BoundField SortField="ThreeMonth" DataField="ThreeMonth" HeaderText="预测三" ColumnID="ThreeMonth" />
</Columns> </Columns>
</f:Grid> </f:Grid>

113
SCP/Views/SupplierData/SCP_FORECAST.aspx

@ -0,0 +1,113 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_FORECAST.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_FORECAST" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" 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" Text="确认" Icon="CssValid" OnClick="btnSave_Click" ></f:Button>
<f:Button ID="btnCancleSave" runat="server" Text="取消确认" Icon="CssGo" OnClick="BtnCancleSave_Click" OnClientClick="if(!confirm('是否取消确认?'))return false;"></f:Button>
<f:Button ID="btnDelete" runat="server" Hidden="true" Text="删除" Icon="CssDelete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否删除?'))return false;" ></f:Button>
<f:ToolbarSeparator runat="server" />
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Hidden="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload>
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" Hidden="true" OnClick="btnInput_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Form BodyPadding="10px" Height="50px" ID="extForm1"
runat="server" Title="" ShowHeader="false">
<Rows>
<f:FormRow ColumnWidths="33% 33% 33% " ID="FormRow_2" runat="server">
<Items>
<f:TextBox runat="server" Label="零件号" ID="TextPartCode">
</f:TextBox>
<f:TextBox runat="server" Label="供应商编码" ID="TextVendId">
</f:TextBox>
<%-- <f:DropDownList ID="ddl_Day" runat="server" Label="查询月份">
<f:ListItem Text="全部" Value="0" Selected="true" />
<f:ListItem Text="1月" Value="1" />
<f:ListItem Text="2月" Value="2" />
<f:ListItem Text="3月" Value="3" />
<f:ListItem Text="4月" Value="4" />
<f:ListItem Text="5月" Value="5" />
<f:ListItem Text="6月" Value="6" />
<f:ListItem Text="7月" Value="7" />
<f:ListItem Text="8月" Value="8" />
<f:ListItem Text="9月" Value="9" />
<f:ListItem Text="10月" Value="10" />
<f:ListItem Text="11月" Value="11" />
<f:ListItem Text="12月" Value="12" />
</f:DropDownList>--%>
<f:DropDownList runat="server" ID="DDL_State" Label="状态">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="新建" Value="0" />
<f:ListItem Text="已确认" Value="1" />
</f:DropDownList>
<f:Button runat="server" ID="Button1" Text="查询" OnClick="btnSearch_Click"></f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Grid ID="Grid_V_TB_FORECAST" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableCheckBoxSelect="true"
runat="server" DataKeyNames="UID,PartCode,Month,MonthQty1,MonthQty2,MonthQty3,State,CreateUser,CreateTime"
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_FORECAST_PageIndexChange"
AutoScroll="True" EnableRowDoubleClickEvent="True">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="UID" Hidden="true" ColumnID="" DataField="UID" />
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" HeaderText="订单" ColumnID="" DataField="PoType" />
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="零件编号" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" HeaderText="图号" ColumnID="" DataField="PoLine" />
<f:BoundField runat="server" HeaderText="规格" ColumnID="" DataField="Specifications" />
<f:BoundField runat="server" HeaderText="单位" ColumnID="" DataField="Unit" />
<f:BoundField runat="server" HeaderText="当次订单数量" DataFormatString="{0:F0}" ColumnID="" DataField="Qty" />
<f:BoundField runat="server" HeaderText="产品状态" ColumnID="" DataField="ProductStatus" />
<f:BoundField runat="server" HeaderText="紧急" ColumnID="" DataField="IsUrgent" />
<f:BoundField Width="100px" DataField="ShippdedTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="要求到货日期" />
<f:BoundField runat="server" HeaderText="到货地" ColumnID="" DataField="ShippdedPlace" />
<f:BoundField runat="server" HeaderText="当月" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty" />
<f:BoundField runat="server" HeaderText="N+1" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty1" />
<f:BoundField runat="server" HeaderText="N+2" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty2" />
<f:BoundField runat="server" HeaderText="N+3" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty3" />
<f:BoundField runat="server" HeaderText="是否按期交货" ColumnID="" DataField="Ontime" />
<f:BoundField runat="server" HeaderText="不能按期交付日期" ColumnID="" DataField="Datetime" />
<f:BoundField runat="server" HeaderText="状态" Hidden="true" ColumnID="" DataField="State" />
<f:BoundField runat="server" HeaderText="创建者" ColumnID="" DataField="CreateUser" />
<f:BoundField Width="100px" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

240
SCP/Views/SupplierData/SCP_FORECAST.aspx.cs

@ -0,0 +1,240 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Utils;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.Enums;
namespace SCP.Views.SupplierData
{
public partial class SCP_FORECAST : PageBase
{
/// <summary>
/// 页面加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
/// <summary>
/// 加载数据
/// </summary>
public void LoadData()
{
BindData();
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindData()
{
SearchV_TB_FORECAST_Data((result) =>
{
Grid_V_TB_FORECAST.RecordCount = result.Count();
var list = SortAndPage<V_TB_FORECAST>(result, Grid_V_TB_FORECAST);
Grid_V_TB_FORECAST.DataSource = list;
Grid_V_TB_FORECAST.DataBind();
});
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_TB_FORECAST_Data(Action<IQueryable<V_TB_FORECAST>> p_action)
{
V_TB_FORECAST _entity = new V_TB_FORECAST();
_entity.IsDeleted = false;
if (!string.IsNullOrEmpty(TextPartCode.Text))
{
_entity.PartCode = TextPartCode.Text;
}
if (!string.IsNullOrEmpty(TextVendId.Text))
{
_entity.VendId = TextVendId.Text;
}
//if (ddl_Day.SelectedValue != "0")
//{
// _entity.Month = ddl_Day.SelectedValue;
//}
_entity.UserInAddress = CurrentUser.FactoryList;
_entity.UserInVendIds = CurrentUser.VenderList;
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_entity.BillStateList = new List<int>() { int.Parse(DDL_State.SelectedValue) };
}
SCP_FORECAST_CONTROLLER.Get_V_TB_FORECAST_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid_V_TB_FORECAST_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
/// <summary>
/// 导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnInput_Click(object sender, EventArgs e)
{
try
{
string _fileName = FileUp.FileName;
if (string.IsNullOrEmpty(_fileName))
{
Alert.Show("选择文件为空!");
return;
}
string _lx = _fileName.Split('.')[1];
Stream _stream = FileUp.PostedFile.InputStream;
DataTable _dt = new DataTable();
if (_lx == "xls")
{
_dt = ExcelHelper.GetDataTable(_stream);
}
else
{
_dt = ExcelHelper.GetDataTableOfXlsx(_stream);
}
var list = ConvertHelper.ToList<SCP_FORECAST_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
var ret = SCP_FORECAST_CONTROLLER.EXCEL_FORECAST_MOD(list, CurrentUser.Name, CurrentUser.FactoryList[0]);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{
BindData();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
}
}
catch (Exception ex)
{
Alert.Show(ex.Message);
}
}
/// <summary>
/// 确认数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Confirm);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
/// <summary>
/// 删除数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Reject);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
/// <summary>
/// 取消确认
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnCancleSave_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.New);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
}
}

197
SCP/Views/SupplierData/SCP_FORECAST.aspx.designer.cs

@ -0,0 +1,197 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.SupplierData
{
public partial class SCP_FORECAST
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// btnRefresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRefresh;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSave;
/// <summary>
/// btnCancleSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCancleSave;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDelete;
/// <summary>
/// FileUp 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FileUpload FileUp;
/// <summary>
/// btnInput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnInput;
/// <summary>
/// extForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Form extForm1;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// TextPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPartCode;
/// <summary>
/// TextVendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextVendId;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// Grid_V_TB_FORECAST 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_FORECAST;
/// <summary>
/// ToolbarSeparator2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

10
SCP/Views/SupplierData/SCP_INFO_EDIT.aspx.cs

@ -190,10 +190,18 @@ namespace SCP.SupplierData
Upload(txtFileName, "", model); Upload(txtFileName, "", model);
} }
SCP_INFO_CONTROLLER.SaveInfo(model); var ret = SCP_INFO_CONTROLLER.SaveInfo(model);
if (ret.State == ReturnStatus.Succeed)
{
Alert.ShowInParent("保存成功!");
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
BindField(); BindField();
}
else
{
Alert.Show(ret.Message);
}
} }
} }

7
SCP/Views/SupplierData/SCP_INVOICE_CREATE.aspx

@ -60,7 +60,8 @@
<f:BoundField runat="server" HeaderText="项目编码" ColumnID="" DataField="ProjectId" /> <f:BoundField runat="server" HeaderText="项目编码" ColumnID="" DataField="ProjectId" />
<f:BoundField runat="server" HeaderText="订单" ColumnID="" DataField="PoBillNum" /> <f:BoundField runat="server" HeaderText="订单" ColumnID="" DataField="PoBillNum" />
<f:BoundField runat="server" HeaderText="订单行" ColumnID="" DataField="PoLine" /> <f:BoundField runat="server" HeaderText="订单行" ColumnID="" DataField="PoLine" />
<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="发货单" ColumnID="" DataField="AsnBillNum" /> <f:BoundField runat="server" HeaderText="发货单" ColumnID="" DataField="AsnBillNum" />
<f:BoundField runat="server" HeaderText="零件号" ColumnID="" DataField="PartCode" /> <f:BoundField runat="server" HeaderText="零件号" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" HeaderText="零件名称" ColumnID="" DataField="PartDesc1" /> <f:BoundField runat="server" HeaderText="零件名称" ColumnID="" DataField="PartDesc1" />
@ -68,7 +69,7 @@
<f:TemplateField Width="90px" HeaderText="单价"> <f:TemplateField Width="90px" HeaderText="单价">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="txtPrice" runat="server" Width="80px" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" <asp:TextBox ID="txtPrice" runat="server" Width="80px" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"
Text='<%# Eval("Price") %>' MaxLength="12" Enabled="false" ></asp:TextBox> Text='<%# Eval("Price") %>' MaxLength="12" ></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</f:TemplateField> </f:TemplateField>
<f:TemplateField HeaderText="可用开票数量" Width="70px" ColumnID="Total"> <f:TemplateField HeaderText="可用开票数量" Width="70px" ColumnID="Total">
@ -81,7 +82,7 @@
<f:TemplateField Width="90px" HeaderText="开票数量"> <f:TemplateField Width="90px" HeaderText="开票数量">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="txtQty" runat="server" Width="80px" onkeyup="this.value=this.value.replace(/,'')" onafterpaste="this.value=this.value.replace(/-?\D/g,'')" <asp:TextBox ID="txtQty" runat="server" Width="80px" onkeyup="this.value=this.value.replace(/,'')" onafterpaste="this.value=this.value.replace(/-?\D/g,'')"
MaxLength="12" Text='<%# Eval("InputQty") %>' ReadOnly="true" Enabled="false" ></asp:TextBox> MaxLength="12" Text='<%# Eval("InputQty") %>' ></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</f:TemplateField> </f:TemplateField>
<f:BoundField runat="server" HeaderText="合同价格" ColumnID="" DataField="ContractPrice" Hidden="true" /> <f:BoundField runat="server" HeaderText="合同价格" ColumnID="" DataField="ContractPrice" Hidden="true" />

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

@ -108,8 +108,8 @@ namespace SCP.Views.SupplierData
InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm; InvoiceCreateQueryParm parm = Session["InvoiceCreateQueryParm"] as InvoiceCreateQueryParm;
Grid_SCP_INVOICE_CREATE.RecordCount = q.Count(); Grid_SCP_INVOICE_CREATE.RecordCount = q.Count();
q = SortAndPage<V_TB_RECEIVE_LIST>(q, Grid_SCP_INVOICE_CREATE); q = SortAndPage<V_TB_RECEIVE_LIST>(q, Grid_SCP_INVOICE_CREATE);
List<V_TB_RECEIVE_LIST> temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST(q.ToList()); // List<V_TB_RECEIVE_LIST> temp = SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_LIST(q.ToList());
temp = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(temp); List<V_TB_RECEIVE_LIST> temp = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(q.ToList());
foreach (V_TB_RECEIVE_LIST rec in temp) foreach (V_TB_RECEIVE_LIST rec in temp)
{ {
@ -259,7 +259,7 @@ namespace SCP.Views.SupplierData
_entity.VendBatch = rowDataKeys[25] as string; _entity.VendBatch = rowDataKeys[25] as string;
_entity.Currency = rowDataKeys[26] as string; _entity.Currency = rowDataKeys[26] as string;
_entity.BillType_DESC = rowDataKeys[27] as string; _entity.BillType_DESC = rowDataKeys[27] as string;
_entity.ErpRecvBillNum= rowDataKeys[28] as string;

9
SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx

@ -121,7 +121,7 @@
<f:Grid ID="Grid_V_TB_RECEIVE_LIST" ShowBorder="true" ShowHeader="true" PageSize="20" BoxFlex="1" CssClass="maingrid" <f:Grid ID="Grid_V_TB_RECEIVE_LIST" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,ProjectId,RecvBillNum,PartCode,PoLine,Qty,Price" IsDatabasePaging="true" AllowPaging="True" SortField="RecvBillNum" runat="server" DataKeyNames="UID,ProjectId,RecvBillNum,PartCode,PoLine,Qty,Price" IsDatabasePaging="true" AllowPaging="True" SortField="RecvBillNum"
AutoScroll="True" OnPageIndexChange="Grid_V_TB_RECEIVE_LIST_PageIndexChange" EnableCheckBoxSelect = "true" OnRowDataBound="Grid_V_TB_RECEIVE_LIST_RowDataBound" > AutoScroll="True" OnPageIndexChange="Grid_V_TB_RECEIVE_LIST_PageIndexChange" EnableCheckBoxSelect = "true" OnRowDataBound="Grid_V_TB_RECEIVE_LIST_RowDataBound" >
<PageItems> <PageItems>
@ -146,7 +146,8 @@
<f:BoundField runat="server" HeaderText="项目编码" DataField="ProjectId" width="80"/> <f:BoundField runat="server" HeaderText="项目编码" DataField="ProjectId" width="80"/>
<f:BoundField runat="server" HeaderText="单据类型" ColumnID="BillType_DESC" DataField="BillType_DESC" width="80"/> <f:BoundField runat="server" HeaderText="单据类型" ColumnID="BillType_DESC" DataField="BillType_DESC" width="80"/>
<f:BoundField runat="server" HeaderText="单据号" ColumnID="RecvBillNum" DataField="RecvBillNum" width="80" /> <f:BoundField runat="server" HeaderText="ERP单据号" ColumnID="ErpRecvBillNum" DataField="ErpRecvBillNum" width="80" />
<f:BoundField runat="server" HeaderText="WMS单据号" ColumnID="RecvBillNum" DataField="RecvBillNum" width="80" />
<f:BoundField runat="server" HeaderText="发货单号" ColumnID="AsnBillNum" DataField="AsnBillNum" width="80"/> <f:BoundField runat="server" HeaderText="发货单号" ColumnID="AsnBillNum" DataField="AsnBillNum" width="80"/>
<f:BoundField runat="server" HeaderText="供应商" ColumnID="VendName" DataField="VendName" /> <f:BoundField runat="server" HeaderText="供应商" ColumnID="VendName" DataField="VendName" />
<f:BoundField runat="server" HeaderText="供应商编码" DataField="VendId" width="80"/> <f:BoundField runat="server" HeaderText="供应商编码" DataField="VendId" width="80"/>
@ -159,8 +160,8 @@
<f:TemplateField HeaderText="可开票数量" ColumnID="Qty" width="100"> <f:TemplateField HeaderText="可开票数量" ColumnID="Qty" width="100">
<ItemTemplate> <ItemTemplate>
<input type="hidden" class="price" runat="server" value='<%# Eval("Price") %>' /> <input type="hidden" class="price" runat="server" value='<%# Eval("Price") %>' />
<input type="hidden" class="number" runat="server" value='<%# Eval("Qty") %>' /> <input type="hidden" class="number" runat="server" value='<%# Eval("CanQty") %>' />
<asp:Label runat="server" DataField="Qty" ID="Qty1" Text='<%# Eval("Qty") %>'></asp:Label> <asp:Label runat="server" DataField="Qty" ID="Qty1" Text='<%# Eval("CanQty") %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</f:TemplateField> </f:TemplateField>
<f:BoundField runat="server" HeaderText="零件号" ColumnID="" DataField="PartCode" width="80"/> <f:BoundField runat="server" HeaderText="零件号" ColumnID="" DataField="PartCode" width="80"/>

30
SCP/Views/SupplierData/SCP_RECEIVE_LIST.aspx.cs

@ -263,8 +263,7 @@ namespace SCP.SupplierData
var _tax = lbTaxRate.SelectedValue; var _tax = lbTaxRate.SelectedValue;
var _cj = string.IsNullOrEmpty(txtContractPrice1.Text) ? "0" : txtContractPrice1.Text; var _cj = string.IsNullOrEmpty(txtContractPrice1.Text) ? "0" : txtContractPrice1.Text;
var _tz = string.IsNullOrEmpty(txtBlancePrice1.Text) ? "0" : txtBlancePrice1.Text; var _tz = string.IsNullOrEmpty(txtBlancePrice1.Text) ? "0" : txtBlancePrice1.Text;
SearchData((rs) =>
{
string IsCreate = "0"; string IsCreate = "0";
if (Grid_V_TB_RECEIVE_LIST.SelectedRowIndexArray.Length == 0) if (Grid_V_TB_RECEIVE_LIST.SelectedRowIndexArray.Length == 0)
@ -315,24 +314,6 @@ namespace SCP.SupplierData
Alert.Show("选择零件记录超过,发票允许条数!"); Alert.Show("选择零件记录超过,发票允许条数!");
return; return;
} }
//if (CurrentUser.FactoryList.FirstOrDefault() == "CNS")
//{
// if (_projectList.Distinct().Count() > 1)
// {
// Alert.Show("请选择同一项目编号零件生成发票(可以到【查询面板】填写查询)</br>有退货必须选择否则影响财务收票!");
// return;
// }
// //var _ls = rs.Where(p => p.State==(int)ReceiveState.Check && p.RecvBillNum.Contains("R.") && p.VendId==vender && p.IsDeleted == false && p.ProjectId==_projectId && p.Site==CurrentUser.FactoryList.FirstOrDefault());
// //if (_ls.Count() > 0)
// //{
// // var _count=_rejList.Count(p => p == _projectId);
// // if (_count != _ls.Count())
// // {
// // Alert.Show(_projectId+"项目还存在退货数量!");
// // return;
// // }
// //}
//}
if (_list.Distinct().Count() > 1) if (_list.Distinct().Count() > 1)
{ {
@ -364,16 +345,9 @@ namespace SCP.SupplierData
parm.CJ = _cj; parm.CJ = _cj;
parm.TZ = _tz; parm.TZ = _tz;
//MyQueryStringEnCode me = new MyQueryStringEnCode("ReceiveID=" + IDS + "&VendId=" + vender + "&Modify=" + IsCreate + "&IsAll=" + p_all + "&Tax=" + _tax + "&CJ=" + _cj + "&TZ=" + _tz);
//if (me.QueryString.Length > 2000)
//{
// Alert.Show("选择零件记录超过,发票允许条数!");
// return;
//}
Session["InvoiceCreateQueryParm"] = parm; Session["InvoiceCreateQueryParm"] = parm;
string ret = Window1.GetShowReference("../../Views/SupplierData/SCP_INVOICE_CREATE.aspx", "生成发票"); string ret = Window1.GetShowReference("../../Views/SupplierData/SCP_INVOICE_CREATE.aspx", "生成发票");
PageContext.RegisterStartupScript(ret); PageContext.RegisterStartupScript(ret);
});
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -477,7 +451,7 @@ namespace SCP.SupplierData
{ "PartDesc1", "零件名称" }, { "PartDesc1", "零件名称" },
{ "LocUnit", "单位" }, { "LocUnit", "单位" },
{ "Currency", "币种" }, { "Currency", "币种" },
{ "Qty", "可开票数量" }, { "CanQty", "可开票数量" },
{ "Price", "单价" }, { "Price", "单价" },
{ "CreateTime", "创建时间" } { "CreateTime", "创建时间" }
}; };

81
SCP/Views/SupplierData/SCP_STOCK.aspx

@ -9,90 +9,57 @@
</head> </head>
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> <f:PageManager ID="PageManager1" 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="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Add"> <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>
<f:Button ID="Button3" runat="server" EnablePostBack="True" Text="导出" Icon="Add"> <f:Button ID="Button1" runat="server" Text="导出" OnClick="btnOutput_Click" Icon="PageExcel">
</f:Button>
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_Click">
</f:Button> </f:Button>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
</f:Form> </f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ID="FormRow_1">
<Items>
<f:Label runat="server" Label="零件代码" />
<f:TextBox ID="txtPartCode" runat="server" />
<f:Label runat="server" Label="零件名称" />
<f:TextBox ID="txtPartDesc1" runat="server" />
<f:Label runat="server" Label="库位" />
<f:TextBox ID="txtLocCode" runat="server" />
<f:Label runat="server" Label="批次" />
<f:TextBox ID="txtBatch" runat="server" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_2">
<Items>
<f:Label runat="server" Label="数量" />
<f:TextBox ID="txtQty" runat="server" />
<f:Label runat="server" Label="收货日期" />
<f:DatePicker ID="ReceiveDate" runat="server" Required="True" />
<f:Label runat="server" Label="生产日期" />
<f:DatePicker ID="ProduceDate" runat="server" Required="true" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3">
<Items>
<f:Button runat="server" ID="btnClose" Text="关闭" OnClick="btnClose_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items> <f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="false" Title="" ShowHeader="true" SortField="UID" BoxFlex="1" CssClass="maingrid"
</f:GroupPanel> AllowPaging="true" PageSize="50" IsDatabasePaging="true" OnPageIndexChange="Grid1_PageIndexChange"
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="10" BoxFlex="1" CssClass="maingrid" ShowBorder="true" AllowSorting="true" DataKeyNames="UID,PartCode,PartDesc1,VendId,qty">
runat="server" DataKeyNames="" IsDatabasePaging="True" AllowPaging="True"
EnableRowSelectEvent="True" AutoScroll="True">
<PageItems> <PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator> </f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:"> <f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText> </f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" runat="server"> <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
<f:ListItem Text="10" Value="10" /> runat="server">
<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" />
<f:ListItem Text="200" Value="200" /> <f:ListItem Text="200" Value="200" />
</f:DropDownList> </f:DropDownList>
</PageItems> </PageItems>
<Columns> <Columns>
<f:BoundField runat="server" HeaderText="零件代码" ColumnID="" DataField="PartCode" /> <f:BoundField SortField="UID" DataField="UID" Width="250px" Hidden="true" HeaderText="UID" ColumnID="UID" />
<f:BoundField runat="server" HeaderText="零件名称" ColumnID="" DataField="PartDesc1" /> <f:BoundField SortField="PartCode" DataField="PartCode" Width="250px" HeaderText="零件号" ColumnID="PartCode" />
<f:BoundField runat="server" HeaderText="库位" ColumnID="" DataField="LocCode" /> <f:BoundField SortField="PartDesc1" DataField="PartDesc1" Width="250px" HeaderText="零件名称" ColumnID="PartDesc1" />
<f:BoundField runat="server" HeaderText="批次" ColumnID="" DataField="Batch" /> <f:BoundField SortField="VendId" DataField="VendId" HeaderText="供应商编号" Width="250px" ColumnID="VendId" />
<f:BoundField runat="server" HeaderText="数量" ColumnID="" DataField="Qty" /> <f:BoundField SortField="qty" DataField="qty" HeaderText="库存数量" Width="250px" ColumnID="qty" DataFormatString="{0:#.####}" />
<f:BoundField runat="server" HeaderText="收货日期" ColumnID="" DataField="ReceiveDate" />
<f:BoundField runat="server" HeaderText="生产日期" ColumnID="" DataField="ProduceDate" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns> </Columns>
</f:Grid> </f:Grid>
</Items> </Items>
</f:Panel> </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> </form>
</body> </body>
</html> </html>

92
SCP/Views/SupplierData/SCP_STOCK.aspx.cs

@ -4,6 +4,7 @@ using System.Linq;
using System.Web; using System.Web;
using System.Web.UI; using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using ChangKeTec.Wms.Models.Wms;
using CK.SCP.Controller; using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity; using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils; using CK.SCP.Utils;
@ -15,71 +16,80 @@ namespace SCP.Views.SupplierData
{ {
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
if(!Page.IsPostBack) if (!IsPostBack)
{ {
if(!CurrentUser.RoleList.Contains("供应商")) BindDetail();
{
Alert.Show("当前用户不是供应商!");
return;
} }
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid1);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
BindStock();
} }
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();
});
} }
private void Search(Action<IQueryable<V_Stock>> p_action) public void SearchV_TB_ASN_DETAILData(Action<IQueryable<VIEW_STOCK_VEND>> p_action)
{ {
V_Stock _entity = new V_Stock(); VIEW_STOCK_VEND _entity = new VIEW_STOCK_VEND();
_entity.PartCode = txtPartCode.Text; _entity.PartCode = txtPartcode.Text;
_entity.PartDesc1 = txtPartDesc1.Text;
_entity.LocCode = txtLocCode.Text;
_entity.LocCode = txtBatch.Text;
_entity.ReceiveDate = ReceiveDate.SelectedDate;
_entity.Qty =ConvertHelper.To<decimal>(txtQty.Text);
_entity.ProduceDate = ProduceDate.SelectedDate;
_entity.UserInVendIds = CurrentUser.VenderList; _entity.UserInVendIds = CurrentUser.VenderList;
SCP_STOCK_CONTROLLER.Get_V_Stock_List(_entity, (ret) => { SCP_WMS_CONTROLLER.Get_VIEW_STOCK_DETAIL(_entity, (_ret) =>
if (ret.State == ReturnStatus.Succeed) {
if (_ret.State == ReturnStatus.Succeed)
{ {
p_action(ret.Result); p_action(_ret.Result);
} }
}); });
} }
private void BindStock() /// <summary>
protected void btnSearch_Click(object sender, EventArgs e)
{ {
Search(ret => { BindDetail();
Grid1.RecordCount = ret.Count(); }
Grid1.DataSource = ret.ToList(); protected void Grid1_PageIndexChange(object sender, FineUI.GridPageEventArgs e)
Grid1.DataBind(); {
}); BindDetail();
} }
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{ {
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindStock(); BindDetail();
} }
protected void BtnSearch_Click(object sender, EventArgs e) protected void btnOutput_Click(object sender, EventArgs e)
{ {
BindStock(); 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();
protected void btnClose_Click(object sender, EventArgs e) object[] rowDataKeys = Grid1.DataKeys[i];
{ inv.PartCode = rowDataKeys[1].ToString();//零件号
gp1.Hidden = true; inv.PartDesc1 = rowDataKeys[2].ToString();//零件名称
inv.VendId = rowDataKeys[3].ToString();//供应商编码
if (rowDataKeys[4] != null)
{
inv.qty = decimal.Parse(rowDataKeys[4].ToString());//数量
} }
_ls.Add(inv);
protected void btnShow_Click(object sender, EventArgs e) }
var aaa = ToDataTable(_ls);
var bb = GetHtmlString(aaa);
Dictionary<string, string> cellheader = new Dictionary<string, string>
{ {
gp1.Hidden = false; { "PartCode", "零件号" },
{ "PartDesc1", "零件名称" },
{ "VendId", "供应商编号" },
{ "qty", "库存数量" }
};
string url = EntityListToExcel2003(cellheader, _ls, "库存明细");
} }
} }
} }

142
SCP/Views/SupplierData/SCP_STOCK.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.Views.SupplierData { namespace SCP.Views.SupplierData
{
public partial class SCP_STOCK { public partial class SCP_STOCK
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -22,166 +24,67 @@ namespace SCP.Views.SupplierData {
protected global::System.Web.UI.HtmlControls.HtmlForm form1; protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary> /// <summary>
/// Panel1 控件。 /// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// FormRow_1 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.FormRow FormRow_1; protected global::FineUI.PageManager PageManager1;
/// <summary> /// <summary>
/// txtPartCode 控件。 /// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtPartCode;
/// <summary>
/// txtPartDesc1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtPartDesc1;
/// <summary>
/// txtLocCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtLocCode;
/// <summary>
/// txtBatch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBatch;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// txtQty 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox txtQty; protected global::FineUI.Panel Panel1;
/// <summary> /// <summary>
/// ReceiveDate 控件。 /// Toolbar2 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DatePicker ReceiveDate; protected global::FineUI.Toolbar Toolbar2;
/// <summary> /// <summary>
/// ProduceDate 控件。 /// Label2 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DatePicker ProduceDate; protected global::FineUI.Label Label2;
/// <summary> /// <summary>
/// FormRow_3 控件。 /// txtPartcode 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.FormRow FormRow_3; protected global::FineUI.TextBox txtPartcode;
/// <summary> /// <summary>
/// btnClose 控件。 /// btnSearch 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button btnClose; protected global::FineUI.Button btnSearch;
/// <summary> /// <summary>
/// BtnSearch 控件。 /// Button1 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button BtnSearch; protected global::FineUI.Button Button1;
/// <summary> /// <summary>
/// Grid1 控件。 /// Grid1 控件。
@ -218,5 +121,14 @@ namespace SCP.Views.SupplierData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize; protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
} }
} }

75
SCP/Views/SupplierData/SCP_STOCK_DETAIL.aspx

@ -0,0 +1,75 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_STOCK_DETAIL.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_STOCK_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:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
</f:ToolbarSeparator>
<f:Label ID="Label3" runat="server" Label="时间" >
</f:Label>
<f:DatePicker ID="DatePicker1" runat="server" >
</f:DatePicker>
<f:Label ID="Label1" runat="server" Label="-" Text="-" ShowLabel="false">
</f:Label>
<f:DatePicker ID="DatePicker2" runat="server" >
</f:DatePicker>
<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="LogTime" BoxFlex="1"
AllowPaging="true" PageSize="100" IsDatabasePaging="true" OnPageIndexChange="Grid1_PageIndexChange"
ShowBorder="False" AllowSorting="true" DataKeyNames="PartCode,status,VendId,qty,LogTime">
<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:ListItem Text="1000" Value="1000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField SortField="status" DataField="status" Width="250px" HeaderText="类别" ColumnID="status" />
<f:BoundField SortField="PartCode" DataField="PartCode" Width="250px" HeaderText="零件号" ColumnID="PartCode" />
<f:BoundField SortField="LogTime" DataField="LogTime" DataFormatString = "{0:yyyy-MM-dd}" Width="250px" HeaderText="LogTime" ColumnID="LogTime" />
<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>

116
SCP/Views/SupplierData/SCP_STOCK_DETAIL.aspx.cs

@ -0,0 +1,116 @@
using ChangKeTec.Wms.Models.Wms;
using CK.SCP.Controller;
using System;
using System.Collections.Generic;
using System.Linq;
namespace SCP.Views.SupplierData
{
public partial class SCP_STOCK_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_QTY>(ret, Grid1);
Grid1.DataSource = list;
Grid1.DataBind();
});
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_TB_ASN_DETAILData(Action<IQueryable<VIEW_STOCK_QTY>> p_action)
{
VIEW_STOCK_QTY _entity = new VIEW_STOCK_QTY();
_entity.PartCode = txtPartcode.Text;
_entity.UserInVendIds = CurrentUser.VenderList;
if (DatePicker1.SelectedDate != null)
{
_entity.BeginTime = DatePicker1.SelectedDate;
}
if (DatePicker2.SelectedDate != null)
{
_entity.EndTime = DatePicker2.SelectedDate;
}
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 ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
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_QTY> _ls = new List<VIEW_STOCK_QTY>();
for (int i = 0, count = Grid1.Rows.Count; i < count; i++)
{
VIEW_STOCK_QTY inv = new VIEW_STOCK_QTY();
object[] rowDataKeys = Grid1.DataKeys[i];
inv.status = rowDataKeys[1].ToString();//类型
inv.PartCode = rowDataKeys[0].ToString();//零件号
inv.LogTime =Convert.ToDateTime( rowDataKeys[4]);//零件名称
inv.VendId = rowDataKeys[2].ToString();//供应商编码
if (rowDataKeys[3] != null)
{
inv.qty = decimal.Parse(rowDataKeys[4].ToString());//数量
}
_ls.Add(inv);
}
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "status", "类别" },
{ "PartCode", "零件号" },
{ "LogTime", "LogTime" },
{ "VendId", "供应商编号" },
{ "qty", "库存数量" }
};
string url = EntityListToExcel2003(cellheader, _ls, "库存明细");
}
}
}

179
SCP/Views/SupplierData/SCP_STOCK_DETAIL.aspx.designer.cs

@ -0,0 +1,179 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.SupplierData
{
public partial class SCP_STOCK_DETAIL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Label2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label Label2;
/// <summary>
/// txtPartcode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtPartcode;
/// <summary>
/// ToolbarSeparator2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
/// <summary>
/// Label3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label Label3;
/// <summary>
/// DatePicker1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DatePicker1;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Label Label1;
/// <summary>
/// DatePicker2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DatePicker2;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSearch;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
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>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
}
}

54
SCP/Views/SupplierData/SCP_UNPAID.aspx

@ -0,0 +1,54 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_UNPAID.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_UNPAID" %>
<!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="form2" 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="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Add" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="BtnOutPut" runat="server" EnablePostBack="True" Text="导出" Icon="Add" OnClick="BtnOutPut_Click">
</f:Button>
<f:Button ID="btnDetail" runat="server" EnablePostBack="True" Text="明细" Icon="Add" OnClick="btnDetail_Click">
</f:Button>
<f:Button ID="btnNew" runat="server" EnablePostBack="True" Text="新建发货单" Icon="Add" OnClick="btnNew_Click">
</f:Button>
<f:Button ID="btnShow" runat="server" Icon="Add" Text="显示查询面板" OnClick="btnShow_Click">
</f:Button>
<f:Button ID="btnPallet" runat="server" Icon="Add" Text="创建托盘" OnClick="btnPallet_Click" >
</f:Button>
<f:Button ID="btnPalletDetail" runat="server" Icon="Add" Text="查看托盘" OnClick="btnPalletDetail_Click" >
</f:Button>--%>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Grid ID="Grid1" runat="server">
</f:Grid>
<f:Grid ID="Grid2" runat="server">
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="发货明细" Target="Parent" EnableIFrame="true" CloseAction="HidePostBack"
IFrameUrl="about:blank" Height="600px" Width="1024px" AutoScroll="True" OnClose="Window1_Close" />
</form>
</body>
</html>

17
SCP/Views/SupplierData/SCP_UNPAID.aspx.cs

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Views.SupplierData
{
public partial class SCP_UNPAID : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

69
SCP/Views/SupplierData/SCP_UNPAID.aspx.designer.cs

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

2
SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM.aspx

@ -74,7 +74,7 @@
</Items> </Items>
</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="100" ShowHeader="False" SortField="State;CreateTime" AllowPaging="True" PageSize="200"
OnPageIndexChange="Grid_V_TB_INVOICE_PageIndexChange" 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" > DataKeyNames="UID, InvcBillNum" AllowSorting="true" IsDatabasePaging="true" >

2
SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx

@ -24,8 +24,6 @@
<f:Button ID="btnCheckSuccess" runat="server" Text="审核通过" OnClientClick="if(!confirm('是否要通过该发票申请?'))return false;" Icon="BulletTick" OnClick="btnCheckSuccess_Click"> <f:Button ID="btnCheckSuccess" runat="server" Text="审核通过" OnClientClick="if(!confirm('是否要通过该发票申请?'))return false;" Icon="BulletTick" OnClick="btnCheckSuccess_Click">
</f:Button> </f:Button>
<f:Button ID="btnReject" runat="server" Text="未处理退货" Icon="BulletCross" OnClick="btnReject_Click">
</f:Button>
<f:Button ID="btnCheckFail" runat="server" Text="审核退回" Icon="BulletCross" OnClick="btnCheckFail_Click"> <f:Button ID="btnCheckFail" runat="server" Text="审核退回" Icon="BulletCross" OnClick="btnCheckFail_Click">
</f:Button> </f:Button>
</Items> </Items>

15
SCP/Views/WarehouseData/SCP_INVOICE_CONFIRM_DETAIL.aspx.designer.cs

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.WarehouseData { namespace SCP.WarehouseData
{
public partial class SCP_INVOICE_CONFIRM_DETAIL { public partial class SCP_INVOICE_CONFIRM_DETAIL
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -66,15 +68,6 @@ namespace SCP.WarehouseData {
/// </remarks> /// </remarks>
protected global::FineUI.Button btnCheckSuccess; protected global::FineUI.Button btnCheckSuccess;
/// <summary>
/// btnReject 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnReject;
/// <summary> /// <summary>
/// btnCheckFail 控件。 /// btnCheckFail 控件。
/// </summary> /// </summary>

8
SCP/Views/WarehouseData/SCP_RECEIVE.aspx

@ -87,9 +87,9 @@
</f:Form> </f:Form>
</Items> </Items>
</f:GroupPanel> </f:GroupPanel>
<f:Grid ID="Grid_V_TB_RECEIVE" ShowBorder="true" ShowHeader="true" PageSize="20" BoxFlex="1" CssClass="maingrid" <f:Grid ID="Grid_V_TB_RECEIVE" ShowBorder="true" ShowHeader="true" PageSize="50" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,RecvBillNum,ErpRecvBillNum,State,Site,RecvBillNum,CreateTime" IsDatabasePaging="True" AllowPaging="True" EnableRowDoubleClickEvent="True" runat="server" DataKeyNames="UID,RecvBillNum,ErpRecvBillNum,State,Site,RecvBillNum,CreateTime" IsDatabasePaging="True" AllowPaging="True" EnableRowDoubleClickEvent="True"
OnRowDoubleClick="Grid1_OnRowDoubleClick" SortDirection="DESC" SortField="ShipTime" EnableCheckBoxSelect="True" OnRowDoubleClick="Grid1_OnRowDoubleClick" SortDirection="DESC" SortField="CreateUser" EnableCheckBoxSelect="True"
EnableRowSelectEvent="False" AutoScroll="True" OnPageIndexChange="Grid1_OnPageIndexChange"> EnableRowSelectEvent="False" AutoScroll="True" OnPageIndexChange="Grid1_OnPageIndexChange">
<PageItems> <PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
@ -98,10 +98,9 @@
</f:ToolbarText> </f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_OnSelectedIndexChanged" <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_OnSelectedIndexChanged"
runat="server"> runat="server">
<f:ListItem Text="10" Value="10" />
<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" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList> </f:DropDownList>
</PageItems> </PageItems>
<Columns> <Columns>
@ -120,6 +119,7 @@
<f:BoundField runat="server" HeaderText="地点" ColumnID="" DataField="Site_Desc" /> <f:BoundField runat="server" HeaderText="地点" ColumnID="" DataField="Site_Desc" />
<f:BoundField runat="server" HeaderText="类型" ColumnID="" DataField="BillType_DESC" /> <f:BoundField runat="server" HeaderText="类型" ColumnID="" DataField="BillType_DESC" />
<f:BoundField runat="server" HeaderText="审核员" ColumnID="" DataField="OperName" /> <f:BoundField runat="server" HeaderText="审核员" ColumnID="" DataField="OperName" />
<f:BoundField runat="server" HeaderText="收货员" ColumnID="" DataField="CreateUser" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" /> <f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" />
</Columns> </Columns>
</f:Grid> </f:Grid>

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

@ -97,7 +97,10 @@ namespace SCP.WarehouseData
_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 = CurrentUser.ChineseName;
}
SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_GG_List(_entity, (ret) => SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_GG_List(_entity, (ret) =>
{ {
if (ret.State == ReturnStatus.Succeed) if (ret.State == ReturnStatus.Succeed)
@ -310,42 +313,6 @@ namespace SCP.WarehouseData
protected void btnReject_Click(object sender, EventArgs e) protected void btnReject_Click(object sender, EventArgs e)
{ {
//ICollection<Role> Roles = CurrentUser.Roles;
//string strUserName = CurrentUser.ChineseName;
//List<int> listids = GetSelectedDataKeyIDs(Grid_V_TB_RECEIVE);
//if (listids.Count == 0)
//{
// PageContext.RegisterStartupScript(Alert.GetShowInParentReference("请勾选要报废的单据"));
// return;
//}
//var _ls = new List<string>();
//var _ls1 = new List<string>();
//int[] selections = Grid_V_TB_RECEIVE.SelectedRowIndexArray;
//for (int i = 0, count = Grid_V_TB_RECEIVE.Rows.Count; i < count; i++)
//{
// if (selections.Contains(i))
// {
// object[] rowDataKeys = Grid_V_TB_RECEIVE.DataKeys[i];
// _ls.Add(rowDataKeys[1] as string);
// var state= rowDataKeys[3].ToString();
// if(state!="0")
// {
// Alert.Show("只能选择状态为【收货状态】退货单据!");
// return;
// }
// }
//}
//if (_ls.Select(p => p.Contains("C.")).Count() > 0)
//{
// PageContext.RegisterStartupScript(Alert.GetShowInParentReference("只能报废退货单!"));
// return;
//}
//var ret = SCP_RECIVECE_CONTROLLER.Save_TB_RECEIVE_STATE(_ls, ReceiveState.Reject, strUserName);
//PageContext.RegisterStartupScript(Alert.GetShowInParentReference("报废成功"));
BindData(); BindData();
} }
} }

1
SCP/Views/WarehouseData/SCP_RECEIVE_DETAIL.aspx

@ -85,6 +85,7 @@
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="CurrencyCode" Width="200px" /> <f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="零件名称" ColumnID="CurrencyCode" Width="200px" />
<f:BoundField SortField="Unit" DataField="Unit" HeaderText="单位" ColumnID="Price" Width="80px" /> <f:BoundField SortField="Unit" DataField="Unit" HeaderText="单位" ColumnID="Price" Width="80px" />
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="PlanQty" Width="60px" /> <f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="PlanQty" 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="ShipQty" 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="ReceiveQty" Width="60px" />
</Columns> </Columns>

21
SCP/Views/WarehouseData/SCP_RECEIVE_DETAIL.aspx.cs

@ -64,7 +64,7 @@ namespace SCP.WarehouseData
public void BindData() public void BindData()
{ {
var _receive = new V_TB_RECEIVE_DETAIL(); var _receive = new V_TB_RECEIVE_DETAIL();
_receive.Remark =CurrentUser.UsedDomain; _receive.Site =CurrentUser.UsedDomain;
_receive.RecvBillNum = GetQueryValue("ID"); _receive.RecvBillNum = GetQueryValue("ID");
SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_DETAIL_List(_receive, (ret) => SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_DETAIL_List(_receive, (ret) =>
@ -128,7 +128,7 @@ namespace SCP.WarehouseData
{ {
var _receive = new V_TB_RECEIVE_DETAIL(); var _receive = new V_TB_RECEIVE_DETAIL();
_receive.RecvBillNum = GetQueryValue("ID"); _receive.RecvBillNum = GetQueryValue("ID");
_receive.Remark = CurrentUser.UsedDomain; _receive.Site = CurrentUser.UsedDomain;
SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_DETAIL_List(_receive, (ret) => SCP_RECIVECE_CONTROLLER.Get_V_TB_RECEIVE_DETAIL_List(_receive, (ret) =>
{ {
if (ret.State == ReturnStatus.Succeed) if (ret.State == ReturnStatus.Succeed)
@ -143,6 +143,7 @@ namespace SCP.WarehouseData
{ "PartDesc1", "零件名称" }, { "PartDesc1", "零件名称" },
{ "Unit", "单位" }, { "Unit", "单位" },
{ "Qty", "数量" }, { "Qty", "数量" },
{ "DockCode", "ERP库位" },
//{ "ReceivedQty", "已开票数量" }, //{ "ReceivedQty", "已开票数量" },
{ "ShipTime", "时间" }, { "ShipTime", "时间" },
{ "Remark", "备注" }, { "Remark", "备注" },
@ -173,13 +174,13 @@ namespace SCP.WarehouseData
var _rec = ret.Result.FirstOrDefault(); var _rec = ret.Result.FirstOrDefault();
if (CurrentUser.Name == "admin") if (CurrentUser.Name == "admin")
{ {
var asn = SCPDB.TB_RECEIVE.Where(p => p.RecvBillNum == _rec.RecvBillNum && p.Site==_rec.Site).FirstOrDefault(); var asn = SCPDB.TB_RECEIVE_QAD.Where(p => p.RecvBillNum == _rec.RecvBillNum && p.Site==_rec.Site).FirstOrDefault();
var detail = SCPDB.TB_RECEIVE_DETAIL.Where(p => p.RecvBillNum == _rec.RecvBillNum && p.Remark == _rec.Site).ToArray(); var detail = SCPDB.TB_RECEIVE_DETAIL_QAD.Where(p => p.RecvBillNum == _rec.RecvBillNum && p.Site == _rec.Site).ToArray();
if (asn != null) if (asn != null)
{ {
asn.State = -1; asn.State = -1;
asn.IsDeleted = true; asn.IsDeleted = true;
SCPDB.TB_RECEIVE.AddOrUpdate(asn); SCPDB.TB_RECEIVE_QAD.AddOrUpdate(asn);
} }
if (detail.Count() > 0) if (detail.Count() > 0)
{ {
@ -188,7 +189,7 @@ namespace SCP.WarehouseData
itm.IsDeleted = true; itm.IsDeleted = true;
itm.State = -1; itm.State = -1;
} }
SCPDB.TB_RECEIVE_DETAIL.AddOrUpdate(detail); SCPDB.TB_RECEIVE_DETAIL_QAD.AddOrUpdate(detail);
} }
if (SCPDB.SaveChanges() != -1) if (SCPDB.SaveChanges() != -1)
{ {
@ -220,13 +221,13 @@ namespace SCP.WarehouseData
Alert.Show("不能取消已经开票!"); Alert.Show("不能取消已经开票!");
return; return;
} }
var rec = SCPDB.TB_RECEIVE.Where(p => p.RecvBillNum == _rec.RecvBillNum && p.Site == _rec.Site).FirstOrDefault(); var rec = SCPDB.TB_RECEIVE_QAD.Where(p => p.RecvBillNum == _rec.RecvBillNum && p.Site == _rec.Site).FirstOrDefault();
var detail = SCPDB.TB_RECEIVE_DETAIL.Where(p => p.RecvBillNum == _rec.RecvBillNum && p.Remark == _rec.Site).ToArray(); var detail = SCPDB.TB_RECEIVE_DETAIL_QAD.Where(p => p.RecvBillNum == _rec.RecvBillNum && p.Remark == _rec.Site).ToArray();
if (rec != null) if (rec != null)
{ {
rec.State = 0; rec.State = 0;
rec.IsDeleted = false; rec.IsDeleted = false;
SCPDB.TB_RECEIVE.AddOrUpdate(rec); SCPDB.TB_RECEIVE_QAD.AddOrUpdate(rec);
} }
if (detail.Count() > 0) if (detail.Count() > 0)
{ {
@ -235,7 +236,7 @@ namespace SCP.WarehouseData
itm.IsDeleted = false; itm.IsDeleted = false;
itm.State = 0; itm.State = 0;
} }
SCPDB.TB_RECEIVE_DETAIL.AddOrUpdate(detail); SCPDB.TB_RECEIVE_DETAIL_QAD.AddOrUpdate(detail);
} }
if (SCPDB.SaveChanges() != -1) if (SCPDB.SaveChanges() != -1)
{ {

2
SCP/Views/WarehouseData/SCP_RECEIVE_DETAIL_VIEW.aspx.cs

@ -53,7 +53,7 @@ namespace SCP.WarehouseData
{ {
var _receive = new V_TB_RECEIVE_DETAIL(); var _receive = new V_TB_RECEIVE_DETAIL();
_receive.RecvBillNum = GetQueryValue("ID"); _receive.RecvBillNum = GetQueryValue("ID");
_receive.Remark = CurrentUser.UsedDomain; _receive.Site = CurrentUser.UsedDomain;
if (string.IsNullOrEmpty(Request["ID"].Trim())) if (string.IsNullOrEmpty(Request["ID"].Trim()))
{ {
if (!string.IsNullOrEmpty("PartCode")) if (!string.IsNullOrEmpty("PartCode"))

1
SCP/Views/沈阳金杯/Report/SCP_INCOMPLETE_ASK.aspx

@ -88,6 +88,7 @@
<f:BoundField runat="server" HeaderText="未发货数量" DataFormatString="{0:F0}" ColumnID="" DataField="Number" /> <f:BoundField runat="server" HeaderText="未发货数量" DataFormatString="{0:F0}" ColumnID="" DataField="Number" />
<f:BoundField runat="server" HeaderText="到货数量" DataFormatString="{0:F0}" ColumnID="" DataField="ArriveQty" /> <f:BoundField runat="server" HeaderText="到货数量" DataFormatString="{0:F0}" ColumnID="" DataField="ArriveQty" />
<f:BoundField runat="server" HeaderText="合格数量" DataFormatString="{0:F0}" ColumnID="" DataField="ReceivedQty" /> <f:BoundField runat="server" HeaderText="合格数量" DataFormatString="{0:F0}" ColumnID="" DataField="ReceivedQty" />
<f:BoundField runat="server" HeaderText="寄存数量" DataFormatString="{0:F0}" ColumnID="" DataField="DepositQty" />
<f:BoundField runat="server" HeaderText="在途数量" DataFormatString="{0:F0}" ColumnID="" DataField="OnRoadQty" /> <f:BoundField runat="server" HeaderText="在途数量" DataFormatString="{0:F0}" ColumnID="" DataField="OnRoadQty" />
<f:BoundField runat="server" HeaderText="退货数量" DataFormatString="{0:F0}" ColumnID="" DataField="RejectQty" /> <f:BoundField runat="server" HeaderText="退货数量" DataFormatString="{0:F0}" ColumnID="" DataField="RejectQty" />
<f:BoundField runat="server" HeaderText="已开票数量" DataFormatString="{0:F0}" ColumnID="" DataField="InvoiceQty" /> <f:BoundField runat="server" HeaderText="已开票数量" DataFormatString="{0:F0}" ColumnID="" DataField="InvoiceQty" />

132
SCP/Views/锦州锦恒/SupplierData/SCP_ASN.aspx

@ -0,0 +1,132 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ASN.aspx.cs" Inherits="SCP.锦州锦恒.SupplierData.SCP_ASN" %>
<!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="Button1" runat="server" EnablePostBack="True" Text="刷新" Icon="Add" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="BtnOutPut" runat="server" EnablePostBack="True" Text="导出" Icon="Add" OnClick="BtnOutPut_Click">
</f:Button>
<f:Button ID="btnDetail" runat="server" EnablePostBack="True" Text="明细" Icon="Add" OnClick="btnDetail_Click">
</f:Button>
<f:Button ID="btnNew" runat="server" EnablePostBack="True" Text="新建发货单" Icon="Add" OnClick="btnNew_Click">
</f:Button>
<%--<f:Button ID="btnDelete" runat="server" EnablePostBack="True" Text="删除" Icon="Add" OnClick="btnDelete_Click" Hidden="True">
</f:Button>--%>
<f:Button ID="btnShow" runat="server" Icon="Add" Text="显示查询面板" OnClick="btnShow_Click">
</f:Button>
<f:Button ID="btnPallet" runat="server" Icon="Add" Text="创建托盘" OnClick="btnPallet_Click" >
</f:Button>
<f:Button ID="btnPalletDetail" runat="server" Icon="Add" Text="查看托盘" OnClick="btnPalletDetail_Click" >
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ID="FormRow_1" Hidden="true">
<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" ID="FormRow_2">
<Items>
<f:TextBox ID="txtBill" runat="server" Label="发货单号"/>
<f:TextBox ID="TXT_VenderName" runat="server" Label="供应商"/>
<f:TextBox ID="TXT_ASK" runat="server" Label="看板编号" />
<f:TextBox ID="txtPO" runat="server" Label="订单编号" />
<f:TextBox ID="TXT_SubSite" runat="server" Label="子网站" Hidden="true" />
<f:TextBox ID="TXT_Extend1" runat="server" Label="子网站" Hidden="true" />
<f:TextBox ID="TXT_Extend2" runat="server" Label="子网站" Hidden="true" />
<f:TextBox ID="TXT_Extend3" runat="server" Label="子网站" Hidden="true" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3" Hidden="true">
<Items>
<f:Label runat="server" Label="发往地点" />
<f:TextBox ID="txtShipTosite" runat="server" />
<f:DatePicker ID="dateShip" runat="server" Required="True" Label="发货时间" />
<f:Label runat="server" Label="发货时间" />
<f:DatePicker ID="dateReceive" runat="server" Required="true" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_4">
<Items>
<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>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_ASN" ShowBorder="true" ShowHeader="true" 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"
IsDatabasePaging="true" AllowPaging="true" SortDirection="DESC" SortField="ShipTime"
AutoScroll="True" EnableRowDoubleClickEvent="True" OnRowDoubleClick="Grid_V_TB_ASN_RowDoubleClick" OnPageIndexChange="Grid_V_TB_ASN_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="10" />
<f:ListItem Text="40" Value="40" />
<f:ListItem Text="80" Value="80" />
<f:ListItem Text="100" Value="100" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width = "100px" DataField = "State_DESC" DataFormatString = "{0}" HeaderText = "状态" />
<f:BoundField runat="server" HeaderText="发货单号" ColumnID="" DataField="AsnBillNum" />
<f:BoundField runat="server" HeaderText="要货单号" ColumnID="" DataField="AskBillNum" />
<f:BoundField runat="server" HeaderText="车牌号" ColumnID="" DataField="PlateNumber" Hidden="false"></f:BoundField>
<f:BoundField runat="server" HeaderText="供应商" ColumnID="" DataField="VendName" />
<f:BoundField runat="server" HeaderText="订单号" ColumnID="" DataField="PoBillNum" />
<f:BoundField Width = "100px" DataField = "ShipTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "发货时间" Hidden="true" />
<f:BoundField Width = "100px" DataField = "ShipUser" DataFormatString = "{0}" HeaderText = "发货人" />
<f:BoundField Width = "100px" DataField = "ReceiveTime" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "收货时间" Hidden="true" />
<f:BoundField Width = "100px" DataField = "ReceiveUser" DataFormatString = "{0}" HeaderText = "收货人" />
<f:BoundField runat="server" HeaderText="发往地点" ColumnID="" DataField="Site_Desc" />
<f:BoundField runat="server" HeaderText="备注" ColumnID="" DataField="Remark" Hidden="true" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="发货明细" Target="Parent" EnableIFrame="true" CloseAction="HidePostBack"
IFrameUrl="about:blank" Height="600px" Width="1024px" AutoScroll="True" OnClose="Window1_Close" />
</form>
</body>
</html>

168
SCP/Views/锦州锦恒/SupplierData/SCP_ASN.aspx.cs

@ -0,0 +1,168 @@
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.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using System.Data;
namespace SCP..SupplierData
{
public partial class SCP_ASN : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
TranslatorAgents(Toolbar2);
TranslatorAgent(Grid_V_TB_ASN);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
TranslatorAgents(FormRow_4);
}
}
public void LoadData()
{
//if (!CurrentUser.RoleList.Contains("供应商"))
//{
// Alert.Show("当前用户角色不能操作模块!");
// return;
//}
if (CurrentUser.VenderList.Count == 0 && CurrentUser.Name!="admin")
{
Alert.Show("当前用户未分配供应商!");
return;
}
BindASN();
}
public void BindASN()
{
SearchV_TB_ASN((result) => {
Grid_V_TB_ASN.RecordCount = result.Count();
var list = SortAndPage<V_TB_ASN>(result, Grid_V_TB_ASN);
Grid_V_TB_ASN.DataSource = list;
Grid_V_TB_ASN.DataBind();
});
}
public void SearchV_TB_ASN(Action<IQueryable<V_TB_ASN>> p_action)
{
V_TB_ASN _entity = new V_TB_ASN();
_entity.IsDeleted = false;
_entity.VendId = TXT_VenderName.Text;
_entity.PoBillNum = this.txtPO.Text;
_entity.AsnBillNum = txtBill.Text;
_entity.AskBillNum = TXT_ASK.Text;
_entity.UserInVendIds = CurrentUser.VenderList;
_entity.UserInAddress = CurrentUser.FactoryList;
SCP_ASN_CONTROLLER.Get_V_TB_ASN_List(_entity, (_ret) => {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
protected void Grid_V_TB_ASN_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
{
object[] rowDataKeys = Grid_V_TB_ASN.DataKeys[e.RowIndex];
string AsnBillNum = rowDataKeys[1] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_ASN_DETAIL.aspx?AsnBillNum={0}", AsnBillNum)));
}
protected void BtnOutPut_Click(object sender, EventArgs e)
{
List<string> _ls = new List<string>();
SearchV_TB_ASN(rs => {
_ls=rs.Select(p => p.AsnBillNum).ToList();
DataSet ds = SCP_EXCEL_CONTROLLER.GET_ASN_EXECEL(_ls);
PageBase.DataSetToExcel(ds, "发货单");
});
//for (int i = 0, count = Grid_V_TB_ASN.Rows.Count; i < count; i++)
//{
// object[] rowDataKeys = Grid_V_TB_ASN.DataKeys[i];
// _ls.Add(rowDataKeys[1] as string);
//}
}
protected void btnDetail_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASN.SelectedRowIndexArray.Count() == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
object[] rowDataKeys = Grid_V_TB_ASN.DataKeys[Grid_V_TB_ASN.SelectedRowIndex];
string AsnBillNum = rowDataKeys[1] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../SupplierData/SCP_ASN_DETAIL.aspx?AsnBillNum={0}", AsnBillNum)));
}
protected void btnShow_Click(object sender, EventArgs e)
{
gp1.Hidden = false;
}
protected void btnClose_Click(object sender, EventArgs e)
{
gp1.Hidden = true;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindASN();
}
protected void Grid_V_TB_ASN_PageIndexChange(object sender, GridPageEventArgs e)
{
BindASN();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_ASN.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindASN();
}
protected void BtnOutPut_Click1(object sender, EventArgs e)
{
}
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference("../../SupplierData/SCP_ASK.aspx"));
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindASN();
}
protected void btnPallet_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASN.SelectedRowIndexArray.Count() == 0 )
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
object[] rowDataKeys = Grid_V_TB_ASN.DataKeys[Grid_V_TB_ASN.SelectedRowIndex];
string AsnBillNum = rowDataKeys[1] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../../SupplierData/SCP_PALLET_CREATE.aspx?AsnBillNum={0}", AsnBillNum)));
}
protected void btnPalletDetail_Click(object sender, EventArgs e)
{
if (Grid_V_TB_ASN.SelectedRowIndexArray.Count() == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
object[] rowDataKeys = Grid_V_TB_ASN.DataKeys[Grid_V_TB_ASN.SelectedRowIndex];
string AsnBillNum = rowDataKeys[1] as string;
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../../SupplierData/SCP_PALLET.aspx?AsnBillNum={0}", AsnBillNum)));
}
}
}

287
SCP/Views/锦州锦恒/SupplierData/SCP_ASN.aspx.designer.cs

@ -0,0 +1,287 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP..SupplierData
{
public partial class SCP_ASN
{
/// <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>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// BtnOutPut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnOutPut;
/// <summary>
/// btnDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDetail;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnNew;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// btnPallet 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnPallet;
/// <summary>
/// btnPalletDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnPalletDetail;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// ddl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddl;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// txtBill 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBill;
/// <summary>
/// TXT_VenderName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VenderName;
/// <summary>
/// TXT_ASK 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ASK;
/// <summary>
/// txtPO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtPO;
/// <summary>
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// txtShipTosite 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtShipTosite;
/// <summary>
/// dateShip 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker dateShip;
/// <summary>
/// dateReceive 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker dateReceive;
/// <summary>
/// FormRow_4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_4;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnClose;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// Grid_V_TB_ASN 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_ASN;
/// <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>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
}
}

184
SCP/Views/锦州锦恒/SupplierData/SCP_ASN_DETAIL.aspx

@ -0,0 +1,184 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ASN_DETAIL.aspx.cs" Inherits="SCP.锦州锦恒.SupplierData.SCP_ASN_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">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="btnRefresh" runat="server" EnablePostBack="True" Text="刷新" Icon="Add" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnSend" runat="server" EnablePostBack="True" Text="确认发货" Icon="Car" OnClick="btnSend_Click" OnClientClick="send();if(!confirm('是否要发货?一旦发货,就将不能删除和修改此发货单!'))return false;">
</f:Button>
<f:Button ID="btnPrint" runat="server" EnablePostBack="true" Text="打印发货单" Icon="Printer" OnClick="btnPrint_Click">
</f:Button>
<f:Button ID="btnPackage" runat="server" EnablePostBack="true" Text="修改发货单" Icon="CupEdit" OnClick="btnPackage_Click" Hidden="true" OnClientClick="if(!confirm('是否要作废?新建状态作废,数量批次填写错误可以作废,如果作废单据再用之前送货单发货,一律按退货处理!'))return false;"/>
<f:Button ID="btnCancel" runat="server" EnablePostBack="true" Text="作废发货单" Icon="Printer" OnClick="btnCancel_Click" OnClientClick="if(!confirm('是否要作废?新建状态作废,数量批次填写错误可以作废,如果作废单据再用之前送货单发货,一律按退货处理!'))return false;"/>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Form runat="server" Title="">
<Items>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%" ID="FormRow_1">
<Items>
<f:TextBox runat = "server" Label = "单据状态" EmptyText = "" ID = "TXT_StateDesc" />
<f:TextBox runat = "server" Label = "发货单号" EmptyText = "" ID = "TXT_AsnBillNum" />
<f:TextBox runat = "server" Label = "供应商" EmptyText = "" ID = "TXT_VendName" />
<f:TextBox runat = "server" Label = "收货地点" EmptyText = "" ID = "TXT_Site" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%" ID="FormRow_2">
<Items>
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="发货日期" EmptyText="请选择日期" ID="DP_ShipTime" />
<f:TextBox runat = "server" Label = "发货人" EmptyText = "" ID = "TXT_ShipUser" />
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="到货日期" EmptyText="请选择日期" ID="DP_ReceiveTime" />
<f:TextBox runat = "server" Label = "收货人" EmptyText = "" ID = "TXT_ReceiveUser" />
</Items>
</f:FormRow>
<f:FormRow runat="server" ID="FormRow_3">
<Items>
<f:TextBox runat = "server" Label = "车牌号" EmptyText = "" ID = "TXT_PlateNumber" />
<f:TextBox runat = "server" Label = "备注" EmptyText = "" ID = "TXT_Remark" />
</Items>
</f:FormRow>
</Items>
</f:Form>
<f:Toolbar runat="server">
<Items>
<f:Toolbar runat="server" ID="Toolbar1">
<Items>
<%-- <f:Button runat="server" ID="btnEdit" Text="修改" Icon="ApplicationEdit" OnClick="btnEdit_Click"></f:Button>
<f:Button runat="server" ID="btnDel" Text="删除" Icon="ApplicationDelete" OnClick="btnDel_OnClick"></f:Button>--%>
<f:Button runat="server" ID="btnCreateBarCode" Text="创建条码" Icon="Printer" OnClick="CreateBarCode_Click"></f:Button>
<f:Button runat="server" ID="btnSelectedBarCode" Text="打印全部条码" EnablePostBack="true" Icon="Printer" OnClick="btnSelectedBarCode_Click"></f:Button>
<f:Button runat="server" ID="btnOutputPallet" Text="导出或打印托盘" Icon="Printer" OnClick="btnOutputPallet_Click" Hidden="true"></f:Button>
<f:Button runat="server" ID="btnBarCodeList" Text="显示条码列表" Icon="Layers" OnClick="btnBarCodeList_Click"></f:Button>
<f:Button runat="server" ID="btnOutPut" Text="导出明细" Icon="PageExcel" OnClick="btnOutput_Click"></f:Button>
<f:TextBox runat = "server" Label = "模板规格" EmptyText = "" ID = "TXT_MarkType" Readonly="true" />
</Items>
</f:Toolbar>
</Items>
</f:Toolbar>
<f:Grid ID="Grid_V_TB_ASN_DETAIL" ShowBorder="true" ShowHeader="true" PageSize="500" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="UID,PoBillNum,PoLine,PartCode,PoUnit,LocUnit,Price,Currency,PackQty,UnConv,DockCode,State,Remark,CreateTime,CreateUser,UpdateTime,UpdateUser,UpdateInfo,IsDeleted,PartDesc1,CurrencyDesc,Site,VendName,PartDesc2,AsnBillNum,Qty,VendBatch,ProduceDate,Batch,VendId,AskBillNum,CanQty,Guid,ReceivedPort"
IsDatabasePaging="True" AllowPaging="True"
EnableRowSelectEvent="True" AutoScroll="True"
SortField="PartCode" SortDirection="DESC"
OnPageIndexChange="Grid_V_TB_ASN_DETAIL_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="1000" Value="1000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width = "80px" DataField = "AsnBillNum" DataFormatString = "{0}" HeaderText = "发货单号" />
<%-- <f:TemplateField HeaderText="标包数量" Width="80px">
<ItemTemplate>
<asp:TextBox ID="TXT_PackQty" runat="server" Width="60px" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"
Text='<%# Eval("PackQty") %>' MaxLength="6"></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField HeaderText="发货数量" Width="80px">
<ItemTemplate>
<asp:TextBox ID="TXT_Qty" runat="server" Width="60px" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"
Text='<%# Eval("Qty") %>' MaxLength="6"></asp:TextBox>
</ItemTemplate>
</f:TemplateField> --%>
<f:BoundField Width = "100px" DataField = "PackQty" DataFormatString = "{0:F}" HeaderText = "标包数量" />
<f:BoundField Width = "100px" DataField = "Qty" DataFormatString = "{0:F}" HeaderText = "发货数量" />
<f:BoundField Width = "100px" DataField = "PartCode" DataFormatString = "{0}" HeaderText = "零件编号" />
<f:BoundField Width = "100px" DataField = "VendPartCode" DataFormatString = "{0}" HeaderText = "供应商零件编号" />
<f:BoundField Width = "100px" DataField = "PartDesc1" DataFormatString = "{0}" HeaderText = "零件名称" />
<f:BoundField Width = "50px" DataField = "CurrencyDesc" DataFormatString = "{0}" HeaderText = "币种" />
<%--<f:BoundField Width = "100px" DataField = "Site" DataFormatString = "{0}" HeaderText = "收货地点" />--%>
<f:BoundField Width = "100px" DataField = "Batch" DataFormatString = "{0}" HeaderText = "批次" />
<f:BoundField Width = "100px" DataField = "VendBatch" DataFormatString = "{0}" HeaderText = "供应商批次" />
<f:BoundField Width = "100px" DataField = "ProduceDate" DataFormatString = "{0}" HeaderText = "生产日期" />
<f:BoundField Width = "100px" DataField = "EndTime" DataFormatString = "{0}" HeaderText = "到货截至日期" />
<f:BoundField Width = "50px" DataField = "PoUnit" DataFormatString = "{0}" HeaderText = "单位" />
<f:BoundField Width = "80px" DataField = "Price" DataFormatString = "{0}" HeaderText = "价格" Hidden="true"/>
<%-- <f:TemplateField HeaderText="供应商批次" Width="110px">
<ItemTemplate>
<asp:TextBox ID="TXT_VenBatch" runat="server" Width="100px"
Text='<%# Eval("VendBatch") %>' MaxLength="20"></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField HeaderText="生产日期" Width="110px">
<ItemTemplate>
<asp:TextBox ID="TXT_ProduceDate" runat="server" Width="100px"
Text='<%# Eval("ProduceDate") %>' MaxLength="30"></asp:TextBox>
</ItemTemplate>
</f:TemplateField>--%>
<f:BoundField Width = "100px" DataField = "State" DataFormatString = "{0}" HeaderText = "" Hidden="true" />
<f:BoundField SortField="ReceivedPort" DataField="ReceivedPort" HeaderText="收货口" ColumnID="ReceivedPort_Desc" />
<f:BoundField Width = "100px" DataField = "Remark" DataFormatString = "{0}" HeaderText = "备注" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="500px" Width="900px" />
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="选择标签规格" Target="Self" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px" OnClose="WindowUpload1_Close">
</f:Window>
</form>
<script>
var _btnSend = '<%= btnSend.ClientID %>';
function update(num) {
var secs = 60 * 5;
if (num == secs) {
$("#"+_btnSend).val("发货");
$("#"+_btnSend).attr("disabled", false);
}
else {
printnr = secs - num;
$("#" + _btnSend).val("发货中" + printnr + "秒");
$("#" + _btnSend).attr("disabled", true);
}
alert('3434');
}
function send()
{
for (i = 1; i <= 60 * 5; i++) {
window.setTimeout("update( " + i + ") ", i * 1000);
}
}
</script>
</body>
</html>

561
SCP/Views/锦州锦恒/SupplierData/SCP_ASN_DETAIL.aspx.cs

@ -0,0 +1,561 @@
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.ScpEntity;
using CK.SCP.Controller;
using System.Data;
using CK.SCP.Models.Enums;
using FineUI;
using CK.SCP.Utils;
using System.Data.Entity.Migrations;
namespace SCP..SupplierData
{
public partial class SCP_ASN_DETAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetV_TB_ASNData();
BindDetail();
SetRoleRule();
TranslatorAgents(Toolbar2);
TranslatorAgents(Toolbar1);
TranslatorAgent(Grid_V_TB_ASN_DETAIL);
TranslatorAgents(FormRow_1);
TranslatorAgents(FormRow_2);
TranslatorAgents(FormRow_3);
string openUrl = string.Format("SCP_SELECT_MAKE.aspx?select=<script>encodeURIComponent({0})</script>", TXT_MarkType.GetValueReference());
btnSelectedBarCode.OnClientClick = WindowUpload.GetSaveStateReference(TXT_MarkType.ClientID) + WindowUpload.GetShowReference(openUrl);
}
}
private void SetRoleRule()
{
IsPriceVisible(Grid_V_TB_ASN_DETAIL, "价格");
}
public void SearchV_TB_ASN_DETAILData(Action<IQueryable<V_TB_ASN_DETAIL>> p_action)
{
V_TB_ASN_DETAIL _entity = new V_TB_ASN_DETAIL();
_entity.AsnBillNum= Request["AsnBillNum"];
SCP_ASN_CONTROLLER.Get_V_TB_ASN_DETAIL_List(_entity, (_ret) => {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
public void GetV_TB_ASNData()
{
V_TB_ASN _entity = new V_TB_ASN();
_entity.AsnBillNum = Request["AsnBillNum"];
_entity.UserInVendIds = CurrentUser.VenderList;
_entity.UserInAddress= CurrentUser.FactoryList;
SCP_ASN_CONTROLLER.Get_V_TB_ASN_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
var _result = _ret.Result.FirstOrDefault();
Session["Asn"] = _result;
TXT_AsnBillNum.Text = _result.AsnBillNum;
TXT_PlateNumber.Text = _result.PlateNumber;
TXT_ReceiveUser.Text = _result.ReceiveUser;
TXT_ShipUser.Text = _result.ShipUser;
TXT_Site.Text = _result.Site_Desc;
TXT_Remark.Text = _result.Remark;
TXT_VendName.Text = _result.VendName;
DP_ReceiveTime.SelectedDate = _result.ReceiveTime;
DP_ShipTime.SelectedDate = _result.ShipTime;
TXT_StateDesc.Text = _result.State_DESC;
}
SCP_BARCODE_CONTROLLER.Get_TS_BARCODE_List(new TS_BARCODE() { BillNum= TXT_AsnBillNum.Text.Trim() }, retobj => {
if (retobj.State == ReturnStatus.Succeed)
{
if (retobj.Result.Count() > 0)
{
this.btnCreateBarCode.Enabled = false;
}
else
{
this.btnCreateBarCode.Enabled = true;
}
}
});
});
}
public void BindDetail()
{
SearchV_TB_ASN_DETAILData((ret) => {
Grid_V_TB_ASN_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_ASN_DETAIL>(ret, Grid_V_TB_ASN_DETAIL);
Grid_V_TB_ASN_DETAIL.DataSource = list;
Grid_V_TB_ASN_DETAIL.DataBind();
});
}
protected void btnOutput_Click(object sender, EventArgs e)
{
List<V_TB_ASN_DETAIL> _ls = new List<V_TB_ASN_DETAIL>();
for (int i = 0, count = Grid_V_TB_ASN_DETAIL.Rows.Count; i < count; i++)
{
V_TB_ASN_DETAIL inv = new V_TB_ASN_DETAIL();
object[] rowDataKeys = Grid_V_TB_ASN_DETAIL.DataKeys[i];
if (rowDataKeys[24] != null)
{
inv.AsnBillNum = rowDataKeys[24].ToString();//发货单号
}
if (rowDataKeys[8] != null)
{
inv.PackQty = decimal.Parse(rowDataKeys[8].ToString());//标包数量
}
if (rowDataKeys[25] != null)
{
inv.Qty = decimal.Parse(rowDataKeys[25].ToString());//发货数量
}
inv.PartCode = rowDataKeys[3].ToString();//零件编号
if (rowDataKeys[19] != null)
{
inv.PartDesc1 = rowDataKeys[19].ToString();//零件名称
}
if (rowDataKeys[20] != null)
{
inv.CurrencyDesc = rowDataKeys[20].ToString();//货种
}
if (rowDataKeys[28] != null)
{
inv.Batch = rowDataKeys[28].ToString();//批次
}
if (rowDataKeys[26] != null)
{
inv.VendBatch = rowDataKeys[26].ToString();//供应商批次
}
if (rowDataKeys[27] != null)
{
inv.ProduceDate = DateTime.Parse(rowDataKeys[27].ToString());//生产日期
}
//if (rowDataKeys[26] != null)
//{
// inv.EndTime = DateTime.Parse(rowDataKeys[34].ToString());//到货截至日期
//}
inv.PoUnit = rowDataKeys[4].ToString();//采购单位
// if (rowDataKeys[6] != null)
// {
// inv.Price = decimal.Parse(rowDataKeys[6].ToString());//价格
// }
// if (rowDataKeys[34] != null)
//{
// inv.ReceivedPort_Desc = rowDataKeys[34].ToString();//收货口
//}
_ls.Add(inv);
}
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "AsnBillNum", "发货单号" },
{ "PackQty", "标包数量" },
{ "Qty", "发货数量" },
{ "PartCode", "零件编号" },
{ "PartDesc1", "零件名称" },
{ "Batch", "批次" },
{ "VendBatch", "供应商批次" },
{ "ProduceDate", "生产日期" },
{ "EndTime", "到货截至日期" },
{ "PoUnit", "单位" }
};
string url = EntityListToExcel2003(cellheader, _ls, "发货明细");
}
protected void btnCreate_Click(object sender, EventArgs e)
{
BindDetail();
}
protected void btnEdit_Click(object sender, EventArgs e)
{
var _asn=Session["Asn"] as V_TB_ASN;
if (_asn == null)
{
Alert.Show("发货订单信息不能为空!");
}
List<V_TB_ASN_DETAIL> _list = new List<V_TB_ASN_DETAIL>();
for (int i = 0, count = Grid_V_TB_ASN_DETAIL.Rows.Count; i < count; i++)
{
GridRow row = Grid_V_TB_ASN_DETAIL.Rows[i];
V_TB_ASN_DETAIL _entity = new V_TB_ASN_DETAIL();
object[] rowDataKeys = Grid_V_TB_ASN_DETAIL.DataKeys[i];
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.PoBillNum = rowDataKeys[1] as string;
_entity.PoLine = ConvertHelper.To<Int32>(rowDataKeys[2]);
_entity.PartCode = rowDataKeys[3] as string;
_entity.PoUnit = rowDataKeys[4] as string;
_entity.LocUnit = rowDataKeys[5] as string;
_entity.Price = ConvertHelper.To<Decimal>(rowDataKeys[6]);
_entity.Currency = rowDataKeys[7] as string;
_entity.PackQty = ConvertHelper.To<Decimal>(rowDataKeys[8]);
_entity.UnConv = ConvertHelper.To<Decimal>(rowDataKeys[9]);
_entity.DockCode = rowDataKeys[10] as string;
_entity.State = ConvertHelper.To<int?>(rowDataKeys[11]);
_entity.Remark = rowDataKeys[12] as string;
_entity.CreateTime = ConvertHelper.To<DateTime>(rowDataKeys[13]);
_entity.CreateUser = rowDataKeys[14] as string;
_entity.UpdateTime = ConvertHelper.To<DateTime>(rowDataKeys[15]);
_entity.UpdateUser = rowDataKeys[16] as string;
_entity.UpdateInfo = rowDataKeys[17] as string;
_entity.IsDeleted = ConvertHelper.To<Boolean>(rowDataKeys[18]);
_entity.PartDesc1 = rowDataKeys[19] as string;
_entity.CurrencyDesc = rowDataKeys[20] as string;
_entity.Site = rowDataKeys[21] as string;
_entity.VendName = rowDataKeys[22] as string;
_entity.PartDesc2 = rowDataKeys[23] as string;
_entity.AsnBillNum = rowDataKeys[24] as string;
_entity.Qty = ConvertHelper.To<Decimal>(rowDataKeys[25]);
_entity.VendBatch = rowDataKeys[26] as string;
_entity.Batch = rowDataKeys[28] as string;
_entity.VendId = rowDataKeys[29] as string;
System.Web.UI.WebControls.TextBox TXT_VenBatch = (System.Web.UI.WebControls.TextBox)row.FindControl("TXT_VenBatch");
System.Web.UI.WebControls.TextBox TXT_PackQty = (System.Web.UI.WebControls.TextBox)row.FindControl("TXT_PackQty");
System.Web.UI.WebControls.TextBox TXT_Qty = (System.Web.UI.WebControls.TextBox)row.FindControl("TXT_Qty");
System.Web.UI.WebControls.TextBox TXT_ProduceDate = (System.Web.UI.WebControls.TextBox)row.FindControl("TXT_ProduceDate");
_entity.VendBatch= TXT_VenBatch.Text;
if (string.IsNullOrEmpty(TXT_ProduceDate.Text))
{
Alert.Show("包装量填写错误!");
return;
}
else
{
_entity.ProduceDate =DateTime.Parse(TXT_ProduceDate.Text);
}
_list.Add(_entity);
}
if (_list.Count > 0)
{
var _first = _list.FirstOrDefault();
if (_first.State != (int)AsnState.New)
{
Alert.Show("不是新建状态,不能保存信息!");
}
}
}
protected void btnRefresh_Click(object sender, EventArgs e)
{
}
private List<V_TB_ASN_DETAIL> GetSelectedList()
{
List<V_TB_ASN_DETAIL> _list = new List<V_TB_ASN_DETAIL>();
int _flag = 0;
for (int i = 0, count = Grid_V_TB_ASN_DETAIL.Rows.Count; i < count; i++)
{
GridRow row = Grid_V_TB_ASN_DETAIL.Rows[i];
V_TB_ASN_DETAIL _entity = new V_TB_ASN_DETAIL();
object[] rowDataKeys = Grid_V_TB_ASN_DETAIL.DataKeys[i];
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.PoBillNum = rowDataKeys[1] as string;
_entity.PoLine = ConvertHelper.To<Int32>(rowDataKeys[2]);
_entity.PartCode = rowDataKeys[3] as string;
_entity.PoUnit = rowDataKeys[4] as string;
_entity.LocUnit = rowDataKeys[5] as string;
_entity.Price = ConvertHelper.To<Decimal>(rowDataKeys[6]);
_entity.Currency = rowDataKeys[7] as string;
_entity.PackQty = ConvertHelper.To<Decimal>(rowDataKeys[8]);
_entity.UnConv = ConvertHelper.To<Decimal>(rowDataKeys[9]);
_entity.DockCode = rowDataKeys[10] as string;
_entity.State = ConvertHelper.To<int>(rowDataKeys[11]);
_entity.Remark = rowDataKeys[12] as string;
_entity.CreateTime = ConvertHelper.To<DateTime>(rowDataKeys[13]);
_entity.CreateUser = rowDataKeys[14] as string;
_entity.UpdateTime = ConvertHelper.To<DateTime?>(rowDataKeys[15]);
_entity.UpdateUser = rowDataKeys[16] as string;
_entity.UpdateInfo = rowDataKeys[17] as string;
_entity.IsDeleted = ConvertHelper.To<Boolean>(rowDataKeys[18]);
_entity.PartDesc1 = rowDataKeys[19] as string;
_entity.CurrencyDesc = rowDataKeys[20] as string;
_entity.Site = rowDataKeys[21] as string;
_entity.VendName = rowDataKeys[22] as string;
_entity.PartDesc2 = rowDataKeys[23] as string;
_entity.AsnBillNum = rowDataKeys[24] as string;
_entity.Qty = ConvertHelper.To<Decimal>(rowDataKeys[25]);
_entity.VendBatch = rowDataKeys[26] as string;
_entity.ProduceDate = ConvertHelper.To<DateTime>(rowDataKeys[27]);
_entity.Batch = rowDataKeys[28] as string;
_entity.VendId = rowDataKeys[29] as string;
_entity.Guid=ConvertHelper.To<Guid>(rowDataKeys[29]);
_list.Add(_entity);
}
if (_flag == 1)
{ _list = new List<V_TB_ASN_DETAIL>(); }
return _list;
}
protected void btnSend_Click(object sender, EventArgs e)
{
var _asn = Session["Asn"] as V_TB_ASN;
if (_asn == null)
{
Alert.Show("发货订单信息不能为空!");
}
var _list = GetSelectedList();
if (_list.Count > 0)
{
var _first = _list.FirstOrDefault();
if (_first.State != (int)AsnState.New)
{
Alert.Show("不是新建状态,不能保存信息!");
}
else
{
var result=SCP_BARCODE_CONTROLLER.Get_TB_PRINT_COUNT_List(new TB_PRINT_COUNT() { BillNo=_asn.AsnBillNum });
if (result.State == ReturnStatus.Succeed)
{
if (result.Result.Count(p => p.PrintType == (int)PrintType.ASN) == 0)
{
Alert.Show(_asn.AsnBillNum + "发货单未打印!");
return;
}
if (result.Result.Count(p => p.PrintType == (int)PrintType.BAR_CODE) == 0)
{
Alert.Show(_asn.AsnBillNum + "标签未打印!");
return;
}
}
var check = SCP_ASN_CONTROLLER.Get_TS_UNI_API(_asn);
if(check.State == ReturnStatus.Failed)
{
Alert.Show(_asn.AsnBillNum + "请勿重复提交数据!");
return;
}
var ret = SCP_ASN_CONTROLLER.Save_TB_ASN_DETAIL(_asn, _list);
if (ret.State == ReturnStatus.Succeed)
{
SET_ASN_STATE("发货成功", AsnState.Ship);
GetV_TB_ASNData();
BindDetail();
}
else
{
Alert.Show(string.Join("\n\r", ret.MessageList.ToArray()));
}
}
}
}
private void SET_ASN_STATE(string p_msg, AsnState p_state)
{
if (Session["Asn"] != null)
{
if (CurrentUser.Name == "admin")
{
if (p_state == AsnState.Reject)
{
var _asn = Session["Asn"] as V_TB_ASN;
var asn = SCPDB.TB_ASN.Where(p => p.AsnBillNum == _asn.AsnBillNum).FirstOrDefault();
var detail = SCPDB.TB_ASN_DETAIL.Where(p => p.AsnBillNum == _asn.AsnBillNum).ToArray();
if (asn != null)
{
asn.State = -1;
asn.IsDeleted = true;
SCPDB.TB_ASN.AddOrUpdate(asn);
}
if (detail.Count() > 0)
{
foreach (var itm in detail)
{
itm.IsDeleted = true;
itm.State = -1;
}
SCPDB.TB_ASN_DETAIL.AddOrUpdate(detail);
}
if (SCPDB.SaveChanges() != -1)
{
Alert.Show("发货单删除成功");
}
}
}
else
{
var _ask = Session["Asn"] as V_TB_ASN;
var ret = SCP_ASN_CONTROLLER.Save_TB_ASN_STATE(new List<string>() { _ask.AsnBillNum }, p_state);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show(p_msg);
}
else
{
Alert.Show(ret.Message);
}
}
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
SET_ASN_STATE("发货单作废成功", AsnState.Reject);
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_ASN_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail();
}
protected void Grid_V_TB_ASN_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
{
BindDetail();
}
protected void CreateBarCode_Click(object sender, EventArgs e)
{
var _list=GetSelectedList();
if (_list.Count > 0)
{
btnCreateBarCode.Enabled = false;
var ret=SCP_ASN_CONTROLLER.Save_TB_CREATE_BARCODE(_list);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("条码创建成功!");
}
else
{
btnCreateBarCode.Enabled = true;
Alert.Show(string.Join("<BR>", ret.MessageList.ToArray()));
}
}
}
protected void btnBarCodeList_Click(object sender, EventArgs e)
{
try
{
string AsnBillNum = Request["AsnBillNum"];
string script = Window1.GetShowReference("SCP_SHIP_DETAIL_BARCODE.aspx?BillNo=" + AsnBillNum, "条码列表");
PageContext.RegisterStartupScript(script);
}
catch (Exception ex)
{
Alert.Show(ex.Message);
}
}
protected void SelectedBarCode_Click(object sender, EventArgs e)
{
}
protected void btnPrint_Click(object sender, EventArgs e)
{
string AsnBillNum = Request["AsnBillNum"];
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=SendBill&data=102&type=pdf&filename=SendBill.pdf&AsnBillNum={0}&open=\")", AsnBillNum);
PageContext.RegisterStartupScript(str);
SCP_BARCODE_CONTROLLER.Save_TB_PRINT_COUNT(new TB_PRINT_COUNT() { BillNo = AsnBillNum, PrintType = (int)PrintType.ASN});
}
protected void btnSelectedBarCode_Click(object sender, EventArgs e)
{
string openUrl = string.Format("SCP_SELECT_MAKE.aspx?select={0}", HttpUtility.UrlEncode(TXT_MarkType.Text));
PageContext.RegisterStartupScript(WindowUpload.GetSaveStateReference(TXT_MarkType.ClientID) + WindowUpload.GetShowReference(openUrl));
}
protected void btnOutputPallet_Click(object sender, EventArgs e)
{
#region 计算托盘数量和发货数量是否相等
SearchV_TB_ASN_DETAILData((ret) => {
var _asn = Session["Asn"] as V_TB_ASN;
if (_asn == null)
{
Alert.Show("发货单不存在!");
return;
}
var _ls=SCP_ASN_CONTROLLER.Get_CAN_PALLET_QTY(ret.ToList());
var _errList = new List<string>();
_ls.ForEach(p => {
if(p.CanQty>0)
{
_errList.Add(string.Format("编号:{0}名称:{1},托盘数量总和小于发货单数量",p.PartCode,(p.PartDesc1+p.PartDesc2)));
}
});
if (_errList.Count > 0)
{
Alert.Show(string.Join("<BR>", _errList.ToArray()));
return;
}
List<string> _list = new List<string>();
_list.Add(_asn.AsnBillNum);
DataSet ds = SCP_EXCEL_CONTROLLER.GET_PALLET_EXECEL(_list);
PageBase.DataSetToExcel(ds, "打印导出托盘!");
});
#endregion
}
protected void btnPackage_Click(object sender, EventArgs e)
{
}
protected void WindowUpload1_Close(object sender, WindowCloseEventArgs e)
{
if(string.IsNullOrEmpty(TXT_MarkType.Text))
{
Alert.Show("没有选择标签模板!");
return;
}
string AsnBillNum = Request["AsnBillNum"];
if (!string.IsNullOrEmpty(AsnBillNum))
{
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report={1}&data=101&type=pdf&filename=标签.pdf&AsnBillNum={0}&open=\")", AsnBillNum, TXT_MarkType.Text);
PageContext.RegisterStartupScript(str);
}
SCP_BARCODE_CONTROLLER.Save_TB_PRINT_COUNT(new TB_PRINT_COUNT() { BillNo = AsnBillNum, PrintType = (int)PrintType.BAR_CODE });
TXT_MarkType.Text = "";
}
}
}

323
SCP/Views/锦州锦恒/SupplierData/SCP_ASN_DETAIL.aspx.designer.cs

@ -0,0 +1,323 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP..SupplierData
{
public partial class SCP_ASN_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>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// btnRefresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRefresh;
/// <summary>
/// btnSend 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSend;
/// <summary>
/// btnPrint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnPrint;
/// <summary>
/// btnPackage 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnPackage;
/// <summary>
/// btnCancel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCancel;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// TXT_StateDesc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_StateDesc;
/// <summary>
/// TXT_AsnBillNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_AsnBillNum;
/// <summary>
/// TXT_VendName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendName;
/// <summary>
/// TXT_Site 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Site;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// DP_ShipTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_ShipTime;
/// <summary>
/// TXT_ShipUser 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ShipUser;
/// <summary>
/// DP_ReceiveTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_ReceiveTime;
/// <summary>
/// TXT_ReceiveUser 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_ReceiveUser;
/// <summary>
/// FormRow_3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_3;
/// <summary>
/// TXT_PlateNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PlateNumber;
/// <summary>
/// TXT_Remark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_Remark;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// btnCreateBarCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCreateBarCode;
/// <summary>
/// btnSelectedBarCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSelectedBarCode;
/// <summary>
/// btnOutputPallet 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutputPallet;
/// <summary>
/// btnBarCodeList 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnBarCodeList;
/// <summary>
/// btnOutPut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutPut;
/// <summary>
/// TXT_MarkType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_MarkType;
/// <summary>
/// Grid_V_TB_ASN_DETAIL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_ASN_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>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

38
SCP/Views/锦州锦恒/SupplierData/SCP_SELECT_MAKE.aspx

@ -0,0 +1,38 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_SELECT_MAKE.aspx.cs" Inherits="SCP.Views.锦州锦恒.SupplierData.SCP_SELECT_MAKE" %>
<!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" ID="PageManager1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="Fit" ShowBorder="false" ShowHeader="false" BodyPadding="5px">
<Toolbars>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:Button ID="btnClose" Text="关闭" runat="server" Icon="SystemClose" OnClick="btnClose_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:SimpleForm ID="SimpleForm1" runat="server" ShowBorder="false" ShowHeader="false" LabelAlign="Top" Title="标签规格" BodyPadding="5px" EnableCollapse="true">
<Items>
<f:RadioButtonList ID="RadioButtonList1" Label="请选择标签规格" runat="server" ColumnNumber="3" ShowRedStar="true" AutoPostBack="true" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged" >
<f:RadioItem Text="A4-4" Value="Material-A4-4"/>
<f:RadioItem Text="A4-10" Value="Material-A4-10"/>
<f:RadioItem Text="lbl-5437" Value="Material-lbl-5437"/>
<f:RadioItem Text="lbl-7035" Value="Material-lbl-7035"/>
<f:RadioItem Text="lbl-8652" Value="Material-lbl-8652"/>
</f:RadioButtonList>
</Items>
</f:SimpleForm>
</Items>
</f:Panel>
</form>
</body>
</html>

33
SCP/Views/锦州锦恒/SupplierData/SCP_SELECT_MAKE.aspx.cs

@ -0,0 +1,33 @@
using CK.SCP.Controller;
using CK.SCP.Models.Enums;
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..SupplierData
{
public partial class SCP_SELECT_MAKE : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
protected void btnClose_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(FineUI.ActiveWindow.GetHidePostBackReference());
}
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(RadioButtonList1.SelectedValue)+ActiveWindow.GetHidePostBackReference());
}
}
}

80
SCP/Views/锦州锦恒/SupplierData/SCP_SELECT_MAKE.aspx.designer.cs

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

64
SCP/Views/锦州锦恒/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx

@ -0,0 +1,64 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_SHIP_DETAIL_BARCODE.aspx.cs" Inherits="SCP.Views.锦州锦恒.SupplierData.SCP_SHIP_DETAIL_BARCODE" %>
<!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" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<Items>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnRefresh" runat="server" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnOutput" runat="server" Text="导出" OnClick="btnOutput_Click" Icon="PageExcel" >
</f:Button>
<f:Button ID="btnPrintRe" runat="server" Text="补打条码" OnClick="btnPrintRe_Click" Icon="Printer">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:TextBox ID="txtKeyword" runat="server" Label="" Text="">
</f:TextBox>
<f:Button ID="btnSearch" runat="server" Text="快速查找" OnClick="btnSearch_Click" Icon="SystemSearch">
</f:Button>
<f:TextBox runat = "server" Label = "模板规格" EmptyText = "" ID = "TXT_MarkType" Readonly="true" />
<f:ToolbarText ID="ToolbarText1" runat="server" Text="&nbsp;&nbsp;">
</f:ToolbarText>
</Items>
</f:Toolbar>
<f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="true" ShowHeader="False"
AllowPaging="True" PageSize="100" OnPageIndexChange="Grid1_PageIndexChange"
ShowBorder="False" AutoScroll="true"
DataKeyNames="UID,BarCode" AllowSorting="true" IsDatabasePaging="true" >
<Columns>
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" />
<f:BoundField SortField="BarCode" DataField="BarCode" HeaderText="条码" ColumnID="BarCode" Width="100" />
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode"/>
<f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" ColumnID="ProductName" Width="300px"/>
<f:BoundField SortField="Batch" DataField="Batch" HeaderText="批次" ColumnID="Batch"/>
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="Qty"/>
<f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="标包数量" ColumnID="PackageQty"/>
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="选择标签规格" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px" OnClose="WindowUpload1_Close">
</f:Window>
</form>
</body>
</html>

130
SCP/Views/锦州锦恒/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.cs

@ -0,0 +1,130 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using FineUI;
namespace SCP.Views..SupplierData
{
public partial class SCP_SHIP_DETAIL_BARCODE : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TranslatorAgents(Toolbar1);
TranslatorAgent(Grid1);
BindData();
string openUrl = string.Format("SCP_SELECT_MAKE.aspx?select=<script>encodeURIComponent({0})</script>", TXT_MarkType.GetValueReference());
btnPrintRe.OnClientClick = WindowUpload.GetSaveStateReference(TXT_MarkType.ClientID) + WindowUpload.GetShowReference(openUrl);
}
}
public void BindData()
{
Search(ret => {
Grid1.RecordCount = ret.Count();
Grid1.DataSource = ret.ToList();
Grid1.DataBind();
});
}
public void Search(Action<IQueryable<TS_BARCODE>> p_action)
{
string billnum = GetQueryValue("BillNo");
TS_BARCODE _code = new TS_BARCODE();
_code.BillNum = billnum;
if (!string.IsNullOrEmpty(txtKeyword.Text))
{
_code.PartCode = txtKeyword.Text;
}
SCP_BARCODE_CONTROLLER.Get_TS_BARCODE_List(_code, ret => {
if (ret.State == ReturnStatus.Succeed)
{
p_action(ret.Result);
}
});
}
//查询
protected void btnSearch_OnClick(object sender, EventArgs e)
{
BindData();
}
//导出
protected void btnOutput_Click(object sender, EventArgs e)
{
string billnum = GetQueryValue("BillNo");
TS_BARCODE _code = new TS_BARCODE();
_code.BillNum = billnum;
SCP_BARCODE_CONTROLLER.Get_TS_BARCODE_List(_code, ret =>
{
if (ret.State == ReturnStatus.Succeed)
{
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "BarCode", "包装箱码" },
{ "Qty", "数量" },
{ "PartCode", "零件编号" },
{ "PartDesc", "零件名称" },
{ "Batch", "批次" },
{ "VendBatch", "供应商批次" },
{ "ProduceDate", "生产日期" },
{ "PoUnit", "单位" }
};
string url = EntityListToExcel2003(cellheader, ret.Result.ToList(), "条码明细");
}
});
}
//补打条码
protected void btnPrintRe_Click(object sender, EventArgs e)
{
string openUrl = string.Format("SCP_SELECT_MAKE.aspx?select={0}", HttpUtility.UrlEncode(TXT_MarkType.Text));
PageContext.RegisterStartupScript(WindowUpload.GetSaveStateReference(TXT_MarkType.ClientID) + WindowUpload.GetShowReference(openUrl));
}
//查询
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindData();
}
protected void WindowUpload1_Close(object sender, WindowCloseEventArgs e)
{
if (string.IsNullOrEmpty(TXT_MarkType.Text))
{
Alert.Show("没有选择标签模板!");
return;
}
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={1}&data=101&type=pdf&filename=标签.pdf&Barcode={0}&open=\")", string.Join("_", _ls.ToArray()), TXT_MarkType.Text);
PageContext.RegisterStartupScript(str);
TXT_MarkType.Text = "";
}
}
}

161
SCP/Views/锦州锦恒/SupplierData/SCP_SHIP_DETAIL_BARCODE.aspx.designer.cs

@ -0,0 +1,161 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..SupplierData
{
public partial class SCP_SHIP_DETAIL_BARCODE
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// btnRefresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRefresh;
/// <summary>
/// ToolbarSeparator2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// btnPrintRe 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnPrintRe;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarFill ToolbarFill1;
/// <summary>
/// txtKeyword 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtKeyword;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSearch;
/// <summary>
/// TXT_MarkType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_MarkType;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
}
}

11
SCP/Web.config

@ -55,7 +55,7 @@
<add key="SCPDbServer" value="." /> <add key="SCPDbServer" value="." />
<add key="SCPDbPort" value="1433" /> <add key="SCPDbPort" value="1433" />
<add key="SCPDbName" value="ChangKeTecSCP" /> <add key="SCPDbName" value="ChangKeTecSCP" />
<add key="SCP_TIME_OUT" value="60" /> <add key="SCP_TIME_OUT" value="120"/>
</appSettings> </appSettings>
<FineUI DebugMode="false" Theme="Gray" /> <FineUI DebugMode="false" Theme="Gray" />
@ -76,6 +76,8 @@
<add verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI" validate="false" /> <add verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI" validate="false" />
</httpHandlers> </httpHandlers>
<!-- <httpRuntime maxRequestLength="102400 " />--> <!-- <httpRuntime maxRequestLength="102400 " />-->
<httpRuntime executionTimeout="120" maxRequestLength="204800" useFullyQualifiedRedirectUrl="false"
minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="false"/>
<customErrors mode="Off" /> <customErrors mode="Off" />
<authentication mode="Forms"> <authentication mode="Forms">
<forms name=".APPBOX_FORMS_AUTH" loginUrl="~/Default.aspx" timeout="3" defaultUrl="~/main.aspx" protection="All" path="/" /> <forms name=".APPBOX_FORMS_AUTH" loginUrl="~/Default.aspx" timeout="3" defaultUrl="~/main.aspx" protection="All" path="/" />
@ -89,7 +91,7 @@
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies> </assemblies>
</compilation> </compilation>
<httpRuntime /> <!--<httpRuntime/>-->
<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"> <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
<namespaces> <namespaces>
<add namespace="System.Web.Optimization" /> <add namespace="System.Web.Optimization" />
@ -155,7 +157,10 @@
<!--IIS7集成管道模式--> <!--IIS7集成管道模式-->
<system.webServer> <system.webServer>
<security> <security>
<requestFiltering allowDoubleEscaping="true" /> <!--<requestFiltering allowDoubleEscaping="true"/>-->
<requestFiltering allowDoubleEscaping="true">
<requestLimits maxAllowedContentLength="2147483647" ></requestLimits>
</requestFiltering>
</security> </security>
<validation validateIntegratedModeConfiguration="false" /> <validation validateIntegratedModeConfiguration="false" />
<modules> <modules>

Loading…
Cancel
Save