张松男
6 months ago
44 changed files with 5904 additions and 284 deletions
@ -0,0 +1,205 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using QMAPP.BLL; |
||||
|
using QMAPP.Entity; |
||||
|
using QMFrameWork.Data; |
||||
|
using QMFrameWork.Log; |
||||
|
using QMAPP.FJC.Entity.Dianjian; |
||||
|
using QMAPP.FJC.DAL.Dianjian; |
||||
|
|
||||
|
namespace QMAPP.FJC.BLL.Dianjian |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 模块名称:注塑料筒信息
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2021年07月13日
|
||||
|
/// </summary>
|
||||
|
public class PutMachineBLL : BaseBLL |
||||
|
{ |
||||
|
#region 获取信息
|
||||
|
/// <summary>
|
||||
|
/// 获取信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">条件</param>
|
||||
|
/// <returns>信息</returns>
|
||||
|
public DataResult<PutMachine> Get(PutMachine model) |
||||
|
{ |
||||
|
DataResult<PutMachine> result = new DataResult<PutMachine>(); |
||||
|
try |
||||
|
{ |
||||
|
result.Result = new PutMachineDAL().Get(model); |
||||
|
result.IsSuccess = true; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "获取异常!" |
||||
|
}); |
||||
|
result.IsSuccess = false; |
||||
|
result.Ex = ex; |
||||
|
result.Msg = "获取异常"; |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取列表
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <param name="page">数据页</param>
|
||||
|
/// <returns>数据页</returns>
|
||||
|
public DataResult<DataPage> GetList(PutMachine condition, DataPage page) |
||||
|
{ |
||||
|
DataResult<DataPage> result = new DataResult<DataPage>(); |
||||
|
try |
||||
|
{ |
||||
|
DataPage dataPage = new PutMachineDAL().GetList(condition, page); |
||||
|
|
||||
|
result.IsSuccess = true; |
||||
|
result.Result = dataPage; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "获取列表异常!" |
||||
|
}); |
||||
|
result.IsSuccess = false; |
||||
|
result.Ex = ex; |
||||
|
result.Msg = "获取列表异常!"; |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <returns>全部集合</returns>
|
||||
|
public List<PutMachine> GetAllList() |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
//获取信息列表
|
||||
|
return new PutMachineDAL().GetALL(); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "获取列表异常!" |
||||
|
}); |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 插入信息
|
||||
|
/// <summary>
|
||||
|
/// 插入信息(单表)
|
||||
|
/// </summary>
|
||||
|
/// <param name="">信息</param>
|
||||
|
/// <returns>插入行数</returns>
|
||||
|
public DataResult<int> Insert(PutMachine info) |
||||
|
{ |
||||
|
DataResult<int> result = new DataResult<int>(); |
||||
|
try |
||||
|
{ |
||||
|
//基本信息
|
||||
|
info.PID = Guid.NewGuid().ToString(); |
||||
|
PutMachineDAL cmdDAL = new PutMachineDAL(); |
||||
|
result.Result = cmdDAL.Insert(info); |
||||
|
result.IsSuccess = true; |
||||
|
return result; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 更新信息
|
||||
|
/// <summary>
|
||||
|
/// 更新信息
|
||||
|
/// </summary>
|
||||
|
/// <param name=""></param>
|
||||
|
/// <returns>更新行数</returns>
|
||||
|
public DataResult Update(PutMachine model) |
||||
|
{ |
||||
|
DataResult result = new DataResult(); |
||||
|
result.IsSuccess = true; |
||||
|
try |
||||
|
{ |
||||
|
PutMachine info = new PutMachineDAL().Get(model); |
||||
|
|
||||
|
//基本信息
|
||||
|
info.MachineCode = model.MachineCode; |
||||
|
info.Name = model.Name; |
||||
|
info.MachinePID = model.MachinePID; |
||||
|
info.Limit = model.Limit; |
||||
|
info.Floor = model.Floor; |
||||
|
info.SerialNumber = model.SerialNumber; |
||||
|
int temp = new PutMachineDAL().Update(info); |
||||
|
|
||||
|
if (temp == 0) |
||||
|
{ |
||||
|
result.IsSuccess = false; |
||||
|
result.Msg = "更新失败!"; |
||||
|
return result; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "更新异常!" |
||||
|
}); |
||||
|
result.IsSuccess = false; |
||||
|
result.Ex = ex; |
||||
|
result.Msg = "更新异常"; |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 删除
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 删除信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">信息</param>
|
||||
|
/// <returns>删除个数</returns>
|
||||
|
public int Delete(string model) |
||||
|
{ |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
count = new PutMachineDAL().Delete(model); |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,206 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using QMAPP.BLL; |
||||
|
using QMAPP.Entity; |
||||
|
using QMFrameWork.Data; |
||||
|
using QMFrameWork.Log; |
||||
|
using QMAPP.FJC.Entity.Dianjian; |
||||
|
using QMAPP.FJC.DAL.Dianjian; |
||||
|
|
||||
|
namespace QMAPP.FJC.BLL.Dianjian |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 模块名称:注塑料筒信息
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2021年07月13日
|
||||
|
/// </summary>
|
||||
|
public class PutMachineClassBLL : BaseBLL |
||||
|
{ |
||||
|
#region 获取信息
|
||||
|
/// <summary>
|
||||
|
/// 获取信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">条件</param>
|
||||
|
/// <returns>信息</returns>
|
||||
|
public DataResult<PutMachineClass> Get(PutMachineClass model) |
||||
|
{ |
||||
|
DataResult<PutMachineClass> result = new DataResult<PutMachineClass>(); |
||||
|
try |
||||
|
{ |
||||
|
result.Result = new PutMachineClassDAL().Get(model); |
||||
|
result.IsSuccess = true; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "获取异常!" |
||||
|
}); |
||||
|
result.IsSuccess = false; |
||||
|
result.Ex = ex; |
||||
|
result.Msg = "获取异常"; |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取列表
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <param name="page">数据页</param>
|
||||
|
/// <returns>数据页</returns>
|
||||
|
public DataResult<DataPage> GetList(PutMachineClass condition, DataPage page) |
||||
|
{ |
||||
|
DataResult<DataPage> result = new DataResult<DataPage>(); |
||||
|
try |
||||
|
{ |
||||
|
DataPage dataPage = new PutMachineClassDAL().GetList(condition, page); |
||||
|
|
||||
|
result.IsSuccess = true; |
||||
|
result.Result = dataPage; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "获取列表异常!" |
||||
|
}); |
||||
|
result.IsSuccess = false; |
||||
|
result.Ex = ex; |
||||
|
result.Msg = "获取列表异常!"; |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <returns>全部集合</returns>
|
||||
|
public List<PutMachineClass> GetAllList() |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
//获取信息列表
|
||||
|
return new PutMachineClassDAL().GetALL(); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "获取列表异常!" |
||||
|
}); |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 插入信息
|
||||
|
/// <summary>
|
||||
|
/// 插入信息(单表)
|
||||
|
/// </summary>
|
||||
|
/// <param name="">信息</param>
|
||||
|
/// <returns>插入行数</returns>
|
||||
|
public DataResult<int> Insert(PutMachineClass info) |
||||
|
{ |
||||
|
DataResult<int> result = new DataResult<int>(); |
||||
|
try |
||||
|
{ |
||||
|
//基本信息
|
||||
|
info.PID = Guid.NewGuid().ToString(); |
||||
|
PutMachineClassDAL cmdDAL = new PutMachineClassDAL(); |
||||
|
result.Result = cmdDAL.Insert(info); |
||||
|
result.IsSuccess = true; |
||||
|
return result; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 更新信息
|
||||
|
/// <summary>
|
||||
|
/// 更新信息
|
||||
|
/// </summary>
|
||||
|
/// <param name=""></param>
|
||||
|
/// <returns>更新行数</returns>
|
||||
|
public DataResult Update(PutMachineClass model) |
||||
|
{ |
||||
|
DataResult result = new DataResult(); |
||||
|
result.IsSuccess = true; |
||||
|
try |
||||
|
{ |
||||
|
PutMachineClass info = new PutMachineClassDAL().Get(model); |
||||
|
|
||||
|
//基本信息
|
||||
|
info.MachineCode = model.MachineCode; |
||||
|
info.Name = model.Name; |
||||
|
info.Content = model.Content; |
||||
|
info.Position = model.Position; |
||||
|
info.Methond = model.Methond; |
||||
|
info.Type = model.Type; |
||||
|
info.SerialNumber = model.SerialNumber; |
||||
|
int temp = new PutMachineClassDAL().Update(info); |
||||
|
|
||||
|
if (temp == 0) |
||||
|
{ |
||||
|
result.IsSuccess = false; |
||||
|
result.Msg = "更新失败!"; |
||||
|
return result; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "更新异常!" |
||||
|
}); |
||||
|
result.IsSuccess = false; |
||||
|
result.Ex = ex; |
||||
|
result.Msg = "更新异常"; |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 删除
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 删除信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">信息</param>
|
||||
|
/// <returns>删除个数</returns>
|
||||
|
public int Delete(string model) |
||||
|
{ |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
count = new PutMachineClassDAL().Delete(model); |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,201 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using QMAPP.BLL; |
||||
|
using QMAPP.Entity; |
||||
|
using QMFrameWork.Data; |
||||
|
using QMFrameWork.Log; |
||||
|
using QMAPP.FJC.Entity.Dianjian; |
||||
|
using QMAPP.FJC.DAL.Dianjian; |
||||
|
|
||||
|
namespace QMAPP.FJC.BLL.Dianjian |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 模块名称:注塑料筒信息
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2021年07月13日
|
||||
|
/// </summary>
|
||||
|
public class PutMachineValueBLL : BaseBLL |
||||
|
{ |
||||
|
#region 获取信息
|
||||
|
/// <summary>
|
||||
|
/// 获取信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">条件</param>
|
||||
|
/// <returns>信息</returns>
|
||||
|
public DataResult<PutMachineValue> Get(PutMachineValue model) |
||||
|
{ |
||||
|
DataResult<PutMachineValue> result = new DataResult<PutMachineValue>(); |
||||
|
try |
||||
|
{ |
||||
|
result.Result = new PutMachineValueDAL().Get(model); |
||||
|
result.IsSuccess = true; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "获取异常!" |
||||
|
}); |
||||
|
result.IsSuccess = false; |
||||
|
result.Ex = ex; |
||||
|
result.Msg = "获取异常"; |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取列表
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <param name="page">数据页</param>
|
||||
|
/// <returns>数据页</returns>
|
||||
|
public DataResult<DataPage> GetList(PutMachineValue condition, DataPage page) |
||||
|
{ |
||||
|
DataResult<DataPage> result = new DataResult<DataPage>(); |
||||
|
try |
||||
|
{ |
||||
|
DataPage dataPage = new PutMachineValueDAL().GetList(condition, page); |
||||
|
|
||||
|
result.IsSuccess = true; |
||||
|
result.Result = dataPage; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "获取列表异常!" |
||||
|
}); |
||||
|
result.IsSuccess = false; |
||||
|
result.Ex = ex; |
||||
|
result.Msg = "获取列表异常!"; |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <returns>全部集合</returns>
|
||||
|
public List<PutMachineValue> GetAllList() |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
//获取信息列表
|
||||
|
return new PutMachineValueDAL().GetALL(); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "获取列表异常!" |
||||
|
}); |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 插入信息
|
||||
|
/// <summary>
|
||||
|
/// 插入信息(单表)
|
||||
|
/// </summary>
|
||||
|
/// <param name="">信息</param>
|
||||
|
/// <returns>插入行数</returns>
|
||||
|
public DataResult<int> Insert(PutMachineValue info) |
||||
|
{ |
||||
|
DataResult<int> result = new DataResult<int>(); |
||||
|
try |
||||
|
{ |
||||
|
//基本信息
|
||||
|
info.PID = Guid.NewGuid().ToString(); |
||||
|
PutMachineValueDAL cmdDAL = new PutMachineValueDAL(); |
||||
|
result.Result = cmdDAL.Insert(info); |
||||
|
result.IsSuccess = true; |
||||
|
return result; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 更新信息
|
||||
|
/// <summary>
|
||||
|
/// 更新信息
|
||||
|
/// </summary>
|
||||
|
/// <param name=""></param>
|
||||
|
/// <returns>更新行数</returns>
|
||||
|
public DataResult Update(PutMachineValue model) |
||||
|
{ |
||||
|
DataResult result = new DataResult(); |
||||
|
result.IsSuccess = true; |
||||
|
try |
||||
|
{ |
||||
|
PutMachineValue info = new PutMachineValueDAL().Get(model); |
||||
|
|
||||
|
//基本信息
|
||||
|
info.MachineCode = model.MachineCode; |
||||
|
info.Name = model.Name; |
||||
|
int temp = new PutMachineValueDAL().Update(info); |
||||
|
|
||||
|
if (temp == 0) |
||||
|
{ |
||||
|
result.IsSuccess = false; |
||||
|
result.Msg = "更新失败!"; |
||||
|
return result; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
LogManager.LogHelper.Error(new LogInfo() |
||||
|
{ |
||||
|
ErrorInfo = ex, |
||||
|
Tag = ex.StackTrace, |
||||
|
Info = "更新异常!" |
||||
|
}); |
||||
|
result.IsSuccess = false; |
||||
|
result.Ex = ex; |
||||
|
result.Msg = "更新异常"; |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 删除
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 删除信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">信息</param>
|
||||
|
/// <returns>删除个数</returns>
|
||||
|
public int Delete(string model) |
||||
|
{ |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
count = new PutMachineValueDAL().Delete(model); |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,299 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using QMAPP.FJC.Entity.MD; |
||||
|
using QMFrameWork.Data; |
||||
|
using System.Data; |
||||
|
using QMAPP.FJC.Entity.Dianjian; |
||||
|
|
||||
|
namespace QMAPP.FJC.DAL.Dianjian |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 模块名称:注塑料筒信息
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2021年07月13日
|
||||
|
/// </summary>
|
||||
|
public class PutMachineClassDAL |
||||
|
{ |
||||
|
|
||||
|
#region 获取信息
|
||||
|
/// <summary>
|
||||
|
/// 获取信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">条件</param>
|
||||
|
/// <returns>*信息</returns>
|
||||
|
public PutMachineClass Get(PutMachineClass info) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//获取信息
|
||||
|
info = session.Get<PutMachineClass>(info); |
||||
|
} |
||||
|
return info; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">条件</param>
|
||||
|
/// <returns>*信息</returns>
|
||||
|
public PutMachineClass Get(string materialcode) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
string sql = "SELECT * FROM [T_MD_PutMachineClass] WHERE [MATERIAL_CODE]=@materialcode"; |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
parameters.Add(new DataParameter("materialcode", materialcode)); |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//获取信息
|
||||
|
var info = session.Get<PutMachineClass>(sql, parameters.ToArray()); |
||||
|
return info; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取列表
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <param name="page">数据页</param>
|
||||
|
/// <returns>数据页</returns>
|
||||
|
public DataPage GetList(PutMachineClass condition, DataPage page) |
||||
|
{ |
||||
|
string sql = null; |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
try |
||||
|
{ |
||||
|
sql = this.GetQuerySql(condition, ref parameters); |
||||
|
//分页关键字段及排序
|
||||
|
page.KeyName = "PID"; |
||||
|
if (string.IsNullOrEmpty(page.SortExpression)) |
||||
|
page.SortExpression = "MachineCode"; |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
page = session.GetDataPage<PutMachineClass>(sql, parameters.ToArray(), page); |
||||
|
} |
||||
|
return page; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <param name="page">数据页</param>
|
||||
|
/// <returns>数据页</returns>
|
||||
|
public List<PutMachineClass> GetALL() |
||||
|
{ |
||||
|
string sql = null; |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
try |
||||
|
{ |
||||
|
sql = "SELECT * FROM T_MD_PutMachineClass WHERE IsCheck<> '1'"; |
||||
|
//分页关键字段及排序
|
||||
|
var LIST = new List<PutMachineClass>(); |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
LIST = session.GetList<PutMachineClass>(sql, parameters.ToArray()).ToList(); |
||||
|
} |
||||
|
return LIST; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取查询语句
|
||||
|
/// <summary>
|
||||
|
/// 获取查询语句
|
||||
|
/// </summary>
|
||||
|
/// <param name="user">查询条件</param>
|
||||
|
/// <param name="parameters">参数</param>
|
||||
|
/// <returns>查询语句</returns>
|
||||
|
private string GetQuerySql(PutMachineClass condition, ref List<DataParameter> parameters) |
||||
|
{ |
||||
|
StringBuilder sqlBuilder = new StringBuilder(); |
||||
|
StringBuilder whereBuilder = new StringBuilder(); |
||||
|
try |
||||
|
{ |
||||
|
|
||||
|
//构成查询语句
|
||||
|
sqlBuilder.Append("SELECT PID,MachineCode,Name,Position,Content,Methond,CASE Type WHEN '1' THEN '单选' WHEN '2' THEN '填写单边值' WHEN '3' THEN '填写双边值' ELSE Type END AS 'Type', SerialNumber "); |
||||
|
sqlBuilder.Append("FROM T_MD_PutMachineClass "); |
||||
|
|
||||
|
|
||||
|
if (string.IsNullOrEmpty(condition.MachineCode) == false) |
||||
|
{ |
||||
|
whereBuilder.Append(" AND MachineCode = @MachineCode"); |
||||
|
parameters.Add(new DataParameter { ParameterName = "MachineCode", DataType = DbType.String, Value = condition.MachineCode }); |
||||
|
} |
||||
|
|
||||
|
if (string.IsNullOrEmpty(condition.Name) == false) |
||||
|
{ |
||||
|
whereBuilder.Append(" AND Name like @Name"); |
||||
|
parameters.Add(new DataParameter { ParameterName = "Name", DataType = DbType.String, Value = "%"+ condition.Name+"%" }); |
||||
|
} |
||||
|
|
||||
|
//查询条件
|
||||
|
if (whereBuilder.Length > 0) |
||||
|
{ |
||||
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4)); |
||||
|
} |
||||
|
return sqlBuilder.ToString(); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
|
||||
|
#region 信息是否重复
|
||||
|
/// <summary>
|
||||
|
/// 判断名称是否存在
|
||||
|
/// </summary>
|
||||
|
/// <param name="info"></param>
|
||||
|
/// <returns>true:已存在;fasel:不存在。</returns>
|
||||
|
public bool Exists(PutMachineClass info) |
||||
|
{ |
||||
|
StringBuilder sqlBuilder = new StringBuilder(); |
||||
|
StringBuilder whereBuilder = new StringBuilder(); |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
sqlBuilder.Append("SELECT COUNT(0) FROM T_MD_PutMachineClass"); |
||||
|
if (info.PID == null) |
||||
|
{ |
||||
|
info.PID = ""; |
||||
|
} |
||||
|
whereBuilder.Append(" AND PID <> @PID "); |
||||
|
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = info.PID }); |
||||
|
|
||||
|
//添加进行无重复字段判断代码
|
||||
|
|
||||
|
if (whereBuilder.Length > 0) |
||||
|
{ |
||||
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4)); |
||||
|
} |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
count = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), parameters.ToArray())); |
||||
|
} |
||||
|
return count > 0; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 插入信息
|
||||
|
/// <summary>
|
||||
|
/// 插入信息(单表)
|
||||
|
/// </summary>
|
||||
|
/// <param name="">信息</param>
|
||||
|
/// <returns>插入行数</returns>
|
||||
|
public int Insert(PutMachineClass info) |
||||
|
{ |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//插入基本信息
|
||||
|
count = session.Insert<PutMachineClass>(info); |
||||
|
} |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 更新信息
|
||||
|
/// <summary>
|
||||
|
/// 更新信息
|
||||
|
/// </summary>
|
||||
|
/// <param name=""></param>
|
||||
|
/// <returns>更新行数</returns>
|
||||
|
public int Update(PutMachineClass info) |
||||
|
{ |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//更新基本信息
|
||||
|
count = session.Update<PutMachineClass>(info); |
||||
|
} |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 逻辑删除
|
||||
|
/// <summary>
|
||||
|
/// 逻辑删除信息
|
||||
|
/// </summary>
|
||||
|
/// <param name=""></param>
|
||||
|
/// <returns>删除个数</returns>
|
||||
|
public int Delete(string info) |
||||
|
{ |
||||
|
StringBuilder sqlBuilder = new StringBuilder(); |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//删除基本信息
|
||||
|
sqlBuilder.Append("delete T_MD_PutMachineClass "); |
||||
|
sqlBuilder.Append("WHERE PID = @PID "); |
||||
|
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = info }); |
||||
|
count = session.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray()); |
||||
|
} |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,289 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using QMAPP.FJC.Entity.MD; |
||||
|
using QMFrameWork.Data; |
||||
|
using System.Data; |
||||
|
using QMAPP.FJC.Entity.Dianjian; |
||||
|
|
||||
|
namespace QMAPP.FJC.DAL.Dianjian |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 模块名称:注塑料筒信息
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2021年07月13日
|
||||
|
/// </summary>
|
||||
|
public class PutMachineDAL |
||||
|
{ |
||||
|
|
||||
|
#region 获取信息
|
||||
|
/// <summary>
|
||||
|
/// 获取信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">条件</param>
|
||||
|
/// <returns>*信息</returns>
|
||||
|
public PutMachine Get(PutMachine info) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//获取信息
|
||||
|
info = session.Get<PutMachine>(info); |
||||
|
} |
||||
|
return info; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">条件</param>
|
||||
|
/// <returns>*信息</returns>
|
||||
|
public PutMachine Get(string materialcode) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
string sql = "SELECT * FROM [T_MD_PutMachine] WHERE [MATERIAL_CODE]=@materialcode"; |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
parameters.Add(new DataParameter("materialcode", materialcode)); |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//获取信息
|
||||
|
var info = session.Get<PutMachine>(sql, parameters.ToArray()); |
||||
|
return info; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取列表
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <param name="page">数据页</param>
|
||||
|
/// <returns>数据页</returns>
|
||||
|
public DataPage GetList(PutMachine condition, DataPage page) |
||||
|
{ |
||||
|
string sql = null; |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
try |
||||
|
{ |
||||
|
sql = this.GetQuerySql(condition, ref parameters); |
||||
|
//分页关键字段及排序
|
||||
|
page.KeyName = "PID"; |
||||
|
if (string.IsNullOrEmpty(page.SortExpression)) |
||||
|
page.SortExpression = "MachinePID"; |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
page = session.GetDataPage<PutMachine>(sql, parameters.ToArray(), page); |
||||
|
} |
||||
|
return page; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <param name="page">数据页</param>
|
||||
|
/// <returns>数据页</returns>
|
||||
|
public List<PutMachine> GetALL() |
||||
|
{ |
||||
|
string sql = null; |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
try |
||||
|
{ |
||||
|
sql = "SELECT * FROM T_MD_PutMachine WHERE IsCheck<> '1'"; |
||||
|
//分页关键字段及排序
|
||||
|
var LIST = new List<PutMachine>(); |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
LIST = session.GetList<PutMachine>(sql, parameters.ToArray()).ToList(); |
||||
|
} |
||||
|
return LIST; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取查询语句
|
||||
|
/// <summary>
|
||||
|
/// 获取查询语句
|
||||
|
/// </summary>
|
||||
|
/// <param name="user">查询条件</param>
|
||||
|
/// <param name="parameters">参数</param>
|
||||
|
/// <returns>查询语句</returns>
|
||||
|
private string GetQuerySql(PutMachine condition, ref List<DataParameter> parameters) |
||||
|
{ |
||||
|
StringBuilder sqlBuilder = new StringBuilder(); |
||||
|
StringBuilder whereBuilder = new StringBuilder(); |
||||
|
try |
||||
|
{ |
||||
|
|
||||
|
//构成查询语句
|
||||
|
sqlBuilder.Append("SELECT PID,MachinePID,Name,Limit,Floor,SerialNumber,MachineCode "); |
||||
|
sqlBuilder.Append("FROM T_MD_PutMachine "); |
||||
|
|
||||
|
|
||||
|
if (string.IsNullOrEmpty(condition.MachinePID) == false) |
||||
|
{ |
||||
|
whereBuilder.Append(" AND MachinePID = @MachinePID"); |
||||
|
parameters.Add(new DataParameter { ParameterName = "MachinePID", DataType = DbType.String, Value = condition.MachinePID }); |
||||
|
} |
||||
|
|
||||
|
//查询条件
|
||||
|
if (whereBuilder.Length > 0) |
||||
|
{ |
||||
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4)); |
||||
|
} |
||||
|
return sqlBuilder.ToString(); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 信息是否重复
|
||||
|
/// <summary>
|
||||
|
/// 判断名称是否存在
|
||||
|
/// </summary>
|
||||
|
/// <param name="info"></param>
|
||||
|
/// <returns>true:已存在;fasel:不存在。</returns>
|
||||
|
public bool Exists(PutMachine info) |
||||
|
{ |
||||
|
StringBuilder sqlBuilder = new StringBuilder(); |
||||
|
StringBuilder whereBuilder = new StringBuilder(); |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
sqlBuilder.Append("SELECT COUNT(0) FROM T_MD_PutMachine"); |
||||
|
if (info.PID == null) |
||||
|
{ |
||||
|
info.PID = ""; |
||||
|
} |
||||
|
whereBuilder.Append(" AND PID <> @PID "); |
||||
|
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = info.PID }); |
||||
|
|
||||
|
//添加进行无重复字段判断代码
|
||||
|
|
||||
|
if (whereBuilder.Length > 0) |
||||
|
{ |
||||
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4)); |
||||
|
} |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
count = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), parameters.ToArray())); |
||||
|
} |
||||
|
return count > 0; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 插入信息
|
||||
|
/// <summary>
|
||||
|
/// 插入信息(单表)
|
||||
|
/// </summary>
|
||||
|
/// <param name="">信息</param>
|
||||
|
/// <returns>插入行数</returns>
|
||||
|
public int Insert(PutMachine info) |
||||
|
{ |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//插入基本信息
|
||||
|
count = session.Insert<PutMachine>(info); |
||||
|
} |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 更新信息
|
||||
|
/// <summary>
|
||||
|
/// 更新信息
|
||||
|
/// </summary>
|
||||
|
/// <param name=""></param>
|
||||
|
/// <returns>更新行数</returns>
|
||||
|
public int Update(PutMachine info) |
||||
|
{ |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//更新基本信息
|
||||
|
count = session.Update<PutMachine>(info); |
||||
|
} |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 逻辑删除
|
||||
|
/// <summary>
|
||||
|
/// 逻辑删除信息
|
||||
|
/// </summary>
|
||||
|
/// <param name=""></param>
|
||||
|
/// <returns>删除个数</returns>
|
||||
|
public int Delete(string info) |
||||
|
{ |
||||
|
StringBuilder sqlBuilder = new StringBuilder(); |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//删除基本信息
|
||||
|
sqlBuilder.Append("delete T_MD_PutMachine "); |
||||
|
sqlBuilder.Append("WHERE PID = @PID "); |
||||
|
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = info }); |
||||
|
count = session.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray()); |
||||
|
} |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,290 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using QMAPP.FJC.Entity.MD; |
||||
|
using QMFrameWork.Data; |
||||
|
using System.Data; |
||||
|
using QMAPP.FJC.Entity.Dianjian; |
||||
|
|
||||
|
namespace QMAPP.FJC.DAL.Dianjian |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 模块名称:注塑料筒信息
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2021年07月13日
|
||||
|
/// </summary>
|
||||
|
public class PutMachineValueDAL |
||||
|
{ |
||||
|
|
||||
|
#region 获取信息
|
||||
|
/// <summary>
|
||||
|
/// 获取信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">条件</param>
|
||||
|
/// <returns>*信息</returns>
|
||||
|
public PutMachineValue Get(PutMachineValue info) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//获取信息
|
||||
|
info = session.Get<PutMachineValue>(info); |
||||
|
} |
||||
|
return info; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="">条件</param>
|
||||
|
/// <returns>*信息</returns>
|
||||
|
public PutMachineValue Get(string materialcode) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
string sql = "SELECT * FROM [T_MD_PutMachineValue] WHERE [MATERIAL_CODE]=@materialcode"; |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
parameters.Add(new DataParameter("materialcode", materialcode)); |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//获取信息
|
||||
|
var info = session.Get<PutMachineValue>(sql, parameters.ToArray()); |
||||
|
return info; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取列表
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <param name="page">数据页</param>
|
||||
|
/// <returns>数据页</returns>
|
||||
|
public DataPage GetList(PutMachineValue condition, DataPage page) |
||||
|
{ |
||||
|
string sql = null; |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
try |
||||
|
{ |
||||
|
sql = this.GetQuerySql(condition, ref parameters); |
||||
|
//分页关键字段及排序
|
||||
|
page.KeyName = "PID"; |
||||
|
if (string.IsNullOrEmpty(page.SortExpression)) |
||||
|
page.SortExpression = "CreateData desc"; |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
page = session.GetDataPage<PutMachineValue>(sql, parameters.ToArray(), page); |
||||
|
} |
||||
|
return page; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="condition">条件</param>
|
||||
|
/// <param name="page">数据页</param>
|
||||
|
/// <returns>数据页</returns>
|
||||
|
public List<PutMachineValue> GetALL() |
||||
|
{ |
||||
|
string sql = null; |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
try |
||||
|
{ |
||||
|
sql = "SELECT * FROM T_MD_PutMachineValue WHERE IsCheck<> '1'"; |
||||
|
//分页关键字段及排序
|
||||
|
var LIST = new List<PutMachineValue>(); |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
LIST = session.GetList<PutMachineValue>(sql, parameters.ToArray()).ToList(); |
||||
|
} |
||||
|
return LIST; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取查询语句
|
||||
|
/// <summary>
|
||||
|
/// 获取查询语句
|
||||
|
/// </summary>
|
||||
|
/// <param name="user">查询条件</param>
|
||||
|
/// <param name="parameters">参数</param>
|
||||
|
/// <returns>查询语句</returns>
|
||||
|
private string GetQuerySql(PutMachineValue condition, ref List<DataParameter> parameters) |
||||
|
{ |
||||
|
StringBuilder sqlBuilder = new StringBuilder(); |
||||
|
StringBuilder whereBuilder = new StringBuilder(); |
||||
|
try |
||||
|
{ |
||||
|
|
||||
|
//构成查询语句
|
||||
|
sqlBuilder.Append("SELECT PID,MachineCode,Name,CASE Type WHEN '1' THEN '单选' WHEN '2' THEN '填写单边值' WHEN '3' THEN '填写双边值' ELSE Type END AS 'Type',MValue,[Group],UserName,CreateData,Remark1,Remark2,Remark3,PValue "); |
||||
|
sqlBuilder.Append("FROM T_MD_PutMachineValue "); |
||||
|
|
||||
|
|
||||
|
|
||||
|
if (string.IsNullOrEmpty(condition.MachineCode) == false) |
||||
|
{ |
||||
|
whereBuilder.Append(" AND MachineCode = @MachineCode"); |
||||
|
parameters.Add(new DataParameter { ParameterName = "MachineCode", DataType = DbType.String, Value = condition.MachineCode }); |
||||
|
} |
||||
|
|
||||
|
//查询条件
|
||||
|
if (whereBuilder.Length > 0) |
||||
|
{ |
||||
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4)); |
||||
|
} |
||||
|
return sqlBuilder.ToString(); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 信息是否重复
|
||||
|
/// <summary>
|
||||
|
/// 判断名称是否存在
|
||||
|
/// </summary>
|
||||
|
/// <param name="info"></param>
|
||||
|
/// <returns>true:已存在;fasel:不存在。</returns>
|
||||
|
public bool Exists(PutMachineValue info) |
||||
|
{ |
||||
|
StringBuilder sqlBuilder = new StringBuilder(); |
||||
|
StringBuilder whereBuilder = new StringBuilder(); |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
sqlBuilder.Append("SELECT COUNT(0) FROM T_MD_PutMachineValue"); |
||||
|
if (info.PID == null) |
||||
|
{ |
||||
|
info.PID = ""; |
||||
|
} |
||||
|
whereBuilder.Append(" AND PID <> @PID "); |
||||
|
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = info.PID }); |
||||
|
|
||||
|
//添加进行无重复字段判断代码
|
||||
|
|
||||
|
if (whereBuilder.Length > 0) |
||||
|
{ |
||||
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4)); |
||||
|
} |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
count = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), parameters.ToArray())); |
||||
|
} |
||||
|
return count > 0; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 插入信息
|
||||
|
/// <summary>
|
||||
|
/// 插入信息(单表)
|
||||
|
/// </summary>
|
||||
|
/// <param name="">信息</param>
|
||||
|
/// <returns>插入行数</returns>
|
||||
|
public int Insert(PutMachineValue info) |
||||
|
{ |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//插入基本信息
|
||||
|
count = session.Insert<PutMachineValue>(info); |
||||
|
} |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 更新信息
|
||||
|
/// <summary>
|
||||
|
/// 更新信息
|
||||
|
/// </summary>
|
||||
|
/// <param name=""></param>
|
||||
|
/// <returns>更新行数</returns>
|
||||
|
public int Update(PutMachineValue info) |
||||
|
{ |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//更新基本信息
|
||||
|
count = session.Update<PutMachineValue>(info); |
||||
|
} |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 逻辑删除
|
||||
|
/// <summary>
|
||||
|
/// 逻辑删除信息
|
||||
|
/// </summary>
|
||||
|
/// <param name=""></param>
|
||||
|
/// <returns>删除个数</returns>
|
||||
|
public int Delete(string info) |
||||
|
{ |
||||
|
StringBuilder sqlBuilder = new StringBuilder(); |
||||
|
List<DataParameter> parameters = new List<DataParameter>(); |
||||
|
int count = 0; |
||||
|
try |
||||
|
{ |
||||
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
||||
|
{ |
||||
|
//删除基本信息
|
||||
|
sqlBuilder.Append("delete T_MD_PutMachineValue "); |
||||
|
sqlBuilder.Append("WHERE PID = @PID "); |
||||
|
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = info }); |
||||
|
count = session.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray()); |
||||
|
} |
||||
|
return count; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,61 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using QMFrameWork.Data.Attributes; |
||||
|
using QMAPP.Entity; |
||||
|
using System.Data; |
||||
|
|
||||
|
namespace QMAPP.FJC.Entity.Dianjian |
||||
|
{ |
||||
|
/// </summary>
|
||||
|
/// 模块名称:
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2024年05月20日
|
||||
|
/// </summary>
|
||||
|
[DBTable(TableName = "T_MD_PutMachine")] |
||||
|
public class PutMachine : BaseEntity |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)] |
||||
|
public string PID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检项PID
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "MachinePID", DataType = DbType.String)] |
||||
|
public string MachinePID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上限
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Limit", DataType = DbType.String)] |
||||
|
public string Limit { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 下限
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Floor", DataType = DbType.String)] |
||||
|
public string Floor { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 名称
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Name", DataType = DbType.String)] |
||||
|
public string Name { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 序号
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "SerialNumber", DataType = DbType.String)] |
||||
|
public string SerialNumber { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 设备编号
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "MachineCode", DataType = DbType.String)] |
||||
|
public string MachineCode { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using QMFrameWork.Data.Attributes; |
||||
|
using QMAPP.Entity; |
||||
|
using System.Data; |
||||
|
|
||||
|
namespace QMAPP.FJC.Entity.Dianjian |
||||
|
{ |
||||
|
/// </summary>
|
||||
|
/// 模块名称:
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2024年05月20日
|
||||
|
/// </summary>
|
||||
|
[DBTable(TableName = "T_MD_PutMachineClass")] |
||||
|
public class PutMachineClass : BaseEntity |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)] |
||||
|
public string PID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检编号
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "MachineCode", DataType = DbType.String)] |
||||
|
public string MachineCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 点检名称
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Name", DataType = DbType.String)] |
||||
|
public string Name { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 部位
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Position", DataType = DbType.String)] |
||||
|
public string Position { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 内容
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Content", DataType = DbType.String)] |
||||
|
public string Content { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 方法
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Methond", DataType = DbType.String)] |
||||
|
public string Methond { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 类型
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Type", DataType = DbType.String)] |
||||
|
public string Type { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 排序
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "SerialNumber", DataType = DbType.String)] |
||||
|
public string SerialNumber { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using QMFrameWork.Data.Attributes; |
||||
|
using QMAPP.Entity; |
||||
|
using System.Data; |
||||
|
|
||||
|
namespace QMAPP.FJC.Entity.Dianjian |
||||
|
{ |
||||
|
/// </summary>
|
||||
|
/// 模块名称:泡沫点检记录
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2024年05月20日
|
||||
|
/// </summary>
|
||||
|
[DBTable(TableName = "T_MD_PutMachineValue")] |
||||
|
public class PutMachineValue : BaseEntity |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)] |
||||
|
public string PID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 设备code
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "MachineCode", DataType = DbType.String)] |
||||
|
public string MachineCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 设备名称
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Name", DataType = DbType.String)] |
||||
|
public string Name { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检类型
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Type", DataType = DbType.String)] |
||||
|
public string Type { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检值1
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "MValue", DataType = DbType.String)] |
||||
|
public string MValue { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检值2
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "PValue", DataType = DbType.String)] |
||||
|
public string PValue { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 班组
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Group", DataType = DbType.String)] |
||||
|
public string Group { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检人
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "UserName", DataType = DbType.String)] |
||||
|
public string UserName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检时间
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "CreateData", DataType = DbType.String)] |
||||
|
public string CreateData { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备用字段
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Remark1", DataType = DbType.String)] |
||||
|
public string Remark1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备用字段
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Remark2", DataType = DbType.String)] |
||||
|
public string Remark2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备用字段
|
||||
|
/// </summary>
|
||||
|
[DBColumn(ColumnName = "Remark3", DataType = DbType.String)] |
||||
|
public string Remark3 { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,207 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.Mvc; |
||||
|
using QMAPP.Common.Web.Controllers; |
||||
|
using QMFrameWork.WebUI.Attribute; |
||||
|
using QMAPP.FJC.Web.Models.Basic; |
||||
|
using QMFrameWork.Data; |
||||
|
using QMAPP.FJC.Entity.Basic; |
||||
|
using QMAPP.ServicesAgent; |
||||
|
using QMAPP.Entity; |
||||
|
using QMAPP.MD.Entity; |
||||
|
using QMAPP.MD.Web.Models; |
||||
|
using QMFrameWork.WebUI.DataSource; |
||||
|
using QMFrameWork.Common.Serialization; |
||||
|
using QMAPP.FJC.Web.Models.Bucket; |
||||
|
using QMAPP.MD.Entity.Bucket; |
||||
|
using QMAPP.FJC.Web.Models.Dianjian; |
||||
|
using QMAPP.FJC.Entity.Dianjian; |
||||
|
|
||||
|
namespace QMAPP.FJC.Web.Controllers |
||||
|
{ |
||||
|
public class PutMachineClassController : QController |
||||
|
{ |
||||
|
#region 获取信息
|
||||
|
/// <summary>
|
||||
|
/// 加载列表
|
||||
|
/// </summary>
|
||||
|
/// <returns>结果</returns>
|
||||
|
[HandleException] |
||||
|
public ActionResult List(bool? callback) |
||||
|
{ |
||||
|
PutMachineClassModel seachModel = new PutMachineClassModel(); |
||||
|
if (callback == true) |
||||
|
TryGetSelectBuffer<PutMachineClassModel>(out seachModel); |
||||
|
seachModel.rownumbers = false; |
||||
|
seachModel.url = "/PutMachineClass/GetList"; |
||||
|
return View("PutMachineClassList", seachModel); |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取列表
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="callBack">是否回调</param>
|
||||
|
/// <returns>列表</returns>
|
||||
|
[HandleException] |
||||
|
public ActionResult GetList(bool? callBack) |
||||
|
{ |
||||
|
PutMachineClassModel seachModel = null; |
||||
|
DataPage page = null; |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
PutMachineClass condition = null; |
||||
|
DataResult<DataPage> pageResult = new DataResult<DataPage>(); |
||||
|
try |
||||
|
{ |
||||
|
//获取查询对象
|
||||
|
seachModel = GetModel<PutMachineClassModel>(); |
||||
|
#region 获取缓存值
|
||||
|
if (callBack != null) |
||||
|
{ |
||||
|
TryGetSelectBuffer<PutMachineClassModel>(out seachModel); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
//保存搜索条件
|
||||
|
SetSelectBuffer<PutMachineClassModel>(seachModel); |
||||
|
} |
||||
|
#endregion
|
||||
|
//获取前台分页设置信息
|
||||
|
page = this.GetDataPage(seachModel); |
||||
|
condition = CopyToModel<PutMachineClass, PutMachineClassModel>(seachModel); |
||||
|
#region wcf服务统一接口
|
||||
|
|
||||
|
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("PutMachineClassBLL_GetList", condition, page); |
||||
|
if (pageResult.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage(pageResult.Msg); |
||||
|
return List(true); |
||||
|
} |
||||
|
DateGridResult<PutMachineClass> result = new DateGridResult<PutMachineClass>(); |
||||
|
result.Total = pageResult.Result.RecordCount; |
||||
|
result.Rows = JsonConvertHelper.GetDeserialize<List<PutMachineClass>>(pageResult.Result.Result.ToString()); |
||||
|
#endregion
|
||||
|
return Content(result.GetJsonSource()); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 编辑
|
||||
|
/// <summary>
|
||||
|
/// 编辑载入
|
||||
|
/// </summary>
|
||||
|
/// <returns>处理结果</returns>
|
||||
|
[HandleException] |
||||
|
public ActionResult Edit() |
||||
|
{ |
||||
|
PutMachineClassModel model = new PutMachineClassModel(); |
||||
|
string ID = Request.Params["PID"]; |
||||
|
PutMachineClass Entity = new PutMachineClass(); |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
DataResult<PutMachineClass> result = new DataResult<PutMachineClass>(); |
||||
|
try |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(ID) == false) |
||||
|
{ |
||||
|
//修改获取原数据
|
||||
|
Entity.PID = ID; |
||||
|
result = wcfAgent.InvokeServiceFunction<DataResult<PutMachineClass>>("PutMachineClassBLL_Get", Entity); |
||||
|
if (result.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage(result.Msg); |
||||
|
return View("PutMachineClassEdit", model); |
||||
|
} |
||||
|
model = CopyToModel<PutMachineClassModel, PutMachineClass>(result.Result); |
||||
|
} |
||||
|
return View("PutMachineClassEdit", model); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 保存
|
||||
|
/// </summary>
|
||||
|
/// <param name="model"></param>
|
||||
|
/// <returns>处理结果</returns>
|
||||
|
[HttpPost] |
||||
|
[HandleException] |
||||
|
[ValidateInput(false)] |
||||
|
public ActionResult Save(PutMachineClassModel saveModel) |
||||
|
{ |
||||
|
PutMachineClass Entity = null; |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
DataResult<int> result = new DataResult<int>(); |
||||
|
try |
||||
|
{ |
||||
|
Entity = CopyToModel<PutMachineClass, PutMachineClassModel>(saveModel); |
||||
|
if (string.IsNullOrEmpty(Entity.PID) == true) |
||||
|
{ |
||||
|
//新增
|
||||
|
result = wcfAgent.InvokeServiceFunction<DataResult<int>>(QMAPP.ServicesAgent.DictService.PutMachineClassBLL_Insert.ToString(), Entity); |
||||
|
if (result.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage("工厂编码已存在!"); |
||||
|
return View("PutMachineClassEdit", saveModel); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
//修改
|
||||
|
result = wcfAgent.InvokeServiceFunction<DataResult<int>>(QMAPP.ServicesAgent.DictService.PutMachineClassBLL_Update.ToString(), Entity); |
||||
|
if (result.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage("工厂编码已存在!"); |
||||
|
return View("PutMachineClassEdit", saveModel); |
||||
|
} |
||||
|
} |
||||
|
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge)); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 删除
|
||||
|
/// <summary>
|
||||
|
/// 删除
|
||||
|
/// </summary>
|
||||
|
/// <returns>结果</returns>
|
||||
|
[HttpPost] |
||||
|
[HandleException] |
||||
|
public ActionResult Delete(PutMachineClass model) |
||||
|
{ |
||||
|
string selectKey = Request.Form["selectKey"]; |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
var result = wcfAgent.InvokeServiceFunction<int>(QMAPP.ServicesAgent.DictService.PutMachineClassBLL_Delete.ToString(), selectKey); |
||||
|
if (result == 0) |
||||
|
{ |
||||
|
SetMessage("信息有关联,删除失败!"); |
||||
|
return List(true); |
||||
|
} |
||||
|
SetMessage(AppResource.DeleteMessage); |
||||
|
return List(true); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,207 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.Mvc; |
||||
|
using QMAPP.Common.Web.Controllers; |
||||
|
using QMFrameWork.WebUI.Attribute; |
||||
|
using QMAPP.FJC.Web.Models.Basic; |
||||
|
using QMFrameWork.Data; |
||||
|
using QMAPP.FJC.Entity.Basic; |
||||
|
using QMAPP.ServicesAgent; |
||||
|
using QMAPP.Entity; |
||||
|
using QMAPP.MD.Entity; |
||||
|
using QMAPP.MD.Web.Models; |
||||
|
using QMFrameWork.WebUI.DataSource; |
||||
|
using QMFrameWork.Common.Serialization; |
||||
|
using QMAPP.FJC.Web.Models.Bucket; |
||||
|
using QMAPP.MD.Entity.Bucket; |
||||
|
using QMAPP.FJC.Web.Models.Dianjian; |
||||
|
using QMAPP.FJC.Entity.Dianjian; |
||||
|
|
||||
|
namespace QMAPP.FJC.Web.Controllers |
||||
|
{ |
||||
|
public class PutMachineController : QController |
||||
|
{ |
||||
|
#region 获取信息
|
||||
|
/// <summary>
|
||||
|
/// 加载列表
|
||||
|
/// </summary>
|
||||
|
/// <returns>结果</returns>
|
||||
|
[HandleException] |
||||
|
public ActionResult List(bool? callback) |
||||
|
{ |
||||
|
PutMachineModel seachModel = new PutMachineModel(); |
||||
|
if (callback == true) |
||||
|
TryGetSelectBuffer<PutMachineModel>(out seachModel); |
||||
|
seachModel.rownumbers = false; |
||||
|
seachModel.url = "/PutMachine/GetList"; |
||||
|
return View("PutMachineList", seachModel); |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取列表
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="callBack">是否回调</param>
|
||||
|
/// <returns>列表</returns>
|
||||
|
[HandleException] |
||||
|
public ActionResult GetList(bool? callBack) |
||||
|
{ |
||||
|
PutMachineModel seachModel = null; |
||||
|
DataPage page = null; |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
PutMachine condition = null; |
||||
|
DataResult<DataPage> pageResult = new DataResult<DataPage>(); |
||||
|
try |
||||
|
{ |
||||
|
//获取查询对象
|
||||
|
seachModel = GetModel<PutMachineModel>(); |
||||
|
#region 获取缓存值
|
||||
|
if (callBack != null) |
||||
|
{ |
||||
|
TryGetSelectBuffer<PutMachineModel>(out seachModel); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
//保存搜索条件
|
||||
|
SetSelectBuffer<PutMachineModel>(seachModel); |
||||
|
} |
||||
|
#endregion
|
||||
|
//获取前台分页设置信息
|
||||
|
page = this.GetDataPage(seachModel); |
||||
|
condition = CopyToModel<PutMachine, PutMachineModel>(seachModel); |
||||
|
#region wcf服务统一接口
|
||||
|
|
||||
|
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("PutMachineBLL_GetList", condition, page); |
||||
|
if (pageResult.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage(pageResult.Msg); |
||||
|
return List(true); |
||||
|
} |
||||
|
DateGridResult<PutMachine> result = new DateGridResult<PutMachine>(); |
||||
|
result.Total = pageResult.Result.RecordCount; |
||||
|
result.Rows = JsonConvertHelper.GetDeserialize<List<PutMachine>>(pageResult.Result.Result.ToString()); |
||||
|
#endregion
|
||||
|
return Content(result.GetJsonSource()); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 编辑
|
||||
|
/// <summary>
|
||||
|
/// 编辑载入
|
||||
|
/// </summary>
|
||||
|
/// <returns>处理结果</returns>
|
||||
|
[HandleException] |
||||
|
public ActionResult Edit() |
||||
|
{ |
||||
|
PutMachineModel model = new PutMachineModel(); |
||||
|
string ID = Request.Params["PID"]; |
||||
|
PutMachine Entity = new PutMachine(); |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
DataResult<PutMachine> result = new DataResult<PutMachine>(); |
||||
|
try |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(ID) == false) |
||||
|
{ |
||||
|
//修改获取原数据
|
||||
|
Entity.PID = ID; |
||||
|
result = wcfAgent.InvokeServiceFunction<DataResult<PutMachine>>("PutMachineBLL_Get", Entity); |
||||
|
if (result.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage(result.Msg); |
||||
|
return View("PutMachineEdit", model); |
||||
|
} |
||||
|
model = CopyToModel<PutMachineModel, PutMachine>(result.Result); |
||||
|
} |
||||
|
return View("PutMachineEdit", model); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 保存
|
||||
|
/// </summary>
|
||||
|
/// <param name="model"></param>
|
||||
|
/// <returns>处理结果</returns>
|
||||
|
[HttpPost] |
||||
|
[HandleException] |
||||
|
[ValidateInput(false)] |
||||
|
public ActionResult Save(PutMachineModel saveModel) |
||||
|
{ |
||||
|
PutMachine Entity = null; |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
DataResult<int> result = new DataResult<int>(); |
||||
|
try |
||||
|
{ |
||||
|
Entity = CopyToModel<PutMachine, PutMachineModel>(saveModel); |
||||
|
if (string.IsNullOrEmpty(Entity.PID) == true) |
||||
|
{ |
||||
|
//新增
|
||||
|
result = wcfAgent.InvokeServiceFunction<DataResult<int>>(QMAPP.ServicesAgent.DictService.PutMachineBLL_Insert.ToString(), Entity); |
||||
|
if (result.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage("工厂编码已存在!"); |
||||
|
return View("PutMachineEdit", saveModel); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
//修改
|
||||
|
result = wcfAgent.InvokeServiceFunction<DataResult<int>>(QMAPP.ServicesAgent.DictService.PutMachineBLL_Update.ToString(), Entity); |
||||
|
if (result.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage("工厂编码已存在!"); |
||||
|
return View("PutMachineEdit", saveModel); |
||||
|
} |
||||
|
} |
||||
|
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge)); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 删除
|
||||
|
/// <summary>
|
||||
|
/// 删除
|
||||
|
/// </summary>
|
||||
|
/// <returns>结果</returns>
|
||||
|
[HttpPost] |
||||
|
[HandleException] |
||||
|
public ActionResult Delete(PutMachine model) |
||||
|
{ |
||||
|
string selectKey = Request.Form["selectKey"]; |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
var result = wcfAgent.InvokeServiceFunction<int>(QMAPP.ServicesAgent.DictService.PutMachineBLL_Delete.ToString(), selectKey); |
||||
|
if (result == 0) |
||||
|
{ |
||||
|
SetMessage("信息有关联,删除失败!"); |
||||
|
return List(true); |
||||
|
} |
||||
|
SetMessage(AppResource.DeleteMessage); |
||||
|
return List(true); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,211 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.Mvc; |
||||
|
using QMAPP.Common.Web.Controllers; |
||||
|
using QMFrameWork.WebUI.Attribute; |
||||
|
using QMAPP.FJC.Web.Models.Basic; |
||||
|
using QMFrameWork.Data; |
||||
|
using QMAPP.FJC.Entity.Basic; |
||||
|
using QMAPP.ServicesAgent; |
||||
|
using QMAPP.Entity; |
||||
|
using QMAPP.MD.Entity; |
||||
|
using QMAPP.MD.Web.Models; |
||||
|
using QMFrameWork.WebUI.DataSource; |
||||
|
using QMFrameWork.Common.Serialization; |
||||
|
using QMAPP.FJC.Web.Models.Bucket; |
||||
|
using QMAPP.MD.Entity.Bucket; |
||||
|
using QMAPP.FJC.Web.Models.Dianjian; |
||||
|
using QMAPP.FJC.Entity.Dianjian; |
||||
|
|
||||
|
namespace QMAPP.FJC.Web.Controllers |
||||
|
{ |
||||
|
public class PutMachineValueController : QController |
||||
|
{ |
||||
|
#region 获取信息
|
||||
|
/// <summary>
|
||||
|
/// 加载列表
|
||||
|
/// </summary>
|
||||
|
/// <returns>结果</returns>
|
||||
|
[HandleException] |
||||
|
public ActionResult List(bool? callback) |
||||
|
{ |
||||
|
PutMachineValueModel seachModel = new PutMachineValueModel(); |
||||
|
if (callback == true) |
||||
|
TryGetSelectBuffer<PutMachineValueModel>(out seachModel); |
||||
|
seachModel.rownumbers = false; |
||||
|
seachModel.url = "/PutMachineValue/GetList"; |
||||
|
return View("PutMachineValueList", seachModel); |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取列表
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="callBack">是否回调</param>
|
||||
|
/// <returns>列表</returns>
|
||||
|
[HandleException] |
||||
|
public ActionResult GetList(bool? callBack) |
||||
|
{ |
||||
|
PutMachineValueModel seachModel = null; |
||||
|
DataPage page = null; |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
PutMachineValue condition = null; |
||||
|
DataResult<DataPage> pageResult = new DataResult<DataPage>(); |
||||
|
try |
||||
|
{ |
||||
|
//获取查询对象
|
||||
|
seachModel = GetModel<PutMachineValueModel>(); |
||||
|
#region 获取缓存值
|
||||
|
if (callBack != null) |
||||
|
{ |
||||
|
TryGetSelectBuffer<PutMachineValueModel>(out seachModel); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
//保存搜索条件
|
||||
|
SetSelectBuffer<PutMachineValueModel>(seachModel); |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
//获取前台分页设置信息
|
||||
|
page = this.GetDataPage(seachModel); |
||||
|
condition = CopyToModel<PutMachineValue, PutMachineValueModel>(seachModel); |
||||
|
#region wcf服务统一接口
|
||||
|
|
||||
|
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("PutMachineValueBLL_GetList", condition, page); |
||||
|
|
||||
|
|
||||
|
if (pageResult.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage(pageResult.Msg); |
||||
|
return List(true); |
||||
|
} |
||||
|
|
||||
|
DateGridResult<PutMachineValue> result = new DateGridResult<PutMachineValue>(); |
||||
|
result.Total = pageResult.Result.RecordCount; |
||||
|
result.Rows = JsonConvertHelper.GetDeserialize<List<PutMachineValue>>(pageResult.Result.Result.ToString()); |
||||
|
#endregion
|
||||
|
return Content(result.GetJsonSource()); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 编辑
|
||||
|
/// <summary>
|
||||
|
/// 编辑载入
|
||||
|
/// </summary>
|
||||
|
/// <returns>处理结果</returns>
|
||||
|
[HandleException] |
||||
|
public ActionResult Edit() |
||||
|
{ |
||||
|
PutMachineValueModel model = new PutMachineValueModel(); |
||||
|
string ID = Request.Params["PID"]; |
||||
|
PutMachineValue Entity = new PutMachineValue(); |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
DataResult<PutMachineValue> result = new DataResult<PutMachineValue>(); |
||||
|
try |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(ID) == false) |
||||
|
{ |
||||
|
//修改获取原数据
|
||||
|
Entity.PID = ID; |
||||
|
result = wcfAgent.InvokeServiceFunction<DataResult<PutMachineValue>>("PutMachineValueBLL_Get", Entity); |
||||
|
if (result.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage(result.Msg); |
||||
|
return View("PutMachineValueEdit", model); |
||||
|
} |
||||
|
model = CopyToModel<PutMachineValueModel, PutMachineValue>(result.Result); |
||||
|
} |
||||
|
return View("PutMachineValueEdit", model); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 保存
|
||||
|
/// </summary>
|
||||
|
/// <param name="model"></param>
|
||||
|
/// <returns>处理结果</returns>
|
||||
|
[HttpPost] |
||||
|
[HandleException] |
||||
|
[ValidateInput(false)] |
||||
|
public ActionResult Save(PutMachineValueModel saveModel) |
||||
|
{ |
||||
|
PutMachineValue Entity = null; |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
DataResult<int> result = new DataResult<int>(); |
||||
|
try |
||||
|
{ |
||||
|
Entity = CopyToModel<PutMachineValue, PutMachineValueModel>(saveModel); |
||||
|
if (string.IsNullOrEmpty(Entity.PID) == true) |
||||
|
{ |
||||
|
//新增
|
||||
|
result = wcfAgent.InvokeServiceFunction<DataResult<int>>(QMAPP.ServicesAgent.DictService.PutMachineValueBLL_Insert.ToString(), Entity); |
||||
|
if (result.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage("工厂编码已存在!"); |
||||
|
return View("PutMachineValueEdit", saveModel); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
//修改
|
||||
|
result = wcfAgent.InvokeServiceFunction<DataResult<int>>(QMAPP.ServicesAgent.DictService.PutMachineValueBLL_Update.ToString(), Entity); |
||||
|
if (result.IsSuccess == false) |
||||
|
{ |
||||
|
SetMessage("工厂编码已存在!"); |
||||
|
return View("PutMachineValueEdit", saveModel); |
||||
|
} |
||||
|
} |
||||
|
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge)); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 删除
|
||||
|
/// <summary>
|
||||
|
/// 删除
|
||||
|
/// </summary>
|
||||
|
/// <returns>结果</returns>
|
||||
|
[HttpPost] |
||||
|
[HandleException] |
||||
|
public ActionResult Delete(PutMachineValue model) |
||||
|
{ |
||||
|
string selectKey = Request.Form["selectKey"]; |
||||
|
ServiceAgent wcfAgent = this.GetServiceAgent(); |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
var result = wcfAgent.InvokeServiceFunction<int>(QMAPP.ServicesAgent.DictService.PutMachineValueBLL_Delete.ToString(), selectKey); |
||||
|
if (result == 0) |
||||
|
{ |
||||
|
SetMessage("信息有关联,删除失败!"); |
||||
|
return List(true); |
||||
|
} |
||||
|
SetMessage(AppResource.DeleteMessage); |
||||
|
return List(true); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw ex; |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.Mvc.Html; |
||||
|
using QMFrameWork.WebUI.Attribute; |
||||
|
using QMFrameWork.WebUI; |
||||
|
|
||||
|
namespace QMAPP.FJC.Web.Models.Dianjian |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 模块名称:注塑料筒信息
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2021年07月13日
|
||||
|
/// </summary>
|
||||
|
public class PutMachineClassModel : QDGModel |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
[Description("主键")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 36)] |
||||
|
[DGColumn(Hidden = false, PrimaryKey = true)] |
||||
|
public string PID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检编号
|
||||
|
/// </summary>
|
||||
|
[Description("点检编号")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string MachineCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检名称
|
||||
|
/// </summary>
|
||||
|
[Description("点检名称")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string Name { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检部位
|
||||
|
/// </summary>
|
||||
|
[Description("点检部位")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
||||
|
public string Position { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检内容
|
||||
|
/// </summary>
|
||||
|
[Description("点检内容")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
||||
|
public string Content { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检方法
|
||||
|
/// </summary>
|
||||
|
[Description("点检方法")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
||||
|
public string Methond { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检类型
|
||||
|
/// </summary>
|
||||
|
[Description("点检类型")] |
||||
|
// [HTMLInput(UpdateRead = false, required = true, MaxLength = 200)]
|
||||
|
[HTMLInput(UpdateRead = false, required = true, JsonUtl = "/Dict/GetTypeComboxSource", MaxLength = 15, Width = 100)] |
||||
|
[InputType(inputType.combobox)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string Type { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检排序
|
||||
|
/// </summary>
|
||||
|
[Description("点检排序")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string SerialNumber { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,82 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.Mvc.Html; |
||||
|
using QMFrameWork.WebUI.Attribute; |
||||
|
using QMFrameWork.WebUI; |
||||
|
|
||||
|
namespace QMAPP.FJC.Web.Models.Dianjian |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 模块名称:注塑料筒信息
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2021年07月13日
|
||||
|
/// </summary>
|
||||
|
public class PutMachineModel : QDGModel |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
[Description("主键")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 36)] |
||||
|
[DGColumn(Hidden = true, PrimaryKey = true)] |
||||
|
public string PID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检项PID
|
||||
|
/// </summary>
|
||||
|
[Description("点检项PID")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string MachinePID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 名称
|
||||
|
/// </summary>
|
||||
|
[Description("名称")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 250, DataAlign = DataAlign.center)] |
||||
|
public string Name { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 设备编号
|
||||
|
/// </summary>
|
||||
|
[Description("设备编号")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string MachineCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 下限
|
||||
|
/// </summary>
|
||||
|
[Description("下限")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string Limit { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上限
|
||||
|
/// </summary>
|
||||
|
[Description("上限")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
||||
|
public string Floor { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 序号
|
||||
|
/// </summary>
|
||||
|
[Description("序号")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
||||
|
public string SerialNumber { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,101 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
using System.Web.Mvc.Html; |
||||
|
using QMFrameWork.WebUI.Attribute; |
||||
|
using QMFrameWork.WebUI; |
||||
|
|
||||
|
namespace QMAPP.FJC.Web.Models.Dianjian |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 模块名称:泡沫点检记录
|
||||
|
/// 作 者:张松男
|
||||
|
/// 编写日期:2024年05月22日
|
||||
|
/// </summary>
|
||||
|
public class PutMachineValueModel : QDGModel |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
[Description("主键")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 36)] |
||||
|
[DGColumn(Hidden = true, PrimaryKey = true)] |
||||
|
public string PID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 设备编号
|
||||
|
/// </summary>
|
||||
|
[Description("设备编号")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string MachineCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 名称
|
||||
|
/// </summary>
|
||||
|
[Description("名称")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 250, DataAlign = DataAlign.center)] |
||||
|
public string Name { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 类型
|
||||
|
/// </summary>
|
||||
|
[Description("类型")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string Type { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检值1
|
||||
|
/// </summary>
|
||||
|
[Description("点检值1")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
||||
|
public string MValue { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检值2
|
||||
|
/// </summary>
|
||||
|
[Description("点检值2")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
||||
|
public string PValue { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 班次
|
||||
|
/// </summary>
|
||||
|
[Description("班次")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
||||
|
public string Group { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检人
|
||||
|
/// </summary>
|
||||
|
[Description("点检人")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
||||
|
public string UserName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 点检时间
|
||||
|
/// </summary>
|
||||
|
[Description("点检时间")] |
||||
|
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
||||
|
[InputType(inputType.text)] |
||||
|
[DGColumn(frozenColumns = true, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
||||
|
public string CreateData { get; set; } |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,89 @@ |
|||||
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
||||
|
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.Dianjian.PutMachineModel>" %> |
||||
|
|
||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
||||
|
工厂信息编辑 |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
||||
|
<%=Html.QPEdit("信息", string.IsNullOrEmpty(Model.PID) ? QMFrameWork.WebUI.panelType.Add : QMFrameWork.WebUI.panelType.Update)%> |
||||
|
<table id="editTable" cellpadding="0" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<table> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p=>p.MachinePID) %> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.MachinePID)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p=>p.MachineCode) %> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.MachineCode)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.Name)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.Name)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.Limit)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.Limit)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.Floor)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.Floor)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.SerialNumber)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.SerialNumber)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
|
||||
|
</table> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<%=Html.HiddenFor(p=>p.PID) %> |
||||
|
<%=Html.QPEnd() %> |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
||||
|
<table width="100%" cellpadding="0" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<%=Html.QTButtonSave("User", "Save", "return Save();")%> |
||||
|
<%=Html.QTButtonBack("close", "PutMachineClass", "parent.closeAppWindow1();return false;")%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<script type="text/javascript"> |
||||
|
function Save() { |
||||
|
if (isValidate() == false) { |
||||
|
return false; |
||||
|
} |
||||
|
submitByButton("Save"); |
||||
|
} |
||||
|
</script> |
||||
|
</asp:Content> |
@ -0,0 +1,88 @@ |
|||||
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
||||
|
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.Dianjian.PutMachineModel>" %> |
||||
|
|
||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
||||
|
工厂信息列表 |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
||||
|
<%=Html.QPSeach(80,true) %> |
||||
|
<table id="condiTable"> |
||||
|
<tr> |
||||
|
|
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.MachinePID)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.MachinePID)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<%=Html.QPEnd()%> |
||||
|
<%=Html.QPList() %> |
||||
|
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.Dianjian.PutMachineModel>(Model)%> |
||||
|
<%=Html.QPEnd() %> |
||||
|
<%=Html.Hidden("selectKey")%> |
||||
|
<%=Html.Hidden("PID")%> |
||||
|
<script language="javascript" type="text/javascript"> |
||||
|
//添加 |
||||
|
function Add() { |
||||
|
openAppWindow1('信息添加', 'Edit', '350', '380'); |
||||
|
} |
||||
|
//修改 |
||||
|
function Update() { |
||||
|
var ids = getSelectKey(); |
||||
|
if (ids == "") { |
||||
|
MSI("提示", "请选择修改记录。"); |
||||
|
return; |
||||
|
} |
||||
|
if (ids.indexOf(":") > 0) { |
||||
|
MSI("提示", "每次只能修改一条记录。"); |
||||
|
return; |
||||
|
} |
||||
|
document.getElementById("selectKey").value = ids; |
||||
|
openAppWindow1('修改', 'Edit?PID=' + ids, '350', '380'); |
||||
|
} |
||||
|
//整车添加 |
||||
|
function AddPutMachine() { |
||||
|
var ids = getSelectKey(); |
||||
|
if (ids == "") { |
||||
|
MSI("提示", "请选择修改记录。"); |
||||
|
return; |
||||
|
} |
||||
|
if (ids.indexOf(":") > 0) { |
||||
|
MSI("提示", "每次只能修改一条记录。"); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
var MachinePID = document.getElementById("PID").value; |
||||
|
openAppWindow1('查询上下限', 'AddPutMachine?MachinePID=' + MachinePID, '650', '380'); |
||||
|
} |
||||
|
//删除 |
||||
|
function Delete() { |
||||
|
var ids = getSelectKey(); |
||||
|
if (ids == "") { |
||||
|
MSI("错误", "至少选择一条记录"); |
||||
|
} |
||||
|
else { |
||||
|
document.getElementById("selectKey").value = ids; |
||||
|
MSQ("提示", "确定要删除选中的记录吗?", function () { |
||||
|
submitByButton("Delete"); |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
||||
|
<table cellpadding="0" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td align="center"> |
||||
|
<%=Html.QTButtonSearch("PutMachineClass", "List", "List(1)", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
<%=Html.QTButtonAdd("PutMachineClass", "Add", "Add()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
<%=Html.QTButtonUpdate("PutMachineClass", "Edit", "Update()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
<%=Html.QTButtonDelete("PutMachineClass", "Delete", "Delete()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</asp:Content> |
@ -0,0 +1,97 @@ |
|||||
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
||||
|
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.Dianjian.PutMachineClassModel>" %> |
||||
|
|
||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
||||
|
工厂信息编辑 |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
||||
|
<%=Html.QPEdit("信息", string.IsNullOrEmpty(Model.PID) ? QMFrameWork.WebUI.panelType.Add : QMFrameWork.WebUI.panelType.Update)%> |
||||
|
<table id="editTable" cellpadding="0" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<table> |
||||
|
|
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p=>p.MachineCode) %> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.MachineCode)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.Name)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.Name)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.Position)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.Position)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.Content)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.Content)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.Methond)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.Methond)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.Type)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.Type)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.SerialNumber)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.SerialNumber)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
</table> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<%=Html.HiddenFor(p=>p.PID) %> |
||||
|
<%=Html.QPEnd() %> |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
||||
|
<table width="100%" cellpadding="0" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<%=Html.QTButtonSave("User", "Save", "return Save();")%> |
||||
|
<%=Html.QTButtonBack("close", "PutMachineClass", "parent.closeAppWindow1();return false;")%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<script type="text/javascript"> |
||||
|
function Save() { |
||||
|
if (isValidate() == false) { |
||||
|
return false; |
||||
|
} |
||||
|
submitByButton("Save"); |
||||
|
} |
||||
|
</script> |
||||
|
</asp:Content> |
@ -0,0 +1,95 @@ |
|||||
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
||||
|
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.Dianjian.PutMachineClassModel>" %> |
||||
|
|
||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
||||
|
工厂信息列表 |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
||||
|
<%=Html.QPSeach(80,true) %> |
||||
|
<table id="condiTable"> |
||||
|
<tr> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.MachineCode)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.MachineCode)%> |
||||
|
</td> |
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.Name)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.Name)%> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
</table> |
||||
|
<%=Html.QPEnd()%> |
||||
|
<%=Html.QPList() %> |
||||
|
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.Dianjian.PutMachineClassModel>(Model)%> |
||||
|
<%=Html.QPEnd() %> |
||||
|
<%=Html.Hidden("selectKey")%> |
||||
|
<%=Html.Hidden("PID")%> |
||||
|
<script language="javascript" type="text/javascript"> |
||||
|
//添加 |
||||
|
function Add() { |
||||
|
openAppWindow1('信息添加', 'Edit', '350', '380'); |
||||
|
} |
||||
|
//修改 |
||||
|
function Update() { |
||||
|
var ids = getSelectKey(); |
||||
|
if (ids == "") { |
||||
|
MSI("提示", "请选择修改记录。"); |
||||
|
return; |
||||
|
} |
||||
|
if (ids.indexOf(":") > 0) { |
||||
|
MSI("提示", "每次只能修改一条记录。"); |
||||
|
return; |
||||
|
} |
||||
|
document.getElementById("selectKey").value = ids; |
||||
|
openAppWindow1('修改', 'Edit?PID=' + ids, '350', '380'); |
||||
|
} |
||||
|
//整车添加 |
||||
|
function AddPutMachine() { |
||||
|
var ids = getSelectKey(); |
||||
|
if (ids == "") { |
||||
|
MSI("提示", "请选择修改记录。"); |
||||
|
return; |
||||
|
} |
||||
|
if (ids.indexOf(":") > 0) { |
||||
|
MSI("提示", "每次只能修改一条记录。"); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
var MachinePID = document.getElementById("PID").value; |
||||
|
openAppWindow1('查询上下限', 'PutList?MachinePID=' + MachinePID, '650', '380'); |
||||
|
} |
||||
|
//删除 |
||||
|
function Delete() { |
||||
|
var ids = getSelectKey(); |
||||
|
if (ids == "") { |
||||
|
MSI("错误", "至少选择一条记录"); |
||||
|
} |
||||
|
else { |
||||
|
document.getElementById("selectKey").value = ids; |
||||
|
MSQ("提示", "确定要删除选中的记录吗?", function () { |
||||
|
submitByButton("Delete"); |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
||||
|
<table cellpadding="0" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td align="center"> |
||||
|
<%=Html.QTButtonSearch("PutMachineClass", "List", "List(1)", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
<%=Html.QTButtonAdd("PutMachineClass", "Add", "Add()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
<%=Html.QTButtonUpdate("PutMachineClass", "Edit", "Update()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
<%=Html.QTButton("AddPutMachine", "AddPutMachine", QMFrameWork.WebUI.IconCls.add, "AddPutMachine()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
<%=Html.QTButtonDelete("PutMachineClass", "Delete", "Delete()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</asp:Content> |
@ -0,0 +1,85 @@ |
|||||
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
||||
|
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.Dianjian.PutMachineValueModel>" %> |
||||
|
|
||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
||||
|
工厂信息列表 |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
||||
|
<%=Html.QPSeach(80,true) %> |
||||
|
<table id="condiTable"> |
||||
|
<tr> |
||||
|
|
||||
|
<th align="right"> |
||||
|
<%=Html.QV(p => p.MachineCode)%> |
||||
|
</th> |
||||
|
<td> |
||||
|
<%=Html.QC(p => p.MachineCode)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<%=Html.QPEnd()%> |
||||
|
<%=Html.QPList() %> |
||||
|
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.Dianjian.PutMachineValueModel>(Model)%> |
||||
|
<%=Html.QPEnd() %> |
||||
|
<%=Html.Hidden("selectKey")%> |
||||
|
<%=Html.Hidden("PID")%> |
||||
|
<script language="javascript" type="text/javascript"> |
||||
|
//添加 |
||||
|
function Add() { |
||||
|
openAppWindow1('信息添加', 'Edit', '350', '380'); |
||||
|
} |
||||
|
//修改 |
||||
|
function Update() { |
||||
|
var ids = getSelectKey(); |
||||
|
if (ids == "") { |
||||
|
MSI("提示", "请选择修改记录。"); |
||||
|
return; |
||||
|
} |
||||
|
if (ids.indexOf(":") > 0) { |
||||
|
MSI("提示", "每次只能修改一条记录。"); |
||||
|
return; |
||||
|
} |
||||
|
document.getElementById("selectKey").value = ids; |
||||
|
openAppWindow1('修改', 'Edit?PID=' + ids, '350', '380'); |
||||
|
} |
||||
|
//整车添加 |
||||
|
function AddPutMachine() { |
||||
|
var ids = getSelectKey(); |
||||
|
if (ids == "") { |
||||
|
MSI("提示", "请选择修改记录。"); |
||||
|
return; |
||||
|
} |
||||
|
if (ids.indexOf(":") > 0) { |
||||
|
MSI("提示", "每次只能修改一条记录。"); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
var MachinePID = document.getElementById("PID").value; |
||||
|
openAppWindow1('查询上下限', 'AddPutMachine?MachinePID=' + MachinePID, '650', '380'); |
||||
|
} |
||||
|
//删除 |
||||
|
function Delete() { |
||||
|
var ids = getSelectKey(); |
||||
|
if (ids == "") { |
||||
|
MSI("错误", "至少选择一条记录"); |
||||
|
} |
||||
|
else { |
||||
|
document.getElementById("selectKey").value = ids; |
||||
|
MSQ("提示", "确定要删除选中的记录吗?", function () { |
||||
|
submitByButton("Delete"); |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
</asp:Content> |
||||
|
|
||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
||||
|
<table cellpadding="0" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td align="center"> |
||||
|
<%=Html.QTButtonSearch("PutMachineValue", "List", "List(1)", QMAPP.Common.Web.SystemLimit.isLimt)%> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</asp:Content> |
@ -0,0 +1,85 @@ |
|||||
|
using QMAPP.BLL.Sys; |
||||
|
using QMAPP.DAL.Sys; |
||||
|
using QMAPP.Entity.Sys; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Data; |
||||
|
using System.Linq; |
||||
|
using System.Net; |
||||
|
using System.Net.Http; |
||||
|
using System.Threading.Tasks; |
||||
|
using System.Web.Http; |
||||
|
using WebAPI.App_Start; |
||||
|
using WebAPI.Models; |
||||
|
|
||||
|
namespace WebAPI.Controllers |
||||
|
{ |
||||
|
|
||||
|
public class InventoryController : ApiController |
||||
|
{ |
||||
|
public Response<List<OrderPlan_PaoMo>> GetPlanList() |
||||
|
{ |
||||
|
var result = new Response<List<OrderPlan_PaoMo>>(); |
||||
|
|
||||
|
List<OrderPlan_PaoMo> List_plan = new List<OrderPlan_PaoMo>(); |
||||
|
|
||||
|
var sqlScript = ""; |
||||
|
|
||||
|
sqlScript = $"select top 10 * from T_PP_ORDERPLAN_PAOMO order by PLAN_DATE desc"; |
||||
|
|
||||
|
DataSet dataSet = SqlHelper.ExecuteDataset(Config.maindbConnectionString, CommandType.Text, sqlScript); |
||||
|
|
||||
|
if (dataSet.Tables[0].Rows.Count > 0) |
||||
|
{ |
||||
|
foreach (DataRow row in dataSet.Tables[0].Rows) |
||||
|
{ |
||||
|
OrderPlan_PaoMo OrderPlan = new OrderPlan_PaoMo(); |
||||
|
OrderPlan.PID = row["PID"].ToString(); |
||||
|
OrderPlan.PLAN_NO = row["PLAN_NO"].ToString(); |
||||
|
OrderPlan.PLAN_SEQ = row["PLAN_SEQ"].ToString(); |
||||
|
OrderPlan.PLAN_STATE = row["PLAN_STATE"].ToString(); |
||||
|
OrderPlan.MATERIAL_CODE = row["MATERIAL_CODE"].ToString(); |
||||
|
OrderPlan.PBOM_CODE = row["PBOM_CODE"].ToString(); |
||||
|
OrderPlan.ROUTE_CODE = row["ROUTE_CODE"].ToString(); |
||||
|
OrderPlan.QTY = row["QTY"].ToString(); |
||||
|
OrderPlan.COMPLETE_QTY = row["COMPLETE_QTY"].ToString(); |
||||
|
OrderPlan.PLAN_DATE = row["PLAN_DATE"].ToString(); |
||||
|
OrderPlan.SHIFT_CODE = row["SHIFT_CODE"].ToString(); |
||||
|
|
||||
|
List_plan.Add(OrderPlan); |
||||
|
} |
||||
|
|
||||
|
result.Result = List_plan; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
result.Code = 201; |
||||
|
result.Message = "用户信息不存在"; |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
public async Task<IHttpActionResult> Insert() |
||||
|
{ |
||||
|
var request = await this.Request.Content.ReadAsStringAsync(); |
||||
|
|
||||
|
var requeststr = request.Replace("\r", "").Replace("\n", ""); |
||||
|
|
||||
|
var resObj = JsonHelper.Instance.JsonToObj<Inventory>(requeststr); |
||||
|
|
||||
|
|
||||
|
//var sql = $"INSERT INTO[dbo].[T_MD_RawMaterial] ([PID], [BucketCode], [PartCode], [BatchCode], [SerialCode], [IsCheck], [CREATEUSER], [CREATEDATE], [planNumber], [supplierCode], [weight]) VALUES" +
|
||||
|
// $" ('{Guid.NewGuid()}', '{resObj.bucketCode}', '{resObj.itemCode}', '{resObj.batchCode}', '{resObj.referenceCode}', '0', '{resObj.id}', '{DateTime.Now}', '{resObj.planNumber}', '{resObj.supplierCode}', '{resObj.weight}');";
|
||||
|
|
||||
|
|
||||
|
//SqlData.InsertWare(sql);
|
||||
|
|
||||
|
var Response = new Response(); |
||||
|
|
||||
|
return Ok(Response); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Web; |
||||
|
|
||||
|
namespace WebAPI.Models |
||||
|
{ |
||||
|
public class Inventory |
||||
|
{ |
||||
|
public string PID { get; set; } |
||||
|
|
||||
|
|
||||
|
public string ProductCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 1:泡沫 2:注塑
|
||||
|
/// </summary>
|
||||
|
public string Type { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 1:库存 2:出库 3:隔离 4:报废
|
||||
|
/// </summary>
|
||||
|
public string State { get; set; } |
||||
|
|
||||
|
public string CreateUser { get; set; } |
||||
|
|
||||
|
public string CreateDate { get; set; } |
||||
|
|
||||
|
public string UpdateUser { get; set; } |
||||
|
|
||||
|
public string UpdateDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 计划ID
|
||||
|
/// </summary>
|
||||
|
public string PlanID { get; set; } |
||||
|
|
||||
|
public string Remark1 { get; set; } |
||||
|
|
||||
|
public string Remark2 { get; set; } |
||||
|
|
||||
|
public string Remark3 { get; set; } |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue