lvzb
4 years ago
181 changed files with 9933 additions and 6546 deletions
@ -0,0 +1,524 @@ |
|||||
|
using System; |
||||
|
using System.Linq; |
||||
|
using CK.SCP.Models.Enums; |
||||
|
using CK.SCP.Models.ScpEntity; |
||||
|
using CK.SCP.Utils; |
||||
|
using CK.SCP.Models; |
||||
|
using System.Data; |
||||
|
using System.Data.Entity.Core; |
||||
|
using System.Text; |
||||
|
using CK.SCP.Models.ScpEntity.ExcelExportEnttity; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Data.Entity.Migrations; |
||||
|
|
||||
|
namespace CK.SCP.Controller |
||||
|
{ |
||||
|
public class SCP_MoldSharing_Controller |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 获取模具分摊列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="p_entity"></param>
|
||||
|
/// <param name="p_action"></param>
|
||||
|
public static void Get_V_TA_MoldSharing_List(TA_MOLDSHARING p_entity, Action<ResultObject<IQueryable<TA_MOLDSHARING>>> p_action) |
||||
|
{ |
||||
|
ResultObject<IQueryable<TA_MOLDSHARING>> _ret = new ResultObject<IQueryable<TA_MOLDSHARING>>(); |
||||
|
try |
||||
|
{ |
||||
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
||||
|
{ |
||||
|
IQueryable<TA_MOLDSHARING> q = db.TA_MoldSharing; |
||||
|
if (p_entity.UID!=0) |
||||
|
{ |
||||
|
q = q.Where(p => p.UID == p_entity.UID); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(p_entity.PartCode)) |
||||
|
{ |
||||
|
q = q.Where(p => p.PartCode == p_entity.PartCode); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(p_entity.VendId)) |
||||
|
{ |
||||
|
q = q.Where(p => p.VendId == p_entity.VendId); |
||||
|
} |
||||
|
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); |
||||
|
_ret.State = ReturnStatus.Succeed; |
||||
|
_ret.Result = q; |
||||
|
p_action(_ret); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
|
||||
|
{ |
||||
|
var sb = new StringBuilder(); |
||||
|
foreach (var error in dbEx.EntityValidationErrors.ToList()) |
||||
|
{ |
||||
|
error.ValidationErrors.ToList().ForEach(i => |
||||
|
{ |
||||
|
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); |
||||
|
}); |
||||
|
} |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.ErrorList.Add(dbEx); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MoldSharing_List", sb.ToString()); |
||||
|
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); |
||||
|
} |
||||
|
catch (OptimisticConcurrencyException ex)//并发冲突异常
|
||||
|
{ |
||||
|
|
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.ErrorList.Add(ex); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MoldSharing_List", ex.ToString()); |
||||
|
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); |
||||
|
} |
||||
|
catch (ScpException ex) |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.ErrorList.Add(ex); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MoldSharing_List", ex.ToString()); |
||||
|
|
||||
|
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) |
||||
|
{ |
||||
|
var inner = (UpdateException)ex.InnerException; |
||||
|
|
||||
|
|
||||
|
throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
if (ex.InnerException != null) throw ex.InnerException; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception e) |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.ErrorList.Add(e); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MoldSharing_List", e.Message); |
||||
|
throw e; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
public static void Get_V_TA_MOLDSHARING_INVOICE_List(TA_MOLDSHARING_INVOICE p_entity, Action<ResultObject<IQueryable<TA_MOLDSHARING_INVOICE>>> p_action) |
||||
|
{ |
||||
|
ResultObject<IQueryable<TA_MOLDSHARING_INVOICE>> _ret = new ResultObject<IQueryable<TA_MOLDSHARING_INVOICE>>(); |
||||
|
try |
||||
|
{ |
||||
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
||||
|
{ |
||||
|
IQueryable<TA_MOLDSHARING_INVOICE> q = db.TA_MoldSharing_Invoice; |
||||
|
if (p_entity.MoldSharingId != 0) |
||||
|
{ |
||||
|
q = q.Where(p => p.MoldSharingId == p_entity.MoldSharingId); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(p_entity.PartCode)) |
||||
|
{ |
||||
|
q = q.Where(p => p.PartCode == p_entity.PartCode); |
||||
|
} |
||||
|
_ret.State = ReturnStatus.Succeed; |
||||
|
_ret.Result = q; |
||||
|
p_action(_ret); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
|
||||
|
{ |
||||
|
var sb = new StringBuilder(); |
||||
|
foreach (var error in dbEx.EntityValidationErrors.ToList()) |
||||
|
{ |
||||
|
error.ValidationErrors.ToList().ForEach(i => |
||||
|
{ |
||||
|
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); |
||||
|
}); |
||||
|
} |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.ErrorList.Add(dbEx); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_List", sb.ToString()); |
||||
|
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); |
||||
|
} |
||||
|
catch (OptimisticConcurrencyException ex)//并发冲突异常
|
||||
|
{ |
||||
|
|
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.ErrorList.Add(ex); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_List", ex.ToString()); |
||||
|
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); |
||||
|
} |
||||
|
catch (ScpException ex) |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.ErrorList.Add(ex); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_List", ex.ToString()); |
||||
|
|
||||
|
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) |
||||
|
{ |
||||
|
var inner = (UpdateException)ex.InnerException; |
||||
|
|
||||
|
|
||||
|
throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
if (ex.InnerException != null) throw ex.InnerException; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception e) |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.ErrorList.Add(e); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Get_V_TA_MOLDSHARING_INVOICE_List", e.Message); |
||||
|
throw e; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 模具分摊导入
|
||||
|
/// </summary>
|
||||
|
/// <param name="p_order_list"></param>
|
||||
|
/// <param name="site"></param>
|
||||
|
/// <param name="p_creator"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public static ResultObject<bool> EXCEL_MOLDSHARING_MOD(List<SCP_MOLDSHARING_EXPORT> p_order_list, string site, string p_creator) |
||||
|
{ |
||||
|
ResultObject<bool> _ret = new ResultObject<bool>(); |
||||
|
try |
||||
|
{ |
||||
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
||||
|
{ |
||||
|
int number = 1; |
||||
|
List<string> lineError = new List<string>(); |
||||
|
List<string> ErrorList = new List<string>(); |
||||
|
var _lst = p_order_list; |
||||
|
_lst.ForEach(p => |
||||
|
{ |
||||
|
var _ls = CheckExcelMode_MoldSharing(db, p, site); |
||||
|
if (_ls.Count > 0) |
||||
|
{ |
||||
|
lineError.Add(number.ToString()); |
||||
|
ErrorList.Add(string.Join("<br>", _ls.ToArray())); |
||||
|
} |
||||
|
number++; |
||||
|
}); |
||||
|
if (lineError.Count > 0) |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.MessageList.AddRange(ErrorList); |
||||
|
_ret.Result = false; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_lst.ForEach(p => |
||||
|
{ |
||||
|
var _moldsharing = db.TA_MoldSharing.SingleOrDefault(t => t.VendId == p.供应商编码.ToUpper() && t.PartCode == p.零件编码.ToUpper()) ?? |
||||
|
new TA_MOLDSHARING |
||||
|
{ |
||||
|
VendId = p.供应商编码.ToUpper(), |
||||
|
PartCode = p.零件编码.ToUpper(), |
||||
|
CreateTime = DateTime.Now, |
||||
|
CreateUser = p_creator, |
||||
|
IsDeleted = false, |
||||
|
Count = 0, |
||||
|
}; |
||||
|
_moldsharing.Price = decimal.Parse(p.价格); |
||||
|
_moldsharing.TotalCount = decimal.Parse(p.分摊总量); |
||||
|
_moldsharing.InitialQty = decimal.Parse(p.初始已分摊数量); |
||||
|
_moldsharing.Qty = (_moldsharing.TotalCount - _moldsharing.InitialQty); |
||||
|
_moldsharing.UpdateTime = DateTime.Now; |
||||
|
_moldsharing.UpdateUser = p_creator; |
||||
|
_moldsharing.Site = site; |
||||
|
if(_moldsharing.Qty< _moldsharing.Count) |
||||
|
{ |
||||
|
_ret.MessageList.Add(string.Format("零件号{0}(分摊总量-初始已分摊数量)小于已累计数量!", _moldsharing.PartCode)); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
db.TA_MoldSharing.AddOrUpdate(_moldsharing); |
||||
|
} |
||||
|
}); |
||||
|
if (_ret.MessageList.Count == 0) |
||||
|
{ |
||||
|
int state = db.SaveChanges(); |
||||
|
if (state != -1) |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Succeed; |
||||
|
_ret.Result = true; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
|
||||
|
{ |
||||
|
var sb = new StringBuilder(); |
||||
|
|
||||
|
foreach (var error in dbEx.EntityValidationErrors.ToList()) |
||||
|
{ |
||||
|
|
||||
|
error.ValidationErrors.ToList().ForEach(i => |
||||
|
{ |
||||
|
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); |
||||
|
}); |
||||
|
} |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
_ret.ErrorList.Add(dbEx); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "EXCEL_MOLDSHARING_MOD", sb.ToString()); |
||||
|
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); |
||||
|
} |
||||
|
catch (OptimisticConcurrencyException ex)//并发冲突异常
|
||||
|
{ |
||||
|
|
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
_ret.ErrorList.Add(ex); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "EXCEL_MOLDSHARING_MOD", ex.ToString()); |
||||
|
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); |
||||
|
} |
||||
|
catch (ScpException ex) |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
_ret.ErrorList.Add(ex); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "EXCEL_MOLDSHARING_MOD", ex.ToString()); |
||||
|
|
||||
|
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) |
||||
|
{ |
||||
|
var inner = (UpdateException)ex.InnerException; |
||||
|
|
||||
|
|
||||
|
throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
if (ex.InnerException != null) throw ex.InnerException; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception e) |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "EXCEL_MOLDSHARING_MOD", e.Message); |
||||
|
_ret.Result = false; |
||||
|
_ret.ErrorList.Add(e); |
||||
|
throw e; |
||||
|
} |
||||
|
return _ret; |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 数据检验
|
||||
|
/// </summary>
|
||||
|
/// <param name="db"></param>
|
||||
|
/// <param name="p_excel"></param>
|
||||
|
/// <param name="site"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public static List<string> CheckExcelMode_MoldSharing(ScpEntities db, SCP_MOLDSHARING_EXPORT p_excel, string site) |
||||
|
{ |
||||
|
List<string> ErrorList = new List<string>(); |
||||
|
if (!string.IsNullOrEmpty(p_excel.供应商编码)) |
||||
|
{ |
||||
|
int count = db.TA_VENDER.Count(p => p.VendId == p_excel.供应商编码 && p.Site == site); |
||||
|
if (count <= 0) |
||||
|
{ |
||||
|
ErrorList.Add(string.Format("供应商{0}不存在!", p_excel.供应商编码)); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
ErrorList.Add(string.Format("供应商代码为空!")); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(p_excel.零件编码)) |
||||
|
{ |
||||
|
int count = db.TA_PART.Count(p => p.PartCode == p_excel.零件编码 && p.Site == site); |
||||
|
if (count <= 0) |
||||
|
{ |
||||
|
ErrorList.Add(string.Format("零件编号{0}不存在!", p_excel.零件编码)); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
ErrorList.Add(string.Format("零件号为空!")); |
||||
|
} |
||||
|
if ( |
||||
|
string.IsNullOrEmpty(p_excel.供应商编码) || |
||||
|
string.IsNullOrEmpty(p_excel.零件编码) || |
||||
|
string.IsNullOrEmpty(p_excel.价格) || |
||||
|
string.IsNullOrEmpty(p_excel.分摊总量)|| |
||||
|
string.IsNullOrEmpty(p_excel.初始已分摊数量)) |
||||
|
{ |
||||
|
ErrorList.Add(string.Format("供应商代码【{0}】零件编号【{1}】有填写为空!", p_excel.供应商编码, p_excel.零件编码)); |
||||
|
} |
||||
|
return ErrorList; |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 获取模具分摊价格(沈阳模具分摊)
|
||||
|
/// </summary>
|
||||
|
/// <param name="p_list"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public static List<V_TB_RECEIVE_LIST> GET_MoldSharing_LIST_SYJB(List<V_TB_RECEIVE_LIST> p_list) |
||||
|
{ |
||||
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
||||
|
{ |
||||
|
if (p_list.Count > 0) |
||||
|
{ |
||||
|
p_list.ForEach(p => |
||||
|
{ |
||||
|
//var entity_price = db.V_TB_PRICE.Where(t => t.VendId == p.VendId && t.PartCode == p.PartCode && t.StartTime <= DateTime.Now).FirstOrDefault();
|
||||
|
//if (entity_price != null)
|
||||
|
//{
|
||||
|
// p.Price = entity_price.Amt;
|
||||
|
//}
|
||||
|
var _entity = db.TA_MoldSharing.Where(itm => itm.Qty!= itm.Count && itm.PartCode == p.PartCode && itm.VendId == p.VendId &&itm.IsDeleted==false).FirstOrDefault(); |
||||
|
if (_entity != null) |
||||
|
{ |
||||
|
p.Price += decimal.Parse(_entity.Price.ToString()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
return p_list; |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 获取模具分摊价格
|
||||
|
/// </summary>
|
||||
|
/// <param name="p_list"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public static List<V_TB_RECEIVE_LIST> GET_MoldSharing_LIST(List<V_TB_RECEIVE_LIST> p_list) |
||||
|
{ |
||||
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
||||
|
{ |
||||
|
if (p_list.Count > 0) |
||||
|
{ |
||||
|
p_list.ForEach(p => |
||||
|
{ |
||||
|
var _entity = db.TA_MoldSharing.Where(itm => itm.Qty > itm.Count && itm.PartCode == p.PartCode && itm.VendId == p.VendId &&itm.IsDeleted==false).FirstOrDefault(); |
||||
|
if (_entity != null) |
||||
|
{ |
||||
|
p.BlancePrice = decimal.Parse(_entity.Price.ToString()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
p.BlancePrice = 0; |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
return p_list; |
||||
|
} |
||||
|
public static ResultObject<bool> Save_TA_MOLDSHARING_STATE (List<long> p_list, string p_user, bool p_isdelete) |
||||
|
{ |
||||
|
ResultObject<bool> _ret = new ResultObject<bool>(); |
||||
|
try |
||||
|
{ |
||||
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
||||
|
{ |
||||
|
|
||||
|
if (p_isdelete == true) |
||||
|
{ |
||||
|
var _ls = db.TA_MoldSharing.Where(p => p_list.Contains(p.UID)&& p.Count <= 0).ToList(); |
||||
|
if (_ls.Count > 0) |
||||
|
{ |
||||
|
_ls.ForEach(p => |
||||
|
{ |
||||
|
p.IsDeleted = true; |
||||
|
p.UpdateTime = DateTime.Now; |
||||
|
p.UpdateUser = p_user; |
||||
|
} |
||||
|
); |
||||
|
db.TA_MoldSharing.AddOrUpdate(p => p.UID, _ls.ToArray()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
_ret.Message = "选择的记录,已经开始计数不能删除!"; |
||||
|
} |
||||
|
} |
||||
|
if (string.IsNullOrEmpty(_ret.Message)) |
||||
|
{ |
||||
|
if (db.SaveChanges() != -1) |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Succeed; |
||||
|
_ret.Result = true; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
_ret.Message = "数据更新失败!"; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
|
||||
|
{ |
||||
|
var sb = new StringBuilder(); |
||||
|
|
||||
|
foreach (var error in dbEx.EntityValidationErrors.ToList()) |
||||
|
{ |
||||
|
|
||||
|
error.ValidationErrors.ToList().ForEach(i => |
||||
|
{ |
||||
|
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); |
||||
|
}); |
||||
|
} |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
_ret.ErrorList.Add(dbEx); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Save_TA_MOLDSHARING_STATE", sb.ToString()); |
||||
|
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); |
||||
|
} |
||||
|
catch (OptimisticConcurrencyException ex)//并发冲突异常
|
||||
|
{ |
||||
|
|
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
_ret.ErrorList.Add(ex); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Save_TA_MOLDSHARING_STATE", ex.ToString()); |
||||
|
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); |
||||
|
} |
||||
|
catch (ScpException ex) |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
_ret.Result = false; |
||||
|
_ret.ErrorList.Add(ex); |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Save_TA_MOLDSHARING_STATE", ex.ToString()); |
||||
|
|
||||
|
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) |
||||
|
{ |
||||
|
var inner = (UpdateException)ex.InnerException; |
||||
|
|
||||
|
|
||||
|
throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
if (ex.InnerException != null) throw ex.InnerException; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception e) |
||||
|
{ |
||||
|
_ret.State = ReturnStatus.Failed; |
||||
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MoldSharing_Controller), "Save_TA_MOLDSHARING_STATE", e.Message); |
||||
|
_ret.Result = false; |
||||
|
_ret.ErrorList.Add(e); |
||||
|
throw e; |
||||
|
} |
||||
|
|
||||
|
return _ret; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity |
||||
|
{ |
||||
|
public class SCP_MOLDSHARING_EXPORT |
||||
|
{ |
||||
|
public string 供应商编码 { get; set; } |
||||
|
public string 零件编码 { get; set; } |
||||
|
public string 价格 { get; set; } |
||||
|
public string 分摊总量 { get; set; } |
||||
|
public string 初始已分摊数量 { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity |
||||
|
{ |
||||
|
public class SCP_OTD_VendId_REPORT_EXPORT |
||||
|
{ |
||||
|
public string 要货看板号 { get; set; } |
||||
|
public string 供应商编号 { get; set; } //VendId
|
||||
|
public string 供应商名称 { get; set; } //VendName
|
||||
|
public string 要求到货时间 { get; set; }//endtime
|
||||
|
public string 订单要货数量 { get; set; } //AskQty
|
||||
|
public string 到货数量 { get; set; } //ArriveQty
|
||||
|
public string 差额 { get; set; } //Qty
|
||||
|
public string 及时数量 { get; set; } //NntimelyQty
|
||||
|
public string 及时率 { get; set; }//OTD
|
||||
|
public string 到货率 { get; set; }//ArriveOTD
|
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace CK.SCP.Models.ScpEntity.ExcelImportEntity |
||||
|
{ |
||||
|
public class SCP_ASN_EXCEL |
||||
|
{ |
||||
|
public string 采购订单号 { get; set; } |
||||
|
public string 收货单号 { get; set; } |
||||
|
public string 零件编号 { get; set; } |
||||
|
public string 行号 { get; set; } |
||||
|
public string 供应商编码 { get; set; } |
||||
|
public string 批次 { get; set; } |
||||
|
public string 供应商批次 { get; set; } |
||||
|
public string 数量 { get; set; } |
||||
|
public string 单位 { get; set; } |
||||
|
public string 标包数 { get; set; } |
||||
|
public string 价格 { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace CK.SCP.Models.ScpEntity |
||||
|
{ |
||||
|
public class TA_MOLDSHARING_INVOICE |
||||
|
{ |
||||
|
[Key] |
||||
|
public long UID { set; get; } |
||||
|
public long MoldSharingId { set; get; } |
||||
|
public System.Guid InvcGUID { get; set; } |
||||
|
[Required, StringLength(50)] |
||||
|
public string InvcBillNum { set; get; } |
||||
|
public int PoLineNum { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string PartCode { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string Batch { get; set; } |
||||
|
public string RecvBillNum { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string ErpRecvBillNum { get; set; } |
||||
|
public decimal Price { get; set; } |
||||
|
[Column(TypeName = "money")] |
||||
|
public decimal Qty { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace CK.SCP.Models.ScpEntity |
||||
|
{ |
||||
|
public partial class TA_MOLDSHARING |
||||
|
{ |
||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
||||
|
[Key] |
||||
|
public long UID { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string VendId { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string PartCode { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string Site { get; set; } |
||||
|
public System.DateTime CreateTime { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string CreateUser { get; set; } |
||||
|
public Nullable<System.DateTime> UpdateTime { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string UpdateUser { get; set; } |
||||
|
public decimal? TotalCount { get; set; }//分摊总数(已分摊期初数+分摊数量)
|
||||
|
public decimal? InitialQty { get; set; }//已分摊期初数
|
||||
|
public decimal? Qty { get; set; }//分摊数量
|
||||
|
public decimal? Count { get; set; }//累计分摊数量
|
||||
|
// [Column(TypeName = "money")]
|
||||
|
public decimal? Price { get; set; } |
||||
|
public bool IsDeleted { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace CK.SCP.Models.ScpEntity |
||||
|
{ |
||||
|
public partial class V_TS_BARCODE |
||||
|
{ |
||||
|
[Key] |
||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
||||
|
public long UID { get; set; } |
||||
|
|
||||
|
|
||||
|
[StringLength(50)] |
||||
|
public string BarCode { get; set; } |
||||
|
[Required] |
||||
|
[StringLength(50)] |
||||
|
public string PartCode { get; set; } |
||||
|
[Required] |
||||
|
[StringLength(50)] |
||||
|
public string Batch { get; set; } |
||||
|
[Column(TypeName = "money")] |
||||
|
public decimal Qty { get; set; } |
||||
|
[Required] |
||||
|
[StringLength(50)] |
||||
|
public string BillNum { get; set; } |
||||
|
public int PoBillLine { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string VendId { get; set; } |
||||
|
[StringLength(50)] |
||||
|
public string VendBatch { get; set; } |
||||
|
[DisplayName("是否扫描")] |
||||
|
public bool IsScanned { get; set; } |
||||
|
[DisplayName("是否描述")] |
||||
|
public string IsScanned_Desc { get; set; } |
||||
|
[Column(TypeName = "money")] |
||||
|
public decimal PackQty { get; set; } |
||||
|
public string Site { get; set; } |
||||
|
[NotMapped] |
||||
|
public List<string> UserInVendIds { set; get; } |
||||
|
|
||||
|
|
||||
|
[NotMapped] |
||||
|
public List<string> UserInAddress { set; get; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace ChangKeTec.Wms.Models.Wms |
||||
|
{ |
||||
|
public partial class VIEW_STOCK_REPORT |
||||
|
{ |
||||
|
[Key] |
||||
|
[Column(Order = 0)] |
||||
|
[StringLength(50)] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
[Key] |
||||
|
[Column(Order = 2)] |
||||
|
public string VendId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// WMS待检验数量
|
||||
|
/// </summary>
|
||||
|
public decimal InspectQty { get; set; } |
||||
|
/// <summary>
|
||||
|
/// WMS合格数量
|
||||
|
/// </summary>
|
||||
|
public decimal QualifiedQty { get; set; } |
||||
|
/// <summary>
|
||||
|
/// SCP待开票数量
|
||||
|
/// </summary>
|
||||
|
[NotMapped] |
||||
|
public decimal InvoiceQty { get; set; } |
||||
|
[NotMapped] |
||||
|
public List<string> UserInVendIds { set; get; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UNIAPI.aspx.cs" Inherits="SCP.Admin.UNIAPI" %> |
||||
|
|
||||
|
<!DOCTYPE html> |
||||
|
|
||||
|
<!DOCTYPE html> |
||||
|
|
||||
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
|
<head runat="server"> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
||||
|
<title></title> |
||||
|
</head> |
||||
|
<body> |
||||
|
|
||||
|
|
||||
|
<form id="form1" runat="server"> |
||||
|
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> |
||||
|
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"> |
||||
|
<Items> |
||||
|
<f:Form runat="server"> |
||||
|
<Toolbars> |
||||
|
<f:Toolbar ID="Toolbar2" runat="server"> |
||||
|
<Items> |
||||
|
<f:DropDownList runat="server" ID="DDL_State" Label="查询接口"> |
||||
|
<f:ListItem Text="订单接口" Value="xxqad_pod_det"/> |
||||
|
<f:ListItem Text="QAD收货单接口" Value="xxqad_prh_det" /> |
||||
|
<f:ListItem Text="WMS收货单接口" Value="xxwms_rc_det" /> |
||||
|
<f:ListItem Text="发货单接口" Value="xxscm_tx_mstr" /> |
||||
|
<f:ListItem Text="发票接口" Value="xxscm_inv_det" /> |
||||
|
</f:DropDownList> |
||||
|
<f:TextArea runat="server" Label="单据号" ID="TXT_billnum" Width="600" ></f:TextArea> |
||||
|
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找"> |
||||
|
</f:Button> |
||||
|
</Items> |
||||
|
</f:Toolbar> |
||||
|
</Toolbars> |
||||
|
</f:Form> |
||||
|
|
||||
|
|
||||
|
<f:Grid ID = "Grid" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "true" runat ="server" |
||||
|
> |
||||
|
|
||||
|
<Columns> |
||||
|
|
||||
|
</Columns> |
||||
|
</f:Grid> |
||||
|
</Items> |
||||
|
</f:Panel> |
||||
|
|
||||
|
</form> |
||||
|
|
||||
|
|
||||
|
</body> |
||||
|
</html> |
||||
|
|
@ -0,0 +1,88 @@ |
|||||
|
using CK.SCP.Controller; |
||||
|
using FineUI; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Data; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Web; |
||||
|
using System.Web.UI; |
||||
|
using System.Web.UI.WebControls; |
||||
|
|
||||
|
namespace SCP.Admin |
||||
|
{ |
||||
|
public partial class UNIAPI : PageBase |
||||
|
{ |
||||
|
protected void Page_Load(object sender, EventArgs e) |
||||
|
{ |
||||
|
if (!Page.IsPostBack) |
||||
|
{ |
||||
|
Bind(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
private void Bind() |
||||
|
{ |
||||
|
var _domain = Request["Domain"]; |
||||
|
var _billNum =TXT_billnum.Text= Request.Params["BillNum"]; |
||||
|
var _tableName=DDL_State.SelectedValue= Request.Params["TableName"]; |
||||
|
if (!string.IsNullOrEmpty(_billNum) && !string.IsNullOrEmpty(_domain) && !string.IsNullOrEmpty(_tableName)) |
||||
|
{ |
||||
|
|
||||
|
var _ary = _billNum.Split(new char[] { ',' }).ToList(); |
||||
|
var sqlstr = string.Empty; |
||||
|
_ary.ForEach(p => |
||||
|
{ |
||||
|
sqlstr += string.Format("'{0}',", p); |
||||
|
}); |
||||
|
sqlstr = sqlstr.Substring(0, sqlstr.Length - 1); |
||||
|
|
||||
|
DataTable _dt = UniApiController.FindUniapi(_tableName, sqlstr, _domain); |
||||
|
foreach (DataColumn column in _dt.Columns) |
||||
|
{ |
||||
|
FineUI.BoundField bf; |
||||
|
bf = new FineUI.BoundField(); |
||||
|
bf.DataField = column.ColumnName; |
||||
|
bf.SortField = column.ColumnName; |
||||
|
bf.HeaderText = column.ColumnName; |
||||
|
Grid.Columns.Add(bf); |
||||
|
} |
||||
|
Grid.DataSource = _dt; |
||||
|
Grid.DataBind(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected void BtnSearch_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
StringBuilder _buffer = new StringBuilder(); |
||||
|
|
||||
|
if (!string.IsNullOrEmpty(DDL_State.SelectedValue)) |
||||
|
{ |
||||
|
_buffer.AppendFormat("TableName={0}&&", DDL_State.SelectedValue); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
if (!string.IsNullOrEmpty(TXT_billnum.Text)) |
||||
|
{ |
||||
|
_buffer.AppendFormat("BillNum={0}&&", TXT_billnum.Text); |
||||
|
} |
||||
|
string s = _buffer.ToString(); |
||||
|
PageContext.Redirect(string.Format("UNIAPI.aspx?{0}", s)); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
@ -0,0 +1,78 @@ |
|||||
|
//------------------------------------------------------------------------------
|
||||
|
// <自动生成>
|
||||
|
// 此代码由工具生成。
|
||||
|
//
|
||||
|
// 对此文件的更改可能导致不正确的行为,如果
|
||||
|
// 重新生成代码,则所做更改将丢失。
|
||||
|
// </自动生成>
|
||||
|
//------------------------------------------------------------------------------
|
||||
|
|
||||
|
namespace SCP.Admin { |
||||
|
|
||||
|
|
||||
|
public partial class UNIAPI { |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// form1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Panel1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Panel Panel1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Toolbar2 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Toolbar Toolbar2; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// DDL_State 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.DropDownList DDL_State; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// TXT_billnum 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.TextArea TXT_billnum; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// BtnSearch 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Button BtnSearch; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Grid 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Grid Grid; |
||||
|
} |
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MOLDSHARING_DETAIL.aspx.cs" Inherits="SCP.Views.BasicData.SCP_MOLDSHARING_DETAIL" %> |
||||
|
|
||||
|
<!DOCTYPE html> |
||||
|
|
||||
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
|
<head runat="server"> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
||||
|
<title></title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<form id="form1" runat="server"> |
||||
|
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> |
||||
|
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True"> |
||||
|
<Items> |
||||
|
<f:Form runat="server" Title=""> |
||||
|
<Items> |
||||
|
<f:FormRow runat="server" ColumnWidths="33% 33% 33%"> |
||||
|
<Items> |
||||
|
<f:TextBox ID="TextVendId" runat="server" Label="供应商" Text="" Width="600" Readonly="true"> |
||||
|
</f:TextBox> |
||||
|
<f:TextBox ID="TextPartCode" runat="server" Label="零件编号" Text="" Width="600" Readonly="true"> |
||||
|
</f:TextBox> |
||||
|
<f:TextBox ID="TextPrice" runat="server" Label="价格" Text="" Width="600" Readonly="true" /> |
||||
|
</Items> |
||||
|
</f:FormRow> |
||||
|
<f:FormRow runat="server" ColumnWidths="33% 33% 33%"> |
||||
|
<Items> |
||||
|
<f:TextBox ID="TextTotal" runat="server" Label="分摊总量" Text="" Width="600" Readonly="true"> |
||||
|
</f:TextBox> |
||||
|
<f:TextBox ID="TexInitialQty" runat="server" Label="初始已分摊数量" Text="" Width="600" Readonly="true"> |
||||
|
</f:TextBox> |
||||
|
<f:TextBox ID="TextCount" runat="server" Label="已累计数量" Text="" Width="600" Readonly="true" /> |
||||
|
</Items> |
||||
|
</f:FormRow> |
||||
|
</Items> |
||||
|
</f:Form> |
||||
|
<f:Toolbar runat="server"> |
||||
|
<Items> |
||||
|
<f:ToolbarSeparator runat="server" /> |
||||
|
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_OnClick"> |
||||
|
</f:Button> |
||||
|
<f:ToolbarFill runat="server" /> |
||||
|
</Items> |
||||
|
</f:Toolbar> |
||||
|
<f:Grid ID="Grid_MOLDSHARING_DETAIL" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" |
||||
|
runat="server" DataKeyNames="" IsDatabasePaging="True" AllowPaging="True" SortField="PartCode" SortDirection="DESC" |
||||
|
EnableRowSelectEvent="False" AutoScroll="True" OnPageIndexChange="Grid1_OnPageIndexChange"> |
||||
|
<PageItems> |
||||
|
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> |
||||
|
</f:ToolbarSeparator> |
||||
|
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:"> |
||||
|
</f:ToolbarText> |
||||
|
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_OnSelectedIndexChanged" |
||||
|
runat="server"> |
||||
|
<f:ListItem Text="100" Value="100" /> |
||||
|
<f:ListItem Text="200" Value="200" /> |
||||
|
<f:ListItem Text="1000" Value="1000" /> |
||||
|
</f:DropDownList> |
||||
|
</PageItems> |
||||
|
<Columns> |
||||
|
<f:BoundField DataField="ID" HeaderText="ID" ColumnID="ID" Hidden="true" /> |
||||
|
<f:BoundField SortField="InvcBillNum" DataField="InvcBillNum" HeaderText="发票号" ColumnID="InvcBillNum" Width="100px" /> |
||||
|
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件编号" ColumnID="PartCode" Width="120px" /> |
||||
|
<f:BoundField SortField="PoLineNum" DataField="PoLineNum" HeaderText="订单行" ColumnID="PoLineNum" Width="60px" /> |
||||
|
<f:BoundField SortField="Qty" DataField="Qty" HeaderText="数量" ColumnID="Qty" Width="60px" /> |
||||
|
<f:BoundField SortField="Price" DataField="Price" HeaderText="价格" ColumnID="Price" Width="60px" /> |
||||
|
<f:BoundField SortField="RecvBillNum" DataField="RecvBillNum" HeaderText="WM单号" ColumnID="RecvBillNum" Width="80px" /> |
||||
|
<f:BoundField SortField="ErpRecvBillNum" DataField="ErpRecvBillNum" HeaderText="ERP单号" ColumnID="ErpRecvBillNum" Width="80px" /> |
||||
|
</Columns> |
||||
|
</f:Grid> |
||||
|
</Items> |
||||
|
</f:Panel> |
||||
|
|
||||
|
</form> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,88 @@ |
|||||
|
using CK.SCP.Controller; |
||||
|
using CK.SCP.Models.ScpEntity; |
||||
|
using FineUI; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.UI; |
||||
|
using System.Web.UI.WebControls; |
||||
|
|
||||
|
namespace SCP.Views.BasicData |
||||
|
{ |
||||
|
public partial class SCP_MOLDSHARING_DETAIL : PageBase |
||||
|
{ |
||||
|
protected void Page_Load(object sender, EventArgs e) |
||||
|
{ |
||||
|
if (!IsPostBack) |
||||
|
{ |
||||
|
LoadData(); |
||||
|
BindData(); |
||||
|
} |
||||
|
} |
||||
|
public void LoadData() |
||||
|
{ |
||||
|
var item = new TA_MOLDSHARING(); |
||||
|
item.UID =long.Parse( GetQueryValue("ID")); |
||||
|
SCP_MoldSharing_Controller.Get_V_TA_MoldSharing_List(item, (_ret) => |
||||
|
{ |
||||
|
if (_ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
var _rec = _ret.Result.FirstOrDefault(); |
||||
|
TextVendId.Text = _rec.VendId; |
||||
|
TextPartCode.Text = _rec.PartCode; |
||||
|
TextPrice.Text = _rec.Price.ToString(); |
||||
|
TextTotal.Text = _rec.TotalCount.ToString(); |
||||
|
TexInitialQty.Text = _rec.InitialQty.ToString(); |
||||
|
TextCount.Text = _rec.Count.ToString(); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
public void BindData() |
||||
|
{ |
||||
|
var _entity = new TA_MOLDSHARING_INVOICE(); |
||||
|
_entity.MoldSharingId = long.Parse(GetQueryValue("ID")); |
||||
|
SCP_MoldSharing_Controller.Get_V_TA_MOLDSHARING_INVOICE_List(_entity, (ret) => |
||||
|
{ |
||||
|
if (ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
Grid_MOLDSHARING_DETAIL.RecordCount = ret.Result.Count(); |
||||
|
var _ls = SortAndPage(ret.Result, Grid_MOLDSHARING_DETAIL); |
||||
|
Grid_MOLDSHARING_DETAIL.DataSource = _ls; |
||||
|
Grid_MOLDSHARING_DETAIL.DataBind(); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e) |
||||
|
{ |
||||
|
Grid_MOLDSHARING_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
||||
|
BindData(); |
||||
|
} |
||||
|
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e) |
||||
|
{ |
||||
|
Grid_MOLDSHARING_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
||||
|
BindData(); |
||||
|
} |
||||
|
protected void btnOutput_OnClick(object sender, EventArgs e) |
||||
|
{ |
||||
|
var _entity = new TA_MOLDSHARING_INVOICE(); |
||||
|
_entity.MoldSharingId= long.Parse(GetQueryValue("ID")); |
||||
|
SCP_MoldSharing_Controller.Get_V_TA_MOLDSHARING_INVOICE_List(_entity, (ret) => |
||||
|
{ |
||||
|
if (ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
Dictionary<string, string> cellheader = new Dictionary<string, string> { |
||||
|
{ "InvcBillNum", "发票号" }, |
||||
|
{ "PartCode", "零件编号" }, |
||||
|
{ "PoLineNum", "订单行" }, |
||||
|
{ "Qty", "数量" }, |
||||
|
{ "Price", "价格" }, |
||||
|
}; |
||||
|
string url = EntityListToExcel2003(cellheader, ret.Result.ToList(), "分摊明细"); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,134 @@ |
|||||
|
//------------------------------------------------------------------------------
|
||||
|
// <自动生成>
|
||||
|
// 此代码由工具生成。
|
||||
|
//
|
||||
|
// 对此文件的更改可能导致不正确的行为,如果
|
||||
|
// 重新生成代码,则所做更改将丢失。
|
||||
|
// </自动生成>
|
||||
|
//------------------------------------------------------------------------------
|
||||
|
|
||||
|
namespace SCP.Views.BasicData |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
public partial class SCP_MOLDSHARING_DETAIL |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// form1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Panel1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Panel Panel1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// TextVendId 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.TextBox TextVendId; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// TextPartCode 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.TextBox TextPartCode; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// TextPrice 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.TextBox TextPrice; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// TextTotal 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.TextBox TextTotal; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// TexInitialQty 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.TextBox TexInitialQty; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// TextCount 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.TextBox TextCount; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// btnOutput 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Button btnOutput; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Grid_MOLDSHARING_DETAIL 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Grid Grid_MOLDSHARING_DETAIL; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// ToolbarSeparator1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.ToolbarSeparator ToolbarSeparator1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// ToolbarText1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.ToolbarText ToolbarText1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// ddlGridPageSize 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.DropDownList ddlGridPageSize; |
||||
|
} |
||||
|
} |
@ -0,0 +1,92 @@ |
|||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MoldSharing.aspx.cs" Inherits="SCP.Views.BasicData.SCP_MoldSharing" %> |
||||
|
|
||||
|
<!DOCTYPE html> |
||||
|
|
||||
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
|
<head runat="server"> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
||||
|
<title></title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<form id="form1" runat="server"> |
||||
|
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> |
||||
|
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"> |
||||
|
<Items> |
||||
|
<f:Form runat="server"> |
||||
|
<Toolbars> |
||||
|
<f:Toolbar ID="Toolbar2" runat="server"> |
||||
|
<Items> |
||||
|
<f:Button ID="BtnRefersh" runat="server" EnablePostBack="True" Text="刷新" Icon="Reload" OnClientClick="location.reload();"> |
||||
|
</f:Button> |
||||
|
<f:Button ID="btnDelete" runat="server" Text="删除" Icon="CssDelete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否删除?'))return false;" ></f:Button> |
||||
|
<f:ToolbarSeparator runat="server" /> |
||||
|
<f:Button ID="BtnOutPut" runat="server" EnablePostBack="True" Text="导出" Icon="Add" Hidden="true"> |
||||
|
</f:Button> |
||||
|
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_OnClick"> |
||||
|
</f:Button> |
||||
|
<f:ToolbarSeparator runat="server" /> |
||||
|
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload> |
||||
|
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click"> |
||||
|
</f:Button> |
||||
|
</Items> |
||||
|
</f:Toolbar> |
||||
|
</Toolbars> |
||||
|
</f:Form> |
||||
|
<f:GroupPanel runat="server" ID="gp1" Hidden="True" Layout="HBox"> |
||||
|
<Items> |
||||
|
<f:Form runat="server" BodyPadding="10px"> |
||||
|
<Rows> |
||||
|
<f:FormRow runat="server" ColumnWidths="50% 50%"> |
||||
|
<Items> |
||||
|
<f:Label runat="server" Label="供应商编号" /> |
||||
|
<f:TextBox ID="textVendId" runat="server" /> |
||||
|
<f:Label runat="server" Label="零件编码" /> |
||||
|
<f:TextBox ID="textPartCode" runat="server" /> |
||||
|
</Items> |
||||
|
</f:FormRow> |
||||
|
<f:FormRow runat="server"> |
||||
|
<Items> |
||||
|
<f:Button runat="server" ID="btnClose" Text="关闭" OnClick="btnClose_OnClick"></f:Button> |
||||
|
<f:Button ID="btnSearch" runat="server" OnClick="btnSearch_OnClick" Text="快速查找"> |
||||
|
</f:Button> |
||||
|
</Items> |
||||
|
</f:FormRow> |
||||
|
</Rows> |
||||
|
</f:Form> |
||||
|
</Items> |
||||
|
</f:GroupPanel> |
||||
|
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableRowDoubleClickEvent="True" |
||||
|
runat="server" DataKeyNames="UID,VendId" IsDatabasePaging="true" AllowPaging="True" OnPageIndexChange="Grid1_OnPageIndexChange" |
||||
|
EnableRowSelectEvent="True" AutoScroll="True" SortField="VendId" SortDirection="ASC" AllowSorting="True" OnRowDoubleClick="Grid1_RowDoubleClick"> |
||||
|
<PageItems> |
||||
|
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> |
||||
|
</f:ToolbarSeparator> |
||||
|
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:"> |
||||
|
</f:ToolbarText> |
||||
|
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_OnSelectedIndexChanged" |
||||
|
runat="server"> |
||||
|
<f:ListItem Text="100" Value="100" /> |
||||
|
<f:ListItem Text="200" Value="200" /> |
||||
|
<f:ListItem Text="1000" Value="1000" /> |
||||
|
</f:DropDownList> |
||||
|
</PageItems> |
||||
|
<Columns> |
||||
|
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" SortField="VendId" /> |
||||
|
<f:BoundField runat="server" HeaderText="零件编码" ColumnID="" DataField="PartCode" SortField="PartCode" /> |
||||
|
<f:BoundField runat="server" HeaderText="价格" ColumnID="" DataField="Price" SortField="Price" /> |
||||
|
<f:BoundField runat="server" HeaderText="分摊总量" DataFormatString="{0:F0}" ColumnID="" DataField="TotalCount" SortField="TotalCount" /> |
||||
|
<f:BoundField runat="server" HeaderText="初始已分摊数量" DataFormatString="{0:F0}" ColumnID="" DataField="InitialQty" SortField="InitialQty" /> |
||||
|
<f:BoundField runat="server" HeaderText="分摊数量" DataFormatString="{0:F0}" ColumnID="" DataField="Qty" SortField="Qty" /> |
||||
|
<f:BoundField runat="server" HeaderText="已累计数量" DataFormatString="{0:F0}" ColumnID="" DataField="Count" SortField="Count" /> |
||||
|
<f:BoundField runat="server" HeaderText="创建人" ColumnID="" DataField="CreateUser" SortField="CreateUser" /> |
||||
|
<f:BoundField runat="server" HeaderText="创建时间" ColumnID="" DataField="CreateTime" SortField="CreateTime" /> |
||||
|
</Columns> |
||||
|
</f:Grid> |
||||
|
</Items> |
||||
|
</f:Panel> |
||||
|
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1024px" AutoScroll="True" |
||||
|
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true" OnClose="Window1_Close" CloseAction="HidePostBack" |
||||
|
IFrameUrl="about:blank" /> |
||||
|
</form> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,175 @@ |
|||||
|
using CK.SCP.Controller; |
||||
|
using CK.SCP.Models.ScpEntity; |
||||
|
using CK.SCP.Models.ScpEntity.ExcelExportEnttity; |
||||
|
using CK.SCP.Utils; |
||||
|
using FineUI; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Data; |
||||
|
using System.IO; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.UI; |
||||
|
using System.Web.UI.WebControls; |
||||
|
|
||||
|
namespace SCP.Views.BasicData |
||||
|
{ |
||||
|
public partial class SCP_MoldSharing : PageBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 页面加载
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void Page_Load(object sender, EventArgs e) |
||||
|
{ |
||||
|
if (!IsPostBack) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 数据绑定
|
||||
|
/// </summary>
|
||||
|
public void BindData() |
||||
|
{ |
||||
|
SearchV_TA_MoldSharingData((result) => |
||||
|
{ |
||||
|
Grid1.RecordCount = result.Count(); |
||||
|
var list = SortAndPage<TA_MOLDSHARING>(result, Grid1); |
||||
|
Grid1.DataSource = list; |
||||
|
Grid1.DataBind(); |
||||
|
}); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 获取数据
|
||||
|
/// </summary>
|
||||
|
/// <param name="p_action"></param>
|
||||
|
public void SearchV_TA_MoldSharingData(Action<IQueryable<TA_MOLDSHARING>> p_action) |
||||
|
{ |
||||
|
TA_MOLDSHARING _entity = new TA_MOLDSHARING(); |
||||
|
_entity.PartCode = textPartCode.Text; |
||||
|
_entity.VendId = textVendId.Text; |
||||
|
SCP_MoldSharing_Controller.Get_V_TA_MoldSharing_List(_entity, (_ret) => |
||||
|
{ |
||||
|
if (_ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
p_action(_ret.Result); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 显示查询面板事件
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void btnShow_OnClick(object sender, EventArgs e) |
||||
|
{ |
||||
|
gp1.Hidden = false; |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 关闭显示查询面板事件
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void btnClose_OnClick(object sender, EventArgs e) |
||||
|
{ |
||||
|
gp1.Hidden = true; |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 查询事件
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
public void btnSearch_OnClick(object sender, EventArgs e) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 导入
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
public void btnInput_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
string _fileName = FileUp.FileName; |
||||
|
if (string.IsNullOrEmpty(_fileName)) |
||||
|
{ |
||||
|
Alert.Show("选择文件为空!"); |
||||
|
return; |
||||
|
} |
||||
|
string _lx = _fileName.Split('.')[1]; |
||||
|
Stream _stream = FileUp.PostedFile.InputStream; |
||||
|
DataTable _dt = new DataTable(); |
||||
|
if (_lx == "xls") |
||||
|
{ |
||||
|
_dt = ExcelHelper.GetDataTable(_stream); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_dt = ExcelHelper.GetDataTableOfXlsx(_stream); |
||||
|
} |
||||
|
var list = ConvertHelper.ToList<SCP_MOLDSHARING_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList(); |
||||
|
var ret = SCP_MoldSharing_Controller.EXCEL_MOLDSHARING_MOD(list, CurrentUser.FactoryList[0], CurrentUser.Name); |
||||
|
if (ret.State == ReturnStatus.Succeed && ret.Result == true) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
Alert.Show(string.Join("<br>", ret.MessageList)); |
||||
|
} |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 删除数据
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void btnDelete_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
int[] _selections = Grid1.SelectedRowIndexArray; |
||||
|
List<long> _UidList = new List<long>(); |
||||
|
for (int i = 0, count = Grid1.Rows.Count; i < count; i++) |
||||
|
{ |
||||
|
if (_selections.Contains(i)) |
||||
|
{ |
||||
|
object[] rowDataKeys = Grid1.DataKeys[i]; |
||||
|
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
||||
|
{ |
||||
|
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
var ret = SCP_MoldSharing_Controller.Save_TA_MOLDSHARING_STATE(_UidList, CurrentUser.Name, true); |
||||
|
if (ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
Alert.Show(ret.Message); |
||||
|
} |
||||
|
} |
||||
|
protected void ddlGridPageSize_OnSelectedIndexChanged(object sender, EventArgs e) |
||||
|
{ |
||||
|
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
||||
|
BindData(); |
||||
|
} |
||||
|
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e) |
||||
|
{ |
||||
|
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
||||
|
BindData(); |
||||
|
} |
||||
|
|
||||
|
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) |
||||
|
{ |
||||
|
object[] rowDataKeys = Grid1.DataKeys[e.RowIndex]; |
||||
|
string UID = rowDataKeys[0].ToString(); |
||||
|
PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../BasicData/SCP_MOLDSHARING_DETAIL.aspx?ID={0}", UID))); |
||||
|
} |
||||
|
protected void Window1_Close(object sender, WindowCloseEventArgs e) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ASK_DETAIL_PARTCODE.aspx.cs" Inherits="SCP.Views.沈阳金杯.PlanData.SCP_ASK_DETAIL_PARTCODE" %> |
||||
|
|
||||
|
<!DOCTYPE html> |
||||
|
|
||||
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
|
<head runat="server"> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
||||
|
<title></title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<form id="form1" runat="server"> |
||||
|
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> |
||||
|
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"> |
||||
|
<Toolbars> |
||||
|
<f:Toolbar ID="Toolbar2" runat="server"> |
||||
|
<Items> |
||||
|
<f:Button ID="BTN_refresh" runat="server" EnablePostBack="True" Text="刷新" Icon="box"> |
||||
|
</f:Button> |
||||
|
<f:Button ID="btnReduce" runat="server" EnablePostBack="True" OnClick="btnReduce_Click" Text="订单减产并发邮件" Icon="CssAdd" OnClientClick="if(!confirm('是否要货单减产?'))return false;"> |
||||
|
</f:Button> |
||||
|
</Items> |
||||
|
</f:Toolbar> |
||||
|
</Toolbars> |
||||
|
<Items> |
||||
|
<f:Grid runat="server" ID="Grid_V_TB_ASK_DETAIL" |
||||
|
DataKeyNames="UID,PoBillNum,PoLine,PartCode,PartDesc1,PartDesc2,AskBillNum,AskQty,ReduceQty,EndTime,VendId,State" |
||||
|
IsDatabasePaging="True" AllowPaging="True" PageSize="100" OnPageIndexChange="Grid_V_TB_ASK_DETAIL_PageIndexChange" |
||||
|
EnableRowSelectEvent="True" AutoScroll="True" SortField="PoLine" SortDirection="ASC" |
||||
|
AllowCellEditing="true" ClicksToEdit="2" OnSort="Grid1_Sort" AllowSorting="true" BoxFlex="1"> |
||||
|
<PageItems> |
||||
|
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> |
||||
|
</f:ToolbarSeparator> |
||||
|
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:"> |
||||
|
</f:ToolbarText> |
||||
|
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" |
||||
|
runat="server"> |
||||
|
<f:ListItem Text="100" Value="100" /> |
||||
|
<f:ListItem Text="200" Value="200" /> |
||||
|
</f:DropDownList> |
||||
|
</PageItems> |
||||
|
<Columns> |
||||
|
<%-- <f:TemplateField Width="40px" HeaderText="选择" > |
||||
|
<ItemTemplate> |
||||
|
<asp:checkbox ID="chexkbox" Checked="false" runat="server" > |
||||
|
</asp:checkbox> |
||||
|
</ItemTemplate> |
||||
|
</f:TemplateField> --%> |
||||
|
<f:BoundField SortField="State" DataField="State" HeaderText="状态" ColumnID="State" Hidden="true" Width="50px"/> |
||||
|
<f:BoundField SortField="State_DESC" DataField="State_DESC" HeaderText="状态" ColumnID="State_DESC" Width="50px"/> |
||||
|
<f:BoundField SortField="AskBillNum" DataField="AskBillNum" HeaderText="要货看板号" ColumnID="AskBillNum" Width="100px" /> |
||||
|
<f:BoundField SortField="PoLine" DataField="PoLine" HeaderText="行号" ColumnID="Line" Width="40px" /> |
||||
|
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" ColumnID="ProductCode" Width="80px" /> |
||||
|
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" HeaderText="名称" ColumnID="PartDesc1" Width="150px" /> |
||||
|
<f:BoundField SortField="PoUnit" DataField="PoUnit" HeaderText="单位" Hidden="true" ColumnID="PoUnit" Width="40px" /> |
||||
|
<f:BoundField SortField="PackQty" DataField="PackQty" HeaderText="标包数量" ColumnID="PackQty" Width="80px" DataFormatString="{0:F}" /> |
||||
|
<f:BoundField SortField="CurrencyDesc" DataField="CurrencyDesc" HeaderText="币种" Hidden="true" ColumnID="CurrencyDesc" Width="40px" /> |
||||
|
<f:BoundField SortField="Price" DataField="Price" HeaderText="价格" ColumnID="Price" Width="80px" Hidden="true" /> |
||||
|
<f:TemplateField HeaderText="要货数量" Width="70px" ColumnID="AskQty" > |
||||
|
<ItemTemplate> |
||||
|
<asp:TextBox ID="NB_PublishNum" runat="server" Width="60px" Text='<%# Eval("AskQty") %>' onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"></asp:TextBox> |
||||
|
</ItemTemplate> |
||||
|
</f:TemplateField> |
||||
|
<f:BoundField Width="80px" DataField="BeginTime" HeaderText="要货日期" ColumnID="BeginTime" /> |
||||
|
<f:RenderField Width="100px" ColumnID="ReduceNumber" FieldType="Float" HeaderText="减产数量" > |
||||
|
<Editor> |
||||
|
<f:NumberBox ID="NumberBox1" runat="server" MinValue="0" MaxValue="99999999" DecimalPrecision="2" > |
||||
|
</f:NumberBox> |
||||
|
</Editor> |
||||
|
</f:RenderField> |
||||
|
<f:BoundField SortField="ReduceQty" DataField="ReduceQty" HeaderText="已减数量" ColumnID="ReceiveQty" Width="60px" DataFormatString="{0:F0}" /> |
||||
|
<f:BoundField Width="80px" DataField="ShippedQty" DataFormatString="{0:F0}" HeaderText="已发货数量" /> |
||||
|
<f:BoundField Width="80px" DataField="OnRoadQty" DataFormatString="{0:F0}" HeaderText="在途数量" /> |
||||
|
<f:BoundField Width="80px" DataField="ArriveQty" DataFormatString="{0:F0}" HeaderText="到货数量" /> |
||||
|
<f:BoundField Width="80px" DataField="ReceivedQty" DataFormatString="{0:F0}" HeaderText="合格数量" /> |
||||
|
<f:BoundField Width="80px" DataField="RejectQty" DataFormatString="{0:F0}" HeaderText="退货数量" /> |
||||
|
<f:BoundField Width="80px" DataField="InvoiceQty" DataFormatString="{0:F0}" HeaderText="开票数量" /> |
||||
|
<f:RenderField Width="120px" SortField="EndTime" ColumnID="EndTime" FieldType="Date" DataField="EndTime" HeaderText="到货日期" Renderer="Date" RendererArgument="yyyy-MM-dd" > |
||||
|
<Editor> |
||||
|
<f:DatePicker ID="DatePicker1" Required="true" runat="server"> |
||||
|
</f:DatePicker> |
||||
|
</Editor> |
||||
|
</f:RenderField> |
||||
|
<f:BoundField SortField="Remark" DataField="Remark" HeaderText="备注" ColumnID="Remark"/> |
||||
|
<f:BoundField SortField="ReceivedPort_Desc" DataField="ReceivedPort_Desc" HeaderText="收货口" ColumnID="ReceivedPort_Desc" Hidden="true" /> |
||||
|
</Columns> |
||||
|
</f:Grid> |
||||
|
</Items> |
||||
|
</f:Panel> |
||||
|
</form> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,244 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.UI; |
||||
|
using System.Web.UI.WebControls; |
||||
|
using CK.SCP.Models.Enums; |
||||
|
using CK.SCP.Models.ScpEntity; |
||||
|
using CK.SCP.Utils; |
||||
|
using CK.SCP.Controller; |
||||
|
using FineUI; |
||||
|
using System.Text; |
||||
|
|
||||
|
|
||||
|
namespace SCP.Views.沈阳金杯.PlanData |
||||
|
{ |
||||
|
public partial class SCP_ASK_DETAIL_PARTCODE : PageBase |
||||
|
{ |
||||
|
protected void Page_Load(object sender, EventArgs e) |
||||
|
{ |
||||
|
if (!IsPostBack) |
||||
|
{ |
||||
|
SearchV_TB_ASK_DETAIL_VIEW((ret) => |
||||
|
{ |
||||
|
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count(); |
||||
|
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL); |
||||
|
Grid_V_TB_ASK_DETAIL.DataSource = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_ASK_CONTROLLER.LOAD_ASK_DETAIL_SUM(list.ToList())); |
||||
|
Grid_V_TB_ASK_DETAIL.DataBind(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void SetRoleRule() |
||||
|
{ |
||||
|
IsPriceVisible(Grid_V_TB_ASK_DETAIL, "价格"); |
||||
|
} |
||||
|
public void SearchV_TB_ASK_DETAILData(Action<IQueryable<V_TB_ASK_DETAIL>> p_action) |
||||
|
{ |
||||
|
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL(); |
||||
|
_entity.AskBillNum = Request["AskBillNum"]; |
||||
|
if (!string.IsNullOrEmpty(CurrentUser.Name)) |
||||
|
{ |
||||
|
if (CurrentUser.Name != "admin" && !CurrentUser.RoleList.Contains("采购部门主管")) |
||||
|
{ |
||||
|
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0) |
||||
|
{ |
||||
|
|
||||
|
if (CurrentUser.FactoryList.FirstOrDefault() == "0210") |
||||
|
{ |
||||
|
if (!CurrentUser.RoleList.Contains("要货看板所有记录")) |
||||
|
{ |
||||
|
_entity.CreateUser = CurrentUser.Name; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) => |
||||
|
{ |
||||
|
if (_ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
p_action(_ret.Result); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
public void BindDetail() |
||||
|
{ |
||||
|
SearchV_TB_ASK_DETAIL_VIEW((ret) => |
||||
|
{ |
||||
|
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count(); |
||||
|
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL); |
||||
|
Grid_V_TB_ASK_DETAIL.DataSource = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_ASK_CONTROLLER.LOAD_ASK_DETAIL_SUM(list.ToList())); |
||||
|
Grid_V_TB_ASK_DETAIL.DataBind(); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
protected void Grid_V_TB_ASK_DETAIL_PageIndexChange(object sender, GridPageEventArgs e) |
||||
|
{ |
||||
|
BindDetail(); |
||||
|
} |
||||
|
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
||||
|
{ |
||||
|
Grid_V_TB_ASK_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
||||
|
BindDetail(); |
||||
|
} |
||||
|
protected void btnReduce_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
var dictionarys = new Dictionary<string, StringBuilder>(); |
||||
|
List<V_TB_ASK_DETAIL> _askList = new List<V_TB_ASK_DETAIL>(); |
||||
|
List<string> _lineList = new List<string>(); |
||||
|
if (!string.IsNullOrEmpty(CurrentUser.Name)) |
||||
|
{ |
||||
|
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid_V_TB_ASK_DETAIL.GetModifiedDict(); |
||||
|
for (int i = 0, count = Grid_V_TB_ASK_DETAIL.Rows.Count; i < count; i++) |
||||
|
{ |
||||
|
GridRow row = Grid_V_TB_ASK_DETAIL.Rows[i]; |
||||
|
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL(); |
||||
|
object[] rowDataKeys = Grid_V_TB_ASK_DETAIL.DataKeys[i]; |
||||
|
_entity.UID = ConvertHelper.To<Int64>(rowDataKeys[0]); |
||||
|
_entity.PoLine = ConvertHelper.To<int>(rowDataKeys[2]); |
||||
|
_entity.AskQty = ConvertHelper.To<Decimal>(rowDataKeys[7]); |
||||
|
_entity.PartCode = rowDataKeys[3].ToString(); |
||||
|
_entity.PartDesc1 = rowDataKeys[4].ToString(); |
||||
|
_entity.PartDesc2 = rowDataKeys[5].ToString(); |
||||
|
_entity.ReduceQty = ConvertHelper.To<decimal>(rowDataKeys[8]); |
||||
|
_entity.AskBillNum = rowDataKeys[6].ToString(); |
||||
|
_entity.PoBillNum = rowDataKeys[1].ToString(); |
||||
|
_entity.VendId = rowDataKeys[10].ToString(); |
||||
|
_entity.State = ConvertHelper.To<int>(rowDataKeys[11]); |
||||
|
if (modifiedDict.Keys.Contains(i)) |
||||
|
{ |
||||
|
var modifyValue = modifiedDict[i]; |
||||
|
if (modifyValue.Keys.Contains("ReduceNumber")) |
||||
|
{ |
||||
|
if (_entity.State == (int)AskState.Release || _entity.State == (int)AskState.New || _entity.State == (int)AskState.Reject) |
||||
|
{ |
||||
|
_lineList.Add(string.Format("要货看板{0}产品名称:{1}的状态无法减产,请重新编辑!", _entity.AskBillNum, _entity.PartDesc1)); |
||||
|
} |
||||
|
var _reduceNumber = modifyValue["ReduceNumber"]; |
||||
|
decimal _out = 0; |
||||
|
bool _result = decimal.TryParse(_reduceNumber.ToString(), out _out); |
||||
|
if (_result == false) |
||||
|
{ |
||||
|
_lineList.Add(string.Format("产品名称:{0}减产数量:{1}", _entity.PartDesc1, _reduceNumber.ToString())); |
||||
|
} |
||||
|
if (_out == 0) |
||||
|
{ |
||||
|
continue; |
||||
|
} |
||||
|
decimal _qty = (_entity.ReduceQty == null) ? 0 : (decimal)_entity.ReduceQty; |
||||
|
_entity.ReduceQty = _qty + _out; |
||||
|
if (_entity.ReduceQty > _entity.AskQty) |
||||
|
{ |
||||
|
_lineList.Add(string.Format("减产数量不能大于要货数量!")); |
||||
|
} |
||||
|
if (_entity.ReduceQty < 0) |
||||
|
{ |
||||
|
_lineList.Add(string.Format("减产数量不能小于!")); |
||||
|
} |
||||
|
StringBuilder itm = new StringBuilder(); |
||||
|
if (!dictionarys.TryGetValue(_entity.VendId, out itm)) |
||||
|
{ |
||||
|
StringBuilder _buffer = new StringBuilder(); |
||||
|
_buffer.AppendFormat("订单编号【{0}】要货单号【{1}】零件号【{2}】零件名称【{3}】本次减产数量【{4}】累计减产数量【{5}】;<br>", _entity.PoBillNum, _entity.AskBillNum, _entity.PartCode, _entity.PartDesc1 + _entity.PartDesc2, _out.ToString(), _entity.ReduceQty.ToString(), Environment.NewLine); |
||||
|
dictionarys.Add(_entity.VendId, _buffer); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
itm.AppendFormat("订单编号【{0}】要货单号【{1}】零件号【{2}】 零件名称【{3} 】本次减产数量【{4}】累计减产数量【{5}】;<br>", _entity.PoBillNum, _entity.AskBillNum, _entity.PartCode, _entity.PartDesc1 + _entity.PartDesc2, _out.ToString(), _entity.ReduceQty.ToString(), Environment.NewLine); |
||||
|
} |
||||
|
} |
||||
|
_askList.Add(_entity); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (_lineList.Count > 0) |
||||
|
{ |
||||
|
Alert.Show(string.Join("<br>", _lineList)); |
||||
|
return; |
||||
|
} |
||||
|
if (_askList.Count > 0) |
||||
|
{ |
||||
|
var ret = SCP_ASK_CONTROLLER.Update_ReduceQty(_askList); |
||||
|
if (ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
Alert.Show("减产成功!"); |
||||
|
BindDetail(); |
||||
|
foreach (var itm in dictionarys) |
||||
|
{ |
||||
|
SCP.Common.MailManager.SendMail(itm.Key, itm.Value.ToString(), "要货看板减产信息"); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
Alert.Show(string.Join("<br>", ret.MessageList)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
protected void Grid1_Sort(object sender, GridSortEventArgs e) |
||||
|
{ |
||||
|
Grid_V_TB_ASK_DETAIL.SortDirection = e.SortDirection; |
||||
|
Grid_V_TB_ASK_DETAIL.SortField = e.SortField; |
||||
|
BindDetail(); |
||||
|
} |
||||
|
public void SearchV_TB_ASK_DETAIL_VIEW(Action<IQueryable<V_TB_ASK_DETAIL>> p_action) |
||||
|
{ |
||||
|
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL(); |
||||
|
if (!string.IsNullOrEmpty(Request["AskBillNum"])) |
||||
|
{ |
||||
|
_entity.PartCode = Request["AskBillNum"]; |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(Request["PartCode"])) |
||||
|
{ |
||||
|
_entity.PartCode = Request["PartCode"]; |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(Request["State"])) |
||||
|
{ |
||||
|
_entity.State = int.Parse(Request["State"]); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(Request["VendName"])) |
||||
|
{ |
||||
|
_entity.State = int.Parse(Request["VendName"]); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(CurrentUser.Name)) |
||||
|
{ |
||||
|
if (CurrentUser.Name != "admin" && !CurrentUser.RoleList.Contains("采购部门主管")) |
||||
|
{ |
||||
|
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0) |
||||
|
{ |
||||
|
|
||||
|
if (CurrentUser.FactoryList.FirstOrDefault() == "0210") |
||||
|
{ |
||||
|
if (!CurrentUser.RoleList.Contains("要货看板所有记录")) |
||||
|
{ |
||||
|
_entity.CreateUser = CurrentUser.Name; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
_entity.UserInAddress = CurrentUser.FactoryList; |
||||
|
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) => |
||||
|
{ |
||||
|
if (_ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
p_action(_ret.Result); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
//protected void Grid_V_TB_ASK_DETAIL_RowDataBound(object sender, GridRowEventArgs e)
|
||||
|
//{
|
||||
|
// var itm = e.DataItem as V_TB_ASK_DETAIL;
|
||||
|
// if(itm.State == (int)AskState.Release|| itm.State == (int)AskState.New|| itm.State == (int)AskState.Reject)
|
||||
|
// {
|
||||
|
// FineUI.NumberBox numbox = (FineUI.NumberBox) Grid_V_TB_ASK_DETAIL.Rows[e.RowIndex].FindControl("NumberBox1");
|
||||
|
// numbox.Readonly = true;
|
||||
|
// }
|
||||
|
//}
|
||||
|
} |
||||
|
} |
@ -0,0 +1,125 @@ |
|||||
|
//------------------------------------------------------------------------------
|
||||
|
// <自动生成>
|
||||
|
// 此代码由工具生成。
|
||||
|
//
|
||||
|
// 对此文件的更改可能导致不正确的行为,如果
|
||||
|
// 重新生成代码,则所做更改将丢失。
|
||||
|
// </自动生成>
|
||||
|
//------------------------------------------------------------------------------
|
||||
|
|
||||
|
namespace SCP.Views.沈阳金杯.PlanData |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
public partial class SCP_ASK_DETAIL_PARTCODE |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// form1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Panel1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Panel Panel1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Toolbar2 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Toolbar Toolbar2; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// BTN_refresh 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Button BTN_refresh; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// btnReduce 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Button btnReduce; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Grid_V_TB_ASK_DETAIL 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.Grid Grid_V_TB_ASK_DETAIL; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// ToolbarSeparator1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.ToolbarSeparator ToolbarSeparator1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// ToolbarText1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.ToolbarText ToolbarText1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// ddlGridPageSize 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.DropDownList ddlGridPageSize; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// NB_PublishNum 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::System.Web.UI.WebControls.TextBox NB_PublishNum; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// NumberBox1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.NumberBox NumberBox1; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// DatePicker1 控件。
|
||||
|
/// </summary>
|
||||
|
/// <remarks>
|
||||
|
/// 自动生成的字段。
|
||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
|
/// </remarks>
|
||||
|
protected global::FineUI.DatePicker DatePicker1; |
||||
|
} |
||||
|
} |
@ -0,0 +1,101 @@ |
|||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_FORECAST.aspx.cs" Inherits="SCP.Views.沈阳金杯.PlanData.SCP_FORECAST" %> |
||||
|
|
||||
|
<!DOCTYPE html> |
||||
|
|
||||
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
|
<head runat="server"> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
||||
|
<title></title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<form id="form1" runat="server"> |
||||
|
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> |
||||
|
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"> |
||||
|
<Items> |
||||
|
<f:Form runat="server"> |
||||
|
<Toolbars> |
||||
|
<f:Toolbar ID="Toolbar1" runat="server"> |
||||
|
<Items> |
||||
|
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> |
||||
|
</f:ToolbarSeparator> |
||||
|
<f:Button ID="btnRefresh" runat="server" Text="刷新" EnablePostBack="True" Icon="Reload" OnClientClick="location.reload();"> |
||||
|
</f:Button> |
||||
|
<f:Button ID="btnSave" runat="server" Hidden="true" Text="确认" Icon="BulletTick" OnClick="btnSave_Click" ></f:Button> |
||||
|
<f:Button ID="btnCancleSave" runat="server" Hidden="true" Text="取消确认" Icon="BulletCross" OnClick="BtnCancleSave_Click" OnClientClick="if(!confirm('是否取消确认?'))return false;"></f:Button> |
||||
|
<f:Button ID="btnDelete" runat="server" Text="删除" Icon="CssDelete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否删除?'))return false;" ></f:Button> |
||||
|
<f:ToolbarSeparator runat="server" /> |
||||
|
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload> |
||||
|
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click"> |
||||
|
</f:Button> |
||||
|
</Items> |
||||
|
</f:Toolbar> |
||||
|
</Toolbars> |
||||
|
</f:Form> |
||||
|
<f:Form BodyPadding="10px" Height="50px" ID="extForm1" |
||||
|
runat="server" Title="" ShowHeader="false"> |
||||
|
<Rows> |
||||
|
<f:FormRow ColumnWidths="33% 33% 33% 33%" ID="FormRow_2" runat="server"> |
||||
|
<Items> |
||||
|
<f:TextBox runat="server" Label="零件号" ID="TextPartCode"> |
||||
|
</f:TextBox> |
||||
|
<f:TextBox runat="server" Label="供应商编码" ID="TextVendId"> |
||||
|
</f:TextBox> |
||||
|
<f:DropDownList ID="ddl_Day" runat="server" Label="查询月份"> |
||||
|
<f:ListItem Text="全部" Value="0" Selected="true" /> |
||||
|
<f:ListItem Text="1月" Value="1" /> |
||||
|
<f:ListItem Text="2月" Value="2" /> |
||||
|
<f:ListItem Text="3月" Value="3" /> |
||||
|
<f:ListItem Text="4月" Value="4" /> |
||||
|
<f:ListItem Text="5月" Value="5" /> |
||||
|
<f:ListItem Text="6月" Value="6" /> |
||||
|
<f:ListItem Text="7月" Value="7" /> |
||||
|
<f:ListItem Text="8月" Value="8" /> |
||||
|
<f:ListItem Text="9月" Value="9" /> |
||||
|
<f:ListItem Text="10月" Value="10" /> |
||||
|
<f:ListItem Text="11月" Value="11" /> |
||||
|
<f:ListItem Text="12月" Value="12" /> |
||||
|
</f:DropDownList> |
||||
|
<f:DropDownList runat="server" ID="DDL_State" Label="状态"> |
||||
|
<f:ListItem Text="-" Value=""/> |
||||
|
<f:ListItem Text="新建" Value="0" /> |
||||
|
<f:ListItem Text="已确认" Value="1" /> |
||||
|
</f:DropDownList> |
||||
|
<f:Button runat="server" ID="Button1" Text="查询" OnClick="btnSearch_Click"></f:Button> |
||||
|
</Items> |
||||
|
</f:FormRow> |
||||
|
</Rows> |
||||
|
</f:Form> |
||||
|
<f:Grid ID="Grid_V_TB_FORECAST" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableCheckBoxSelect="true" |
||||
|
runat="server" DataKeyNames="UID,PartCode,Month,MonthQty1,MonthQty2,MonthQty3,State,CreateUser,CreateTime" |
||||
|
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_FORECAST_PageIndexChange" |
||||
|
AutoScroll="True" EnableRowDoubleClickEvent="True" OnSort="Grid_V_TB_FORECAST_Sort" AllowSorting="true"> |
||||
|
<PageItems> |
||||
|
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server"> |
||||
|
</f:ToolbarSeparator> |
||||
|
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:"> |
||||
|
</f:ToolbarText> |
||||
|
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" |
||||
|
runat="server"> |
||||
|
<f:ListItem Text="100" Value="100" /> |
||||
|
<f:ListItem Text="200" Value="200" /> |
||||
|
</f:DropDownList> |
||||
|
</PageItems> |
||||
|
<Columns> |
||||
|
<f:BoundField runat="server" SortField="UID" HeaderText="UID" Hidden="true" ColumnID="" DataField="UID" /> |
||||
|
<f:BoundField runat="server" SortField="State_DESC" HeaderText="状态" ColumnID="" DataField="State_DESC" /> |
||||
|
<f:BoundField runat="server" SortField="VendId" HeaderText="供应商编号" ColumnID="" DataField="VendId" /> |
||||
|
<f:BoundField runat="server" SortField="PartCode" HeaderText="零件编号" ColumnID="" DataField="PartCode" /> |
||||
|
<f:BoundField runat="server" SortField="Month" HeaderText="月份" ColumnID="" DataField="Month" /> |
||||
|
<f:BoundField runat="server" HeaderText="N+1" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty1" /> |
||||
|
<f:BoundField runat="server" HeaderText="N+2" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty2" /> |
||||
|
<f:BoundField runat="server" HeaderText="N+3" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty3" /> |
||||
|
<f:BoundField runat="server" SortField="State" HeaderText="状态" Hidden="true" ColumnID="" DataField="State" /> |
||||
|
<f:BoundField runat="server" SortField="CreateUser" HeaderText="创建者" ColumnID="" DataField="CreateUser" /> |
||||
|
<f:BoundField Width="100px" SortField="CreateTime" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期" /> |
||||
|
</Columns> |
||||
|
</f:Grid> |
||||
|
</Items> |
||||
|
</f:Panel> |
||||
|
</form> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,245 @@ |
|||||
|
using CK.SCP.Controller; |
||||
|
using CK.SCP.Models.ScpEntity; |
||||
|
using CK.SCP.Models.ScpEntity.ExcelExportEnttity; |
||||
|
using CK.SCP.Utils; |
||||
|
using FineUI; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Data; |
||||
|
using System.IO; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.UI; |
||||
|
using System.Web.UI.WebControls; |
||||
|
using CK.SCP.Models.Enums; |
||||
|
|
||||
|
namespace SCP.Views.沈阳金杯.PlanData |
||||
|
{ |
||||
|
public partial class SCP_FORECAST : PageBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 页面加载
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void Page_Load(object sender, EventArgs e) |
||||
|
{ |
||||
|
if (!IsPostBack) |
||||
|
{ |
||||
|
LoadData(); |
||||
|
} |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 加载数据
|
||||
|
/// </summary>
|
||||
|
public void LoadData() |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 数据绑定
|
||||
|
/// </summary>
|
||||
|
public void BindData() |
||||
|
{ |
||||
|
SearchV_TB_FORECAST_Data((result) => |
||||
|
{ |
||||
|
Grid_V_TB_FORECAST.RecordCount = result.Count(); |
||||
|
var list = SortAndPage<V_TB_FORECAST>(result, Grid_V_TB_FORECAST); |
||||
|
Grid_V_TB_FORECAST.DataSource = list; |
||||
|
Grid_V_TB_FORECAST.DataBind(); |
||||
|
}); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 获取数据
|
||||
|
/// </summary>
|
||||
|
/// <param name="p_action"></param>
|
||||
|
public void SearchV_TB_FORECAST_Data(Action<IQueryable<V_TB_FORECAST>> p_action) |
||||
|
{ |
||||
|
V_TB_FORECAST _entity = new V_TB_FORECAST(); |
||||
|
_entity.IsDeleted = false; |
||||
|
if (!string.IsNullOrEmpty(TextPartCode.Text)) |
||||
|
{ |
||||
|
_entity.PartCode = TextPartCode.Text; |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(TextVendId.Text)) |
||||
|
{ |
||||
|
_entity.VendId = TextVendId.Text; |
||||
|
} |
||||
|
if (ddl_Day.SelectedValue != "0") |
||||
|
{ |
||||
|
_entity.Month = ddl_Day.SelectedValue; |
||||
|
} |
||||
|
_entity.UserInAddress = CurrentUser.FactoryList; |
||||
|
_entity.UserInVendIds = CurrentUser.VenderList; |
||||
|
if (!string.IsNullOrEmpty(DDL_State.SelectedValue)) |
||||
|
{ |
||||
|
_entity.BillStateList = new List<int>() { int.Parse(DDL_State.SelectedValue) }; |
||||
|
} |
||||
|
SCP_FORECAST_CONTROLLER.Get_V_TB_FORECAST_List(_entity, (_ret) => |
||||
|
{ |
||||
|
if (_ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
p_action(_ret.Result); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 查询
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void btnSearch_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) |
||||
|
{ |
||||
|
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
||||
|
BindData(); |
||||
|
} |
||||
|
protected void Grid_V_TB_FORECAST_PageIndexChange(object sender, GridPageEventArgs e) |
||||
|
{ |
||||
|
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); |
||||
|
BindData(); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 导入
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void btnInput_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
string _fileName = FileUp.FileName; |
||||
|
if (string.IsNullOrEmpty(_fileName)) |
||||
|
{ |
||||
|
Alert.Show("选择文件为空!"); |
||||
|
return; |
||||
|
} |
||||
|
string _lx = _fileName.Split('.')[1]; |
||||
|
Stream _stream = FileUp.PostedFile.InputStream; |
||||
|
DataTable _dt = new DataTable(); |
||||
|
if (_lx == "xls") |
||||
|
{ |
||||
|
_dt = ExcelHelper.GetDataTable(_stream); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_dt = ExcelHelper.GetDataTableOfXlsx(_stream); |
||||
|
} |
||||
|
var list = ConvertHelper.ToList<SCP_FORECAST_EXPORT_SYJB>(ExcelHelper.RemoveEmpty(_dt)).ToList(); |
||||
|
var ret = SCP_FORECAST_CONTROLLER.EXCEL_FORECAST_MOD_SYJB(list, CurrentUser.Name, CurrentUser.FactoryList[0]); |
||||
|
if (ret.State == ReturnStatus.Succeed && ret.Result == true) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
Alert.Show(string.Join("<br>", ret.MessageList)); |
||||
|
} |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
Alert.Show(ex.Message); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 确认数据
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void btnSave_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray; |
||||
|
List<long> _UidList = new List<long>(); |
||||
|
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++) |
||||
|
{ |
||||
|
if (_selections.Contains(i)) |
||||
|
{ |
||||
|
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i]; |
||||
|
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
||||
|
{ |
||||
|
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Confirm); |
||||
|
if (ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
Alert.Show(ret.Message); |
||||
|
} |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 删除数据
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void btnDelete_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray; |
||||
|
List<long> _UidList = new List<long>(); |
||||
|
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++) |
||||
|
{ |
||||
|
if (_selections.Contains(i)) |
||||
|
{ |
||||
|
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i]; |
||||
|
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
||||
|
{ |
||||
|
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Reject); |
||||
|
if (ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
Alert.Show(ret.Message); |
||||
|
} |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 取消确认
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void BtnCancleSave_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray; |
||||
|
List<long> _UidList = new List<long>(); |
||||
|
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++) |
||||
|
{ |
||||
|
if (_selections.Contains(i)) |
||||
|
{ |
||||
|
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i]; |
||||
|
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString())) |
||||
|
{ |
||||
|
_UidList.Add(long.Parse(rowDataKeys[0].ToString())); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.New); |
||||
|
if (ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
BindData(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
Alert.Show(ret.Message); |
||||
|
} |
||||
|
} |
||||
|
protected void Grid_V_TB_FORECAST_Sort(object sender, GridSortEventArgs e) |
||||
|
{ |
||||
|
Grid_V_TB_FORECAST.SortDirection = e.SortDirection; |
||||
|
Grid_V_TB_FORECAST.SortField = e.SortField; |
||||
|
BindData(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PRODUCT_DETAIL.aspx.cs" Inherits="SCP.Views.沈阳金杯.PlanData.SCP_PRODUCT_DETAIL" %> |
||||
|
|
||||
|
<!DOCTYPE html> |
||||
|
|
||||
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
|
<head runat="server"> |
||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
||||
|
<title></title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<form id="form1" runat="server"> |
||||
|
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" /> |
||||
|
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox"> |
||||
|
<Items> |
||||
|
<f:Form runat="server"> |
||||
|
<Toolbars> |
||||
|
<f:Toolbar ID="Toolbar2" runat="server"> |
||||
|
<Items> |
||||
|
<f:Label ID="Label2" LabelWidth="60px" runat="server" Label="零件号"> |
||||
|
</f:Label> |
||||
|
<f:TextBox ID="txtPartcode" runat="server" Label="" Text=""> |
||||
|
</f:TextBox> |
||||
|
<f:Button ID="btnSearch" runat="server" Text="查找" OnClick="btnSearch_Click" Icon="SystemSearch"> |
||||
|
</f:Button> |
||||
|
<f:Button ID="Button1" runat="server" Text="导出" OnClick="btnOutput_Click" Icon="PageExcel"> |
||||
|
</f:Button> |
||||
|
</Items> |
||||
|
</f:Toolbar> |
||||
|
</Toolbars> |
||||
|
</f:Form> |
||||
|
<f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="false" Title="" ShowHeader="False" SortField="UID" BoxFlex="1" |
||||
|
AllowPaging="true" PageSize="20" IsDatabasePaging="true" OnPageIndexChange="Grid1_PageIndexChange" |
||||
|
ShowBorder="False" AllowSorting="true" DataKeyNames="UID,PartCode,PartDesc1,VendId,qty"> |
||||
|
<Columns> |
||||
|
<f:BoundField SortField="UID" DataField="UID" Width="250px" Hidden="true" HeaderText="UID" ColumnID="UID" /> |
||||
|
<f:BoundField SortField="PartCode" DataField="PartCode" Width="250px" HeaderText="零件号" ColumnID="PartCode" /> |
||||
|
<f:BoundField SortField="PartDesc1" DataField="PartDesc1" Width="250px" HeaderText="零件名称" ColumnID="PartDesc1" /> |
||||
|
<f:BoundField SortField="VendId" DataField="VendId" HeaderText="供应商编号" Width="250px" ColumnID="VendId" /> |
||||
|
<f:BoundField SortField="qty" DataField="qty" HeaderText="库存数量" Width="250px" ColumnID="qty" DataFormatString="{0:#.####}" /> |
||||
|
</Columns> |
||||
|
</f:Grid> |
||||
|
</Items> |
||||
|
</f:Panel> |
||||
|
<f:Window ID="Window1" runat="server" Hidden="True" |
||||
|
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true" |
||||
|
IFrameUrl="about:blank" Height="400px" Width="700px"> |
||||
|
</f:Window> |
||||
|
<script type="text/javascript"> |
||||
|
</script> |
||||
|
</form> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,102 @@ |
|||||
|
using ChangKeTec.Wms.Models.Wms; |
||||
|
using CK.SCP.Controller; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
|
||||
|
namespace SCP.Views.沈阳金杯.PlanData |
||||
|
{ |
||||
|
public partial class SCP_PRODUCT_DETAIL : PageBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 页面加载
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void Page_Load(object sender, EventArgs e) |
||||
|
{ |
||||
|
if (!IsPostBack) |
||||
|
{ |
||||
|
BindDetail(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 数据绑定
|
||||
|
/// </summary>
|
||||
|
public void BindDetail() |
||||
|
{ |
||||
|
SearchV_TB_ASN_DETAILData((ret) => |
||||
|
{ |
||||
|
Grid1.RecordCount = ret.Count(); |
||||
|
|
||||
|
var list = SortAndPage<VIEW_STOCK_VEND>(ret, Grid1); |
||||
|
Grid1.DataSource = list; |
||||
|
Grid1.DataBind(); |
||||
|
}); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 获取数据
|
||||
|
/// </summary>
|
||||
|
/// <param name="p_action"></param>
|
||||
|
public void SearchV_TB_ASN_DETAILData(Action<IQueryable<VIEW_STOCK_VEND>> p_action) |
||||
|
{ |
||||
|
VIEW_STOCK_VEND _entity = new VIEW_STOCK_VEND(); |
||||
|
_entity.PartCode = txtPartcode.Text; |
||||
|
_entity.UserInVendIds = CurrentUser.VenderList; |
||||
|
SCP_WMS_CONTROLLER.Get_VIEW_STOCK_DETAIL(_entity, (_ret) => |
||||
|
{ |
||||
|
if (_ret.State == ReturnStatus.Succeed) |
||||
|
{ |
||||
|
p_action(_ret.Result); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 查询
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void btnSearch_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
BindDetail(); |
||||
|
} |
||||
|
|
||||
|
protected void Grid1_PageIndexChange(object sender, FineUI.GridPageEventArgs e) |
||||
|
{ |
||||
|
BindDetail(); |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 导出
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
protected void btnOutput_Click(object sender, EventArgs e) |
||||
|
{ |
||||
|
List<VIEW_STOCK_VEND> _ls = new List<VIEW_STOCK_VEND>(); |
||||
|
for (int i = 0, count = Grid1.Rows.Count; i < count; i++) |
||||
|
{ |
||||
|
VIEW_STOCK_VEND inv = new VIEW_STOCK_VEND(); |
||||
|
|
||||
|
object[] rowDataKeys = Grid1.DataKeys[i]; |
||||
|
inv.PartCode = rowDataKeys[1].ToString();//零件号
|
||||
|
inv.PartDesc1 = rowDataKeys[2].ToString();//零件名称
|
||||
|
inv.VendId = rowDataKeys[3].ToString();//供应商编码
|
||||
|
if (rowDataKeys[4] != null) |
||||
|
{ |
||||
|
inv.qty = decimal.Parse(rowDataKeys[4].ToString());//数量
|
||||
|
} |
||||
|
_ls.Add(inv); |
||||
|
} |
||||
|
Dictionary<string, string> cellheader = new Dictionary<string, string> |
||||
|
{ |
||||
|
{ "PartCode", "零件号" }, |
||||
|
{ "PartDesc1", "零件名称" }, |
||||
|
{ "VendId", "供应商编号" }, |
||||
|
{ "qty", "库存数量" } |
||||
|
}; |
||||
|
string url = EntityListToExcel2003(cellheader, _ls, "库存明细"); |
||||
|
} |
||||
|
} |
||||
|
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue