add - 物料管理 物料类别管理 部分完成

master
SoulStar 7 months ago
parent 916532af5a
commit 2b88aee176

@ -55,12 +55,16 @@
<Compile Include="domain\SysShiftTimeEntity.cs" />
<Compile Include="domain\SysUserEntity.cs" />
<Compile Include="domain\SysRoleEntity.cs" />
<Compile Include="domain\ZxMaterialTypeEntity.cs" />
<Compile Include="domain\ZxMaterialChildTypeEntity.cs" />
<Compile Include="domain\ZxMaterialEntity.cs" />
<Compile Include="domain\ZxRecipeEntity.cs" />
<Compile Include="domain\ZxRecipeParaEntity.cs" />
<Compile Include="domain\ZxWeightEntity.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repository.cs" />
<Compile Include="service\ZxMaterialChildTypeService.cs" />
<Compile Include="service\ZxMaterialTypeService.cs" />
<Compile Include="service\ZxRecipeParaService.cs" />
<Compile Include="service\ZxRecipeService.cs" />
<Compile Include="service\ZxMaterialService.cs" />

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Models
{
/// <summary>
/// 物料子类别
///</summary>
[SugarTable("zx_material_child_type")]
public class ZxMaterialChildTypeEntity
{
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// 备 注:物料类型
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_type_name")]
public string MaterialTypeName { get; set; } = null;
/// <summary>
/// 备 注:物料子类型
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_chlid_type_name")]
public string MaterialChlidTypeName { get; set; } = null;
}
}

@ -5,7 +5,7 @@ using SqlSugar;
namespace Models
{
/// <summary>
///
/// 物料
///</summary>
[SugarTable("zx_material")]
public class ZxMaterialEntity

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Models
{
/// <summary>
/// 物料类别
///</summary>
[SugarTable("zx_material_type")]
public class ZxMaterialTypeEntity
{
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// 备 注:物料类型名
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "material_type_name")]
public string MaterialTypeName { get; set; } = null;
}
}

@ -32,8 +32,8 @@ namespace HighWayIot.Repository.service
{
try
{
List<SysShiftTimeEntity> deviceInfo = _repository.GetList();
return deviceInfo;
List<SysShiftTimeEntity> entity = _repository.GetList();
return entity;
}
catch (Exception ex)
{
@ -45,13 +45,13 @@ namespace HighWayIot.Repository.service
/// <summary>
/// 修改班次信息
/// </summary>
/// <param name="sysUserEntity"></param>
/// <param name="entity"></param>
/// <returns></returns>
public bool UpdateShiftInfo(SysShiftTimeEntity sysUserEntity)
public bool UpdateShiftInfo(SysShiftTimeEntity entity)
{
try
{
return _repository.Update(sysUserEntity);
return _repository.Update(entity);
}
catch(Exception ex)
{

@ -37,24 +37,24 @@ namespace HighWayIot.Repository.service
{
try
{
List<SysUserEntity> deviceInfo = _repository.GetList(x => x.IsDeleted == false);
List<SysUserEntity> entity = _repository.GetList(x => x.IsDeleted == false);
if (!string.IsNullOrEmpty(userName))
{
deviceInfo = deviceInfo.Where(x => x.UserName.Contains(userName)).ToList();
entity = entity.Where(x => x.UserName.Contains(userName)).ToList();
}
if (!string.IsNullOrEmpty(userRole))
{
deviceInfo = deviceInfo.Where(x => x.UserRole == userRole).ToList();
entity = entity.Where(x => x.UserRole == userRole).ToList();
}
if (isSelectByTime)
{
deviceInfo = deviceInfo.Where(x => x.LastLoginTime >= beginTime && x.LastLoginTime <= endTime).ToList();
entity = entity.Where(x => x.LastLoginTime >= beginTime && x.LastLoginTime <= endTime).ToList();
}
return deviceInfo;
return entity;
}
catch (Exception ex)
{

@ -32,10 +32,8 @@ namespace HighWayIot.Repository.service
{
try
{
List<SysRoleEntity> deviceInfo = _repository.GetList();
return deviceInfo;
List<SysRoleEntity> entity = _repository.GetList();
return entity;
}
catch (Exception ex)
{

@ -0,0 +1,82 @@
using HighWayIot.Log4net;
using HighWayIot.Repository.domain;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service
{
public class ZxMaterialChildTypeService
{
private static readonly Lazy<ZxMaterialChildTypeService> lazy = new Lazy<ZxMaterialChildTypeService>(() => new ZxMaterialChildTypeService());
public static ZxMaterialChildTypeService Instance
{
get
{
return lazy.Value;
}
}
private LogHelper log = LogHelper.Instance;
Repository<ZxMaterialChildTypeEntity> _repository => new Repository<ZxMaterialChildTypeEntity>("sqlserver");
/// <summary>
/// Lambda查询所有物料子类别信息
/// </summary>
/// <returns></returns>
public List<ZxMaterialChildTypeEntity> GetMaterialChildTypeInfos(Expression<Func<ZxMaterialChildTypeEntity, bool>> whereExpression)
{
try
{
List<ZxMaterialChildTypeEntity> entity = _repository.GetList(whereExpression);
return entity;
}
catch (Exception ex)
{
log.Error("物料子类别信息获取异常", ex);
return null;
}
}
/// <summary>
/// 新增物料子类别信息
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public bool InsertMaterialChildTypeInfo(ZxMaterialChildTypeEntity entity)
{
try
{
return _repository.Insert(entity);
}
catch (Exception ex)
{
log.Error("物料子类别信息添加异常", ex);
return false;
}
}
/// <summary>
/// 删除物料子类别信息
/// </summary>
/// <param name="materialCode"></param>
/// <returns></returns>
public bool DeleteMaterialChildTypeInfoById(int id)
{
try
{
return _repository.DeleteById(id);
}
catch (Exception ex)
{
log.Error("物料子类别信息删除异常", ex);
return false;
}
}
}
}

@ -33,8 +33,8 @@ namespace HighWayIot.Repository.service
{
try
{
List<ZxMaterialEntity> deviceInfo = _repository.GetList(x => x.IsDeleted == false);
return deviceInfo;
List<ZxMaterialEntity> entity = _repository.GetList(x => x.IsDeleted == false);
return entity;
}
catch (Exception ex)
{
@ -46,13 +46,13 @@ namespace HighWayIot.Repository.service
/// <summary>
/// 修改物料信息
/// </summary>
/// <param name="sysUserEntity"></param>
/// <param name="entity"></param>
/// <returns></returns>
public bool UpdateMaterialInfo(ZxMaterialEntity sysUserEntity)
public bool UpdateMaterialInfo(ZxMaterialEntity entity)
{
try
{
return _repository.Update(sysUserEntity);
return _repository.Update(entity);
}
catch (Exception ex)
{
@ -61,11 +61,16 @@ namespace HighWayIot.Repository.service
}
}
public bool InsertMaterialInfo(ZxMaterialEntity sysUserEntity)
/// <summary>
/// 新增物料信息
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public bool InsertMaterialInfo(ZxMaterialEntity entity)
{
try
{
return _repository.Insert(sysUserEntity);
return _repository.Insert(entity);
}
catch (Exception ex)
{
@ -74,6 +79,11 @@ namespace HighWayIot.Repository.service
}
}
/// <summary>
/// 删除物料信息
/// </summary>
/// <param name="materialCode"></param>
/// <returns></returns>
public bool DeleteMaterialInfoByMaterialCode(string materialCode)
{
try

@ -0,0 +1,82 @@
using HighWayIot.Log4net;
using HighWayIot.Repository.domain;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service
{
public class ZxMaterialTypeService
{
private static readonly Lazy<ZxMaterialTypeService> lazy = new Lazy<ZxMaterialTypeService>(() => new ZxMaterialTypeService());
public static ZxMaterialTypeService Instance
{
get
{
return lazy.Value;
}
}
private LogHelper log = LogHelper.Instance;
Repository<ZxMaterialTypeEntity> _repository => new Repository<ZxMaterialTypeEntity>("sqlserver");
/// <summary>
/// 查询所有物料类别信息
/// </summary>
/// <returns></returns>
public List<ZxMaterialTypeEntity> GetMaterialTypeInfos()
{
try
{
List<ZxMaterialTypeEntity> entity = _repository.GetList();
return entity;
}
catch (Exception ex)
{
log.Error("物料类别信息获取异常", ex);
return null;
}
}
/// <summary>
/// 新增物料类别信息
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public bool InsertMaterialTypeInfo(ZxMaterialTypeEntity entity)
{
try
{
return _repository.Insert(entity);
}
catch (Exception ex)
{
log.Error("物料信息添加异常", ex);
return false;
}
}
/// <summary>
/// 删除物料类别信息
/// </summary>
/// <param name="materialCode"></param>
/// <returns></returns>
public bool DeleteMaterialTypeInfoById(int id)
{
try
{
return _repository.DeleteById(id);
}
catch (Exception ex)
{
log.Error("物料信息删除异常", ex);
return false;
}
}
}
}

@ -26,15 +26,15 @@ namespace HighWayIot.Repository.service
Repository<ZxRecipeParaEntity> _repository => new Repository<ZxRecipeParaEntity>("sqlserver");
/// <summary>
/// 条件查询所有用户列表 用户名为模糊查询
/// 查询配方字段信息
/// </summary>
/// <returns></returns>
public List<ZxRecipeParaEntity> GetShiftInfos()
public List<ZxRecipeParaEntity> GetRecipeParaInfos()
{
try
{
List<ZxRecipeParaEntity> deviceInfo = _repository.GetList();
return deviceInfo;
List<ZxRecipeParaEntity> entity = _repository.GetList();
return entity;
}
catch (Exception ex)
{
@ -44,15 +44,33 @@ namespace HighWayIot.Repository.service
}
/// <summary>
/// 修改班次信息
/// 修改配方字段信息
/// </summary>
/// <param name="sysUserEntity"></param>
/// <param name="entity"></param>
/// <returns></returns>
public bool UpdateShiftInfo(ZxRecipeParaEntity sysUserEntity)
public bool UpdateRecipeParaInfo(ZxRecipeParaEntity entity)
{
try
{
return _repository.Update(sysUserEntity);
return _repository.Update(entity);
}
catch(Exception ex)
{
log.Error("用户信息修改异常", ex);
return false;
}
}
/// <summary>
/// 添加配方字段信息
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public bool InsertRecipeParaInfo(ZxRecipeParaEntity entity)
{
try
{
return _repository.Insert(entity);
}
catch (Exception ex)
{

@ -26,15 +26,15 @@ namespace HighWayIot.Repository.service
Repository<ZxRecipeEntity> _repository => new Repository<ZxRecipeEntity>("sqlserver");
/// <summary>
/// 条件查询所有用户列表 用户名为模糊查询
/// 查询配方信息
/// </summary>
/// <returns></returns>
public List<ZxRecipeEntity> GetShiftInfos()
public List<ZxRecipeEntity> GetRecipeInfos()
{
try
{
List<ZxRecipeEntity> deviceInfo = _repository.GetList(x => x.IsDeleted == false);
return deviceInfo;
List<ZxRecipeEntity> entity = _repository.GetList(x => x.IsDeleted == false);
return entity;
}
catch (Exception ex)
{
@ -44,15 +44,15 @@ namespace HighWayIot.Repository.service
}
/// <summary>
/// 修改班次信息
/// 修改配方信息
/// </summary>
/// <param name="sysUserEntity"></param>
/// <param name="recipeEntity"></param>
/// <returns></returns>
public bool UpdateShiftInfo(ZxRecipeEntity sysUserEntity)
public bool UpdateRecipeInfo(ZxRecipeEntity recipeEntity)
{
try
{
return _repository.Update(sysUserEntity);
return _repository.Update(recipeEntity);
}
catch(Exception ex)
{
@ -60,5 +60,44 @@ namespace HighWayIot.Repository.service
return false;
}
}
/// <summary>
/// 新增配方信息
/// </summary>
/// <param name="recipeEntity"></param>
/// <returns></returns>
public bool InsertRecipeInfo(ZxRecipeEntity recipeEntity)
{
try
{
return _repository.Insert(recipeEntity);
}
catch (Exception ex)
{
log.Error("物料信息添加异常", ex);
return false;
}
}
/// <summary>
/// 删除配方信息
/// </summary>
/// <param name="recipeCode"></param>
/// <returns></returns>
public bool DeleteRecipeInfoByRecipeCode(string recipeCode)
{
try
{
ZxRecipeEntity e = _repository.GetById(recipeCode);
e.IsDeleted = true;
return _repository.Update(e);
}
catch (Exception ex)
{
log.Error("物料信息删除异常", ex);
return false;
}
}
}
}

@ -33,8 +33,8 @@ namespace HighWayIot.Repository.service
{
try
{
List<ZxWeightEntity> deviceInfo = _repository.GetList();
return deviceInfo;
List<ZxWeightEntity> entity = _repository.GetList();
return entity;
}
catch (Exception ex)
{
@ -46,13 +46,13 @@ namespace HighWayIot.Repository.service
/// <summary>
/// 修改班次信息
/// </summary>
/// <param name="sysUserEntity"></param>
/// <param name="entity"></param>
/// <returns></returns>
public bool UpdateShiftInfo(ZxWeightEntity sysUserEntity)
public bool UpdateShiftInfo(ZxWeightEntity entity)
{
try
{
return _repository.Update(sysUserEntity);
return _repository.Update(entity);
}
catch(Exception ex)
{

@ -77,6 +77,24 @@
<Compile Include="UserControlPages\LogPages\OperateConfigPage.Designer.cs">
<DependentUpon>OperateConfigPage.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\MaterialConfigPages\MaterialAddForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UserControlPages\MaterialConfigPages\MaterialAddForm.Designer.cs">
<DependentUpon>MaterialAddForm.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\MaterialConfigPages\MaterialTypeConfigPage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControlPages\MaterialConfigPages\MaterialTypeConfigPage.Designer.cs">
<DependentUpon>MaterialTypeConfigPage.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\MaterialConfigPages\MaterialUpdateForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UserControlPages\MaterialConfigPages\MaterialUpdateForm.Designer.cs">
<DependentUpon>MaterialUpdateForm.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\MonitorMainPage.cs">
<SubType>UserControl</SubType>
</Compile>
@ -107,10 +125,10 @@
<Compile Include="UserControlPages\ProductionScheduling.Designer.cs">
<DependentUpon>ProductionScheduling.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\MaterialConfigPage.cs">
<Compile Include="UserControlPages\MaterialConfigPages\MaterialConfigPage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControlPages\MaterialConfigPage.Designer.cs">
<Compile Include="UserControlPages\MaterialConfigPages\MaterialConfigPage.Designer.cs">
<DependentUpon>MaterialConfigPage.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\SysConfigPages\RoleUpdateForm.cs">
@ -183,6 +201,15 @@
<EmbeddedResource Include="UserControlPages\LogPages\OperateConfigPage.resx">
<DependentUpon>OperateConfigPage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\MaterialConfigPages\MaterialAddForm.resx">
<DependentUpon>MaterialAddForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\MaterialConfigPages\MaterialTypeConfigPage.resx">
<DependentUpon>MaterialTypeConfigPage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\MaterialConfigPages\MaterialUpdateForm.resx">
<DependentUpon>MaterialUpdateForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\MonitorMainPage.resx">
<DependentUpon>MonitorMainPage.cs</DependentUpon>
</EmbeddedResource>
@ -198,7 +225,7 @@
<EmbeddedResource Include="UserControlPages\ProductionScheduling.resx">
<DependentUpon>ProductionScheduling.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\MaterialConfigPage.resx">
<EmbeddedResource Include="UserControlPages\MaterialConfigPages\MaterialConfigPage.resx">
<DependentUpon>MaterialConfigPage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\SysConfigPages\RoleUpdateForm.resx">

@ -47,7 +47,7 @@ namespace HighWayIot.Winform.MainForm
this.AlarmLogStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MonitorMainPageStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ProductionSchedulingStripItem = new System.Windows.Forms.ToolStripMenuItem();
this.MaterialConfigStripItem = new System.Windows.Forms.ToolStripMenuItem();
this.MaterialMenuStripItem = new System.Windows.Forms.ToolStripMenuItem();
this.RecipeConfigStripItem = new System.Windows.Forms.ToolStripMenuItem();
this.EquipMaterialBindingStripItem = new System.Windows.Forms.ToolStripMenuItem();
this.TestMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -62,6 +62,8 @@ namespace HighWayIot.Winform.MainForm
this.StripLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.TimeStripLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.TimeDisplayTimer = new System.Windows.Forms.Timer(this.components);
this.MaterialConfigStripItem = new System.Windows.Forms.ToolStripMenuItem();
this.MaterialTypeConfigStripItem = new System.Windows.Forms.ToolStripMenuItem();
this.MainMenu.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
@ -73,7 +75,7 @@ namespace HighWayIot.Winform.MainForm
this.LogManageStripMenuItem,
this.MonitorMainPageStripMenuItem,
this.ProductionSchedulingStripItem,
this.MaterialConfigStripItem,
this.MaterialMenuStripItem,
this.RecipeConfigStripItem,
this.EquipMaterialBindingStripItem,
this.TestMenuItem});
@ -144,21 +146,21 @@ namespace HighWayIot.Winform.MainForm
// DaliyReportStripItem
//
this.DaliyReportStripItem.Name = "DaliyReportStripItem";
this.DaliyReportStripItem.Size = new System.Drawing.Size(180, 22);
this.DaliyReportStripItem.Size = new System.Drawing.Size(124, 22);
this.DaliyReportStripItem.Text = "日报表";
this.DaliyReportStripItem.Click += new System.EventHandler(this.StripMenuItemClick);
//
// OperateLogStripMenuItem
//
this.OperateLogStripMenuItem.Name = "OperateLogStripMenuItem";
this.OperateLogStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.OperateLogStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.OperateLogStripMenuItem.Text = "操作日志";
this.OperateLogStripMenuItem.Click += new System.EventHandler(this.StripMenuItemClick);
//
// AlarmLogStripMenuItem
//
this.AlarmLogStripMenuItem.Name = "AlarmLogStripMenuItem";
this.AlarmLogStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.AlarmLogStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.AlarmLogStripMenuItem.Text = "报警日志";
this.AlarmLogStripMenuItem.Click += new System.EventHandler(this.StripMenuItemClick);
//
@ -176,12 +178,14 @@ namespace HighWayIot.Winform.MainForm
this.ProductionSchedulingStripItem.Text = "生产排程";
this.ProductionSchedulingStripItem.Click += new System.EventHandler(this.StripMenuItemClick);
//
// MaterialConfigStripItem
// MaterialMenuStripItem
//
this.MaterialConfigStripItem.Name = "MaterialConfigStripItem";
this.MaterialConfigStripItem.Size = new System.Drawing.Size(80, 22);
this.MaterialConfigStripItem.Text = "原材料管理";
this.MaterialConfigStripItem.Click += new System.EventHandler(this.StripMenuItemClick);
this.MaterialMenuStripItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MaterialConfigStripItem,
this.MaterialTypeConfigStripItem});
this.MaterialMenuStripItem.Name = "MaterialMenuStripItem";
this.MaterialMenuStripItem.Size = new System.Drawing.Size(80, 22);
this.MaterialMenuStripItem.Text = "原材料管理";
//
// RecipeConfigStripItem
//
@ -296,6 +300,20 @@ namespace HighWayIot.Winform.MainForm
this.TimeDisplayTimer.Interval = 1000;
this.TimeDisplayTimer.Tick += new System.EventHandler(this.TimeDisplayTimer_Tick);
//
// MaterialConfigStripItem
//
this.MaterialConfigStripItem.Name = "MaterialConfigStripItem";
this.MaterialConfigStripItem.Size = new System.Drawing.Size(180, 22);
this.MaterialConfigStripItem.Text = "物料管理";
this.MaterialConfigStripItem.Click += new System.EventHandler(this.StripMenuItemClick);
//
// MaterialTypeConfigStripItem
//
this.MaterialTypeConfigStripItem.Name = "MaterialTypeConfigStripItem";
this.MaterialTypeConfigStripItem.Size = new System.Drawing.Size(180, 22);
this.MaterialTypeConfigStripItem.Text = "物料类型管理";
this.MaterialTypeConfigStripItem.Click += new System.EventHandler(this.StripMenuItemClick);
//
// BaseForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -346,8 +364,10 @@ namespace HighWayIot.Winform.MainForm
private ToolStripMenuItem ShiftTimeConfigStripItem;
private ToolStripMenuItem DaliyReportStripItem;
private ToolStripMenuItem ProductionSchedulingStripItem;
private ToolStripMenuItem MaterialConfigStripItem;
private ToolStripMenuItem MaterialMenuStripItem;
private ToolStripMenuItem RecipeConfigStripItem;
private ToolStripMenuItem EquipMaterialBindingStripItem;
private ToolStripMenuItem MaterialConfigStripItem;
private ToolStripMenuItem MaterialTypeConfigStripItem;
}
}

@ -1,6 +1,7 @@
using HighWayIot.Log4net;
using HighWayIot.Winform.Business;
using HighWayIot.Winform.UserControlPages;
using HighWayIot.Winform.UserControlPages.MaterialConfigPages;
using HighWayIot.Winform.UserControlPages.SysConfigPages;
using System;
using System.Collections.Generic;
@ -103,9 +104,12 @@ namespace HighWayIot.Winform.MainForm
case "班时间维护":
UserPanelSwitch(typeof(ShiftTimePage), button.Text);
break;
case "原材料管理":
case "料管理":
UserPanelSwitch(typeof(MaterialConfigPage), button.Text);
break;
case "物料类型管理":
UserPanelSwitch(typeof(MaterialTypeConfigPage), button.Text);
break;
case "配方管理":
UserPanelSwitch(typeof(RecipeConfigPage), button.Text);
break;
@ -258,6 +262,5 @@ namespace HighWayIot.Winform.MainForm
TraverseMenuitem(i);
}
}
}
}

@ -1,98 +0,0 @@
using System.Drawing;
using System.Windows.Forms;
namespace HighWayIot.Winform.UserControlPages
{
partial class MaterialConfigPage
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.RoleDataGridView = new System.Windows.Forms.DataGridView();
this.AddRole = new System.Windows.Forms.Button();
this.ButtonPanel = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.RoleDataGridView)).BeginInit();
this.ButtonPanel.SuspendLayout();
this.SuspendLayout();
//
// RoleDataGridView
//
this.RoleDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.RoleDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.RoleDataGridView.Location = new System.Drawing.Point(0, 65);
this.RoleDataGridView.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.RoleDataGridView.Name = "RoleDataGridView";
this.RoleDataGridView.RowTemplate.Height = 25;
this.RoleDataGridView.Size = new System.Drawing.Size(1350, 898);
this.RoleDataGridView.TabIndex = 0;
this.RoleDataGridView.Tag = "";
//
// AddRole
//
this.AddRole.Location = new System.Drawing.Point(11, 11);
this.AddRole.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.AddRole.Name = "AddRole";
this.AddRole.Size = new System.Drawing.Size(103, 39);
this.AddRole.TabIndex = 1;
this.AddRole.Text = "查询操作信息";
this.AddRole.UseVisualStyleBackColor = true;
//
// ButtonPanel
//
this.ButtonPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ButtonPanel.Controls.Add(this.AddRole);
this.ButtonPanel.Location = new System.Drawing.Point(0, 0);
this.ButtonPanel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.ButtonPanel.Name = "ButtonPanel";
this.ButtonPanel.Size = new System.Drawing.Size(1350, 61);
this.ButtonPanel.TabIndex = 4;
//
// MaterialConfigPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLight;
this.Controls.Add(this.ButtonPanel);
this.Controls.Add(this.RoleDataGridView);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "MaterialConfigPage";
this.Size = new System.Drawing.Size(1350, 963);
((System.ComponentModel.ISupportInitialize)(this.RoleDataGridView)).EndInit();
this.ButtonPanel.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private DataGridView RoleDataGridView;
private Button AddRole;
private Panel ButtonPanel;
}
}

@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HighWayIot.Winform.UserControlPages
{
public partial class MaterialConfigPage : UserControl
{
public MaterialConfigPage()
{
InitializeComponent();
}
private void UpdateRole_Click(object sender, EventArgs e)
{
}
}
}

@ -0,0 +1,177 @@
namespace HighWayIot.Winform.UserControlPages.SysConfigPages
{
partial class MaterialAddForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.MaterialCodeTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.MaterialNameTextBox = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.MaterialTypeComboBox = new System.Windows.Forms.ComboBox();
this.ConfrimAddButton = new System.Windows.Forms.Button();
this.ChildComboBox = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.IsUseCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(86, 58);
this.label1.Name = "label1";
this.label1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.label1.Size = new System.Drawing.Size(0, 12);
this.label1.TabIndex = 0;
//
// MaterialCodeTextBox
//
this.MaterialCodeTextBox.Location = new System.Drawing.Point(128, 26);
this.MaterialCodeTextBox.Name = "MaterialCodeTextBox";
this.MaterialCodeTextBox.Size = new System.Drawing.Size(136, 21);
this.MaterialCodeTextBox.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(57, 30);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 12);
this.label2.TabIndex = 2;
this.label2.Text = "物料代码:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(57, 57);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 12);
this.label3.TabIndex = 4;
this.label3.Text = "物料名称:";
//
// MaterialNameTextBox
//
this.MaterialNameTextBox.Location = new System.Drawing.Point(128, 54);
this.MaterialNameTextBox.Name = "MaterialNameTextBox";
this.MaterialNameTextBox.Size = new System.Drawing.Size(136, 21);
this.MaterialNameTextBox.TabIndex = 3;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(57, 84);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(65, 12);
this.label4.TabIndex = 6;
this.label4.Text = "物料类型:";
//
// MaterialTypeComboBox
//
this.MaterialTypeComboBox.FormattingEnabled = true;
this.MaterialTypeComboBox.Location = new System.Drawing.Point(128, 81);
this.MaterialTypeComboBox.Name = "MaterialTypeComboBox";
this.MaterialTypeComboBox.Size = new System.Drawing.Size(136, 20);
this.MaterialTypeComboBox.TabIndex = 7;
//
// ConfrimAddButton
//
this.ConfrimAddButton.Location = new System.Drawing.Point(100, 164);
this.ConfrimAddButton.Name = "ConfrimAddButton";
this.ConfrimAddButton.Size = new System.Drawing.Size(110, 41);
this.ConfrimAddButton.TabIndex = 8;
this.ConfrimAddButton.Text = "确认添加";
this.ConfrimAddButton.UseVisualStyleBackColor = true;
this.ConfrimAddButton.Click += new System.EventHandler(this.ConfrimAddButton_Click);
//
// ChildComboBox
//
this.ChildComboBox.FormattingEnabled = true;
this.ChildComboBox.Location = new System.Drawing.Point(128, 107);
this.ChildComboBox.Name = "ChildComboBox";
this.ChildComboBox.Size = new System.Drawing.Size(136, 20);
this.ChildComboBox.TabIndex = 10;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(45, 110);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(77, 12);
this.label5.TabIndex = 9;
this.label5.Text = "子物料类型:";
//
// IsUseCheckBox
//
this.IsUseCheckBox.AutoSize = true;
this.IsUseCheckBox.Location = new System.Drawing.Point(128, 133);
this.IsUseCheckBox.Name = "IsUseCheckBox";
this.IsUseCheckBox.Size = new System.Drawing.Size(72, 16);
this.IsUseCheckBox.TabIndex = 12;
this.IsUseCheckBox.Text = "是否启用";
this.IsUseCheckBox.UseVisualStyleBackColor = true;
//
// MaterialAddForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(319, 227);
this.Controls.Add(this.IsUseCheckBox);
this.Controls.Add(this.ChildComboBox);
this.Controls.Add(this.label5);
this.Controls.Add(this.ConfrimAddButton);
this.Controls.Add(this.MaterialTypeComboBox);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.MaterialNameTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.MaterialCodeTextBox);
this.Controls.Add(this.label1);
this.Name = "MaterialAddForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "添加物料";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox MaterialCodeTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox MaterialNameTextBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox MaterialTypeComboBox;
private System.Windows.Forms.Button ConfrimAddButton;
private System.Windows.Forms.ComboBox ChildComboBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.CheckBox IsUseCheckBox;
}
}

@ -0,0 +1,39 @@
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HighWayIot.Winform.UserControlPages.SysConfigPages
{
public partial class MaterialAddForm : Form
{
/// <summary>
/// 物料数据库业务实例
/// </summary>
ZxMaterialService zxMaterialService = ZxMaterialService.Instance;
public MaterialAddForm()
{
InitializeComponent();
}
/// <summary>
/// 确认添加按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ConfrimAddButton_Click(object sender, EventArgs e)
{
this.Close();
this.Dispose();
}
}
}

@ -0,0 +1,215 @@
using System.Drawing;
using System.Windows.Forms;
namespace HighWayIot.Winform.UserControlPages
{
partial class MaterialConfigPage
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.MaterialDataGridView = new System.Windows.Forms.DataGridView();
this.AddMaterial = new System.Windows.Forms.Button();
this.ButtonPanel = new System.Windows.Forms.Panel();
this.UpdateMaterial = new System.Windows.Forms.Button();
this.DeleteMaterial = new System.Windows.Forms.Button();
this.SelectMaterial = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.MaterialNameTextbox = new System.Windows.Forms.TextBox();
this.MaterialCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.MaterialName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.MaterialType = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ChildType = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.IsUse = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.MaterialDataGridView)).BeginInit();
this.ButtonPanel.SuspendLayout();
this.SuspendLayout();
//
// MaterialDataGridView
//
this.MaterialDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.MaterialDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.MaterialDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.MaterialCode,
this.MaterialName,
this.MaterialType,
this.ChildType,
this.IsUse});
this.MaterialDataGridView.Location = new System.Drawing.Point(0, 65);
this.MaterialDataGridView.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.MaterialDataGridView.Name = "MaterialDataGridView";
this.MaterialDataGridView.RowHeadersVisible = false;
this.MaterialDataGridView.RowTemplate.Height = 25;
this.MaterialDataGridView.Size = new System.Drawing.Size(1350, 898);
this.MaterialDataGridView.TabIndex = 0;
this.MaterialDataGridView.Tag = "";
//
// AddMaterial
//
this.AddMaterial.Location = new System.Drawing.Point(11, 11);
this.AddMaterial.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.AddMaterial.Name = "AddMaterial";
this.AddMaterial.Size = new System.Drawing.Size(103, 39);
this.AddMaterial.TabIndex = 1;
this.AddMaterial.Text = "添加物料信息";
this.AddMaterial.UseVisualStyleBackColor = true;
this.AddMaterial.Click += new System.EventHandler(this.AddMaterial_Click);
//
// ButtonPanel
//
this.ButtonPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ButtonPanel.Controls.Add(this.MaterialNameTextbox);
this.ButtonPanel.Controls.Add(this.label1);
this.ButtonPanel.Controls.Add(this.SelectMaterial);
this.ButtonPanel.Controls.Add(this.DeleteMaterial);
this.ButtonPanel.Controls.Add(this.UpdateMaterial);
this.ButtonPanel.Controls.Add(this.AddMaterial);
this.ButtonPanel.Location = new System.Drawing.Point(0, 0);
this.ButtonPanel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.ButtonPanel.Name = "ButtonPanel";
this.ButtonPanel.Size = new System.Drawing.Size(1350, 61);
this.ButtonPanel.TabIndex = 4;
//
// UpdateMaterial
//
this.UpdateMaterial.Location = new System.Drawing.Point(120, 11);
this.UpdateMaterial.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.UpdateMaterial.Name = "UpdateMaterial";
this.UpdateMaterial.Size = new System.Drawing.Size(103, 39);
this.UpdateMaterial.TabIndex = 2;
this.UpdateMaterial.Text = "修改物料信息";
this.UpdateMaterial.UseVisualStyleBackColor = true;
this.UpdateMaterial.Click += new System.EventHandler(this.UpdateMaterial_Click);
//
// DeleteMaterial
//
this.DeleteMaterial.Location = new System.Drawing.Point(229, 11);
this.DeleteMaterial.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.DeleteMaterial.Name = "DeleteMaterial";
this.DeleteMaterial.Size = new System.Drawing.Size(103, 39);
this.DeleteMaterial.TabIndex = 3;
this.DeleteMaterial.Text = "删除物料信息";
this.DeleteMaterial.UseVisualStyleBackColor = true;
this.DeleteMaterial.Click += new System.EventHandler(this.DeleteMaterial_Click);
//
// SelectMaterial
//
this.SelectMaterial.Location = new System.Drawing.Point(338, 11);
this.SelectMaterial.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.SelectMaterial.Name = "SelectMaterial";
this.SelectMaterial.Size = new System.Drawing.Size(103, 39);
this.SelectMaterial.TabIndex = 4;
this.SelectMaterial.Text = "查询物料信息";
this.SelectMaterial.UseVisualStyleBackColor = true;
this.SelectMaterial.Click += new System.EventHandler(this.SelectMaterial_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(456, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 5;
this.label1.Text = "物料名称:";
//
// MaterialNameTextbox
//
this.MaterialNameTextbox.Location = new System.Drawing.Point(526, 20);
this.MaterialNameTextbox.Name = "MaterialNameTextbox";
this.MaterialNameTextbox.Size = new System.Drawing.Size(130, 21);
this.MaterialNameTextbox.TabIndex = 6;
//
// MaterialCode
//
this.MaterialCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.MaterialCode.DataPropertyName = "MaterialCode";
this.MaterialCode.HeaderText = "物料编码";
this.MaterialCode.Name = "MaterialCode";
//
// MaterialName
//
this.MaterialName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.MaterialName.DataPropertyName = "MaterialName";
this.MaterialName.HeaderText = "物料名称";
this.MaterialName.Name = "MaterialName";
//
// MaterialType
//
this.MaterialType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.MaterialType.DataPropertyName = "MaterialType";
this.MaterialType.HeaderText = "物料类型";
this.MaterialType.Name = "MaterialType";
//
// ChildType
//
this.ChildType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.ChildType.DataPropertyName = "ChildType";
this.ChildType.HeaderText = "物料子类型";
this.ChildType.Name = "ChildType";
//
// IsUse
//
this.IsUse.DataPropertyName = "IsUse";
this.IsUse.HeaderText = "是否启用";
this.IsUse.Name = "IsUse";
//
// MaterialConfigPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLight;
this.Controls.Add(this.ButtonPanel);
this.Controls.Add(this.MaterialDataGridView);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "MaterialConfigPage";
this.Size = new System.Drawing.Size(1350, 963);
((System.ComponentModel.ISupportInitialize)(this.MaterialDataGridView)).EndInit();
this.ButtonPanel.ResumeLayout(false);
this.ButtonPanel.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private DataGridView MaterialDataGridView;
private Button AddMaterial;
private Panel ButtonPanel;
private Button DeleteMaterial;
private Button UpdateMaterial;
private Button SelectMaterial;
private TextBox MaterialNameTextbox;
private Label label1;
private DataGridViewTextBoxColumn MaterialCode;
private DataGridViewTextBoxColumn MaterialName;
private DataGridViewTextBoxColumn MaterialType;
private DataGridViewTextBoxColumn ChildType;
private DataGridViewTextBoxColumn IsUse;
}
}

@ -0,0 +1,97 @@
using HighWayIot.Repository.service;
using HighWayIot.Winform.UserControlPages.SysConfigPages;
using Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HighWayIot.Winform.UserControlPages
{
public partial class MaterialConfigPage : UserControl
{
ZxMaterialService zxMaterialService = ZxMaterialService.Instance;
List<ZxMaterialEntity> Lists;
public MaterialConfigPage()
{
InitializeComponent();
Init();
}
private void Init()
{
MaterialDataGridView.AutoGenerateColumns = false;
Lists = zxMaterialService.GetMaterialInfos();
MaterialDataGridView.DataSource = null;
MaterialDataGridView.DataSource = Lists;
}
/// <summary>
/// 添加物料
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void AddMaterial_Click(object sender, EventArgs e)
{
MaterialAddForm form = new MaterialAddForm();
form.ShowDialog();
Lists = zxMaterialService.GetMaterialInfos();
MaterialDataGridView.DataSource = null;
MaterialDataGridView.DataSource = Lists;
}
/// <summary>
/// 更新物料
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void UpdateMaterial_Click(object sender, EventArgs e)
{
ZxMaterialEntity entity = new ZxMaterialEntity();
int a = MaterialDataGridView.CurrentRow.Index;
entity.MaterialCode = MaterialDataGridView.Rows[a].Cells["MaterialCode"].Value.ToString();
entity.MaterialName = MaterialDataGridView.Rows[a].Cells["MaterialName"].Value.ToString();
entity.MaterialType = MaterialDataGridView.Rows[a].Cells["MaterialType"].Value.ToString();
entity.ChildType = MaterialDataGridView.Rows[a].Cells["ChildType"].Value.ToString();
bool.TryParse(MaterialDataGridView.Rows[a].Cells["IsUse"].Value.ToString(), out bool b);
entity.IsUse = b;
entity.IsDeleted = false;
MaterialUpdateForm form = new MaterialUpdateForm(entity);
form.ShowDialog();
Lists = zxMaterialService.GetMaterialInfos();
MaterialDataGridView.DataSource = null;
MaterialDataGridView.DataSource = Lists;
}
/// <summary>
/// 删除物料
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DeleteMaterial_Click(object sender, EventArgs e)
{
Lists = zxMaterialService.GetMaterialInfos();
MaterialDataGridView.DataSource = null;
MaterialDataGridView.DataSource = Lists;
}
/// <summary>
/// 查询物料
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SelectMaterial_Click(object sender, EventArgs e)
{
}
}
}

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="MaterialCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="MaterialName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="MaterialType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ChildType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="IsUse.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

@ -0,0 +1,314 @@
namespace HighWayIot.Winform.UserControlPages.MaterialConfigPages
{
partial class MaterialTypeConfigPage
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Controlpanel = new System.Windows.Forms.Panel();
this.AddMaterialTypeButton = new System.Windows.Forms.Button();
this.Datapanel = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.DeleteMaterialTypeButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.MaterialTypeTextBox = new System.Windows.Forms.TextBox();
this.MaterialChildTypeTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.DeleteMaterialChildTypeButton = new System.Windows.Forms.Button();
this.AddMaterialChildTypeButton = new System.Windows.Forms.Button();
this.MaterialTypeDataGridView = new System.Windows.Forms.DataGridView();
this.MaterialChildTypeDataGridView = new System.Windows.Forms.DataGridView();
this.Id = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.MaterialTypeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ChildId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.MaterialChildTypeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Controlpanel.SuspendLayout();
this.Datapanel.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.MaterialTypeDataGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MaterialChildTypeDataGridView)).BeginInit();
this.SuspendLayout();
//
// Controlpanel
//
this.Controlpanel.Controls.Add(this.groupBox2);
this.Controlpanel.Controls.Add(this.groupBox1);
this.Controlpanel.Dock = System.Windows.Forms.DockStyle.Top;
this.Controlpanel.Location = new System.Drawing.Point(0, 0);
this.Controlpanel.Margin = new System.Windows.Forms.Padding(0);
this.Controlpanel.Name = "Controlpanel";
this.Controlpanel.Size = new System.Drawing.Size(1145, 79);
this.Controlpanel.TabIndex = 0;
//
// AddMaterialTypeButton
//
this.AddMaterialTypeButton.Location = new System.Drawing.Point(6, 20);
this.AddMaterialTypeButton.Name = "AddMaterialTypeButton";
this.AddMaterialTypeButton.Size = new System.Drawing.Size(97, 42);
this.AddMaterialTypeButton.TabIndex = 0;
this.AddMaterialTypeButton.Text = "物料类型添加";
this.AddMaterialTypeButton.UseVisualStyleBackColor = true;
this.AddMaterialTypeButton.Click += new System.EventHandler(this.AddMaterialTypeButton_Click);
//
// Datapanel
//
this.Datapanel.Controls.Add(this.groupBox4);
this.Datapanel.Controls.Add(this.groupBox3);
this.Datapanel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.Datapanel.Location = new System.Drawing.Point(0, 79);
this.Datapanel.Margin = new System.Windows.Forms.Padding(0);
this.Datapanel.Name = "Datapanel";
this.Datapanel.Size = new System.Drawing.Size(1145, 710);
this.Datapanel.TabIndex = 1;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.MaterialTypeTextBox);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.DeleteMaterialTypeButton);
this.groupBox1.Controls.Add(this.AddMaterialTypeButton);
this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(569, 73);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "物料类别控制";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.MaterialChildTypeTextBox);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.DeleteMaterialChildTypeButton);
this.groupBox2.Controls.Add(this.AddMaterialChildTypeButton);
this.groupBox2.Location = new System.Drawing.Point(578, 3);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(564, 73);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "物料子类别控制";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.MaterialTypeDataGridView);
this.groupBox3.Location = new System.Drawing.Point(3, 3);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(569, 704);
this.groupBox3.TabIndex = 1;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "物料类别";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.MaterialChildTypeDataGridView);
this.groupBox4.Location = new System.Drawing.Point(578, 3);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(564, 704);
this.groupBox4.TabIndex = 2;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "物料子类别";
//
// DeleteMaterialTypeButton
//
this.DeleteMaterialTypeButton.Location = new System.Drawing.Point(468, 20);
this.DeleteMaterialTypeButton.Name = "DeleteMaterialTypeButton";
this.DeleteMaterialTypeButton.Size = new System.Drawing.Size(95, 42);
this.DeleteMaterialTypeButton.TabIndex = 1;
this.DeleteMaterialTypeButton.Text = "物料类型删除";
this.DeleteMaterialTypeButton.UseVisualStyleBackColor = true;
this.DeleteMaterialTypeButton.Click += new System.EventHandler(this.DeleteMaterialTypeButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(107, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(101, 12);
this.label1.TabIndex = 2;
this.label1.Text = "要添加类型的名称";
//
// MaterialTypeTextBox
//
this.MaterialTypeTextBox.Location = new System.Drawing.Point(109, 41);
this.MaterialTypeTextBox.Name = "MaterialTypeTextBox";
this.MaterialTypeTextBox.Size = new System.Drawing.Size(99, 21);
this.MaterialTypeTextBox.TabIndex = 3;
//
// MaterialChildTypeTextBox
//
this.MaterialChildTypeTextBox.Location = new System.Drawing.Point(117, 41);
this.MaterialChildTypeTextBox.Name = "MaterialChildTypeTextBox";
this.MaterialChildTypeTextBox.Size = new System.Drawing.Size(99, 21);
this.MaterialChildTypeTextBox.TabIndex = 7;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(115, 20);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(113, 12);
this.label2.TabIndex = 6;
this.label2.Text = "要添加子类型的名称";
//
// DeleteMaterialChildTypeButton
//
this.DeleteMaterialChildTypeButton.Location = new System.Drawing.Point(452, 20);
this.DeleteMaterialChildTypeButton.Name = "DeleteMaterialChildTypeButton";
this.DeleteMaterialChildTypeButton.Size = new System.Drawing.Size(106, 42);
this.DeleteMaterialChildTypeButton.TabIndex = 5;
this.DeleteMaterialChildTypeButton.Text = "物料子类型删除";
this.DeleteMaterialChildTypeButton.UseVisualStyleBackColor = true;
this.DeleteMaterialChildTypeButton.Click += new System.EventHandler(this.DeleteMaterialChildTypeButton_Click);
//
// AddMaterialChildTypeButton
//
this.AddMaterialChildTypeButton.Location = new System.Drawing.Point(6, 20);
this.AddMaterialChildTypeButton.Name = "AddMaterialChildTypeButton";
this.AddMaterialChildTypeButton.Size = new System.Drawing.Size(105, 42);
this.AddMaterialChildTypeButton.TabIndex = 4;
this.AddMaterialChildTypeButton.Text = "物料子类型添加";
this.AddMaterialChildTypeButton.UseVisualStyleBackColor = true;
this.AddMaterialChildTypeButton.Click += new System.EventHandler(this.AddMaterialChildTypeButton_Click);
//
// MaterialTypeDataGridView
//
this.MaterialTypeDataGridView.AllowUserToAddRows = false;
this.MaterialTypeDataGridView.AllowUserToDeleteRows = false;
this.MaterialTypeDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.MaterialTypeDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Id,
this.MaterialTypeName});
this.MaterialTypeDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.MaterialTypeDataGridView.Location = new System.Drawing.Point(3, 17);
this.MaterialTypeDataGridView.Name = "MaterialTypeDataGridView";
this.MaterialTypeDataGridView.ReadOnly = true;
this.MaterialTypeDataGridView.RowHeadersVisible = false;
this.MaterialTypeDataGridView.RowTemplate.Height = 23;
this.MaterialTypeDataGridView.Size = new System.Drawing.Size(563, 684);
this.MaterialTypeDataGridView.TabIndex = 0;
this.MaterialTypeDataGridView.SelectionChanged += new System.EventHandler(this.MaterialTypeDataGridView_SelectionChanged);
//
// MaterialChildTypeDataGridView
//
this.MaterialChildTypeDataGridView.AllowUserToAddRows = false;
this.MaterialChildTypeDataGridView.AllowUserToDeleteRows = false;
this.MaterialChildTypeDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.MaterialChildTypeDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ChildId,
this.MaterialChildTypeName});
this.MaterialChildTypeDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.MaterialChildTypeDataGridView.Location = new System.Drawing.Point(3, 17);
this.MaterialChildTypeDataGridView.Name = "MaterialChildTypeDataGridView";
this.MaterialChildTypeDataGridView.ReadOnly = true;
this.MaterialChildTypeDataGridView.RowHeadersVisible = false;
this.MaterialChildTypeDataGridView.RowTemplate.Height = 23;
this.MaterialChildTypeDataGridView.Size = new System.Drawing.Size(558, 684);
this.MaterialChildTypeDataGridView.TabIndex = 1;
//
// Id
//
this.Id.DataPropertyName = "Id";
this.Id.HeaderText = "Id";
this.Id.Name = "Id";
this.Id.ReadOnly = true;
this.Id.Width = 40;
//
// MaterialTypeName
//
this.MaterialTypeName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.MaterialTypeName.DataPropertyName = "MaterialTypeName";
this.MaterialTypeName.HeaderText = "物料类型";
this.MaterialTypeName.Name = "MaterialTypeName";
this.MaterialTypeName.ReadOnly = true;
//
// ChildId
//
this.ChildId.DataPropertyName = "Id";
this.ChildId.HeaderText = "Id";
this.ChildId.Name = "ChildId";
this.ChildId.ReadOnly = true;
this.ChildId.Width = 40;
//
// MaterialChildTypeName
//
this.MaterialChildTypeName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.MaterialChildTypeName.DataPropertyName = "MaterialChlidTypeName";
this.MaterialChildTypeName.HeaderText = "物料子类型";
this.MaterialChildTypeName.Name = "MaterialChildTypeName";
this.MaterialChildTypeName.ReadOnly = true;
//
// MaterialTypeConfigPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLight;
this.Controls.Add(this.Datapanel);
this.Controls.Add(this.Controlpanel);
this.Name = "MaterialTypeConfigPage";
this.Size = new System.Drawing.Size(1145, 789);
this.Controlpanel.ResumeLayout(false);
this.Datapanel.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.MaterialTypeDataGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MaterialChildTypeDataGridView)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel Controlpanel;
private System.Windows.Forms.Button AddMaterialTypeButton;
private System.Windows.Forms.Panel Datapanel;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox MaterialChildTypeTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button DeleteMaterialChildTypeButton;
private System.Windows.Forms.Button AddMaterialChildTypeButton;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox MaterialTypeTextBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button DeleteMaterialTypeButton;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.DataGridView MaterialTypeDataGridView;
private System.Windows.Forms.DataGridView MaterialChildTypeDataGridView;
private System.Windows.Forms.DataGridViewTextBoxColumn Id;
private System.Windows.Forms.DataGridViewTextBoxColumn MaterialTypeName;
private System.Windows.Forms.DataGridViewTextBoxColumn ChildId;
private System.Windows.Forms.DataGridViewTextBoxColumn MaterialChildTypeName;
}
}

@ -0,0 +1,112 @@
using HighWayIot.Repository.service;
using Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HighWayIot.Winform.UserControlPages.MaterialConfigPages
{
public partial class MaterialTypeConfigPage : UserControl
{
/// <summary>
/// 物料子类型服务类实例
/// </summary>
ZxMaterialChildTypeService zxMaterialChildTypeService = ZxMaterialChildTypeService.Instance;
/// <summary>
/// 物料类型服务类实例
/// </summary>
ZxMaterialTypeService zxMaterialTypeService = ZxMaterialTypeService.Instance;
/// <summary>
/// 物料子类型列表
/// </summary>
List<ZxMaterialChildTypeEntity> zxMaterialChildTypeList;
/// <summary>
/// 物料类型列表
/// </summary>
List<ZxMaterialTypeEntity> zxMaterialTypeList;
public MaterialTypeConfigPage()
{
InitializeComponent();
Init();
}
private void Init()
{
MaterialTypeDataGridView.AutoGenerateColumns = false;
MaterialChildTypeDataGridView.AutoGenerateColumns = false;
zxMaterialTypeList = zxMaterialTypeService.GetMaterialTypeInfos();
MaterialTypeDataGridView.DataSource = null;
MaterialTypeDataGridView.DataSource = zxMaterialTypeList;
}
/// <summary>
/// 物料类型添加
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void AddMaterialTypeButton_Click(object sender, EventArgs e)
{
}
/// <summary>
/// 物料子类型添加
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void AddMaterialChildTypeButton_Click(object sender, EventArgs e)
{
}
/// <summary>
/// 物料类型删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DeleteMaterialTypeButton_Click(object sender, EventArgs e)
{
}
/// <summary>
/// 物料子类型删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DeleteMaterialChildTypeButton_Click(object sender, EventArgs e)
{
}
/// <summary>
/// 所选内容更改事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MaterialTypeDataGridView_SelectionChanged(object sender, EventArgs e)
{
int a = MaterialTypeDataGridView.CurrentRow.Index;
string s = MaterialTypeDataGridView.Rows[a].Cells["MaterialTypeName"].Value.ToString();
zxMaterialChildTypeList = zxMaterialChildTypeService.GetMaterialChildTypeInfos(x => x.MaterialTypeName == s);
MaterialChildTypeDataGridView.DataSource = null;
MaterialChildTypeDataGridView.DataSource = zxMaterialChildTypeList;
}
}
}

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ChildId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="MaterialChildTypeName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="MaterialTypeName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="MaterialTypeName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

@ -0,0 +1,177 @@
namespace HighWayIot.Winform.UserControlPages.SysConfigPages
{
partial class MaterialUpdateForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.IsUseCheckBox = new System.Windows.Forms.CheckBox();
this.ChildComboBox = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.ConfrimAddButton = new System.Windows.Forms.Button();
this.MaterialTypeComboBox = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.MaterialNameTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.MaterialCodeTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// IsUseCheckBox
//
this.IsUseCheckBox.AutoSize = true;
this.IsUseCheckBox.Location = new System.Drawing.Point(130, 131);
this.IsUseCheckBox.Name = "IsUseCheckBox";
this.IsUseCheckBox.Size = new System.Drawing.Size(72, 16);
this.IsUseCheckBox.TabIndex = 23;
this.IsUseCheckBox.Text = "是否启用";
this.IsUseCheckBox.UseVisualStyleBackColor = true;
//
// ChildComboBox
//
this.ChildComboBox.FormattingEnabled = true;
this.ChildComboBox.Location = new System.Drawing.Point(130, 105);
this.ChildComboBox.Name = "ChildComboBox";
this.ChildComboBox.Size = new System.Drawing.Size(136, 20);
this.ChildComboBox.TabIndex = 22;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(47, 108);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(77, 12);
this.label5.TabIndex = 21;
this.label5.Text = "子物料类型:";
//
// ConfrimAddButton
//
this.ConfrimAddButton.Location = new System.Drawing.Point(92, 163);
this.ConfrimAddButton.Name = "ConfrimAddButton";
this.ConfrimAddButton.Size = new System.Drawing.Size(110, 41);
this.ConfrimAddButton.TabIndex = 20;
this.ConfrimAddButton.Text = "确认修改";
this.ConfrimAddButton.UseVisualStyleBackColor = true;
this.ConfrimAddButton.Click += new System.EventHandler(this.ConfrimAddButton_Click);
//
// MaterialTypeComboBox
//
this.MaterialTypeComboBox.FormattingEnabled = true;
this.MaterialTypeComboBox.Location = new System.Drawing.Point(130, 79);
this.MaterialTypeComboBox.Name = "MaterialTypeComboBox";
this.MaterialTypeComboBox.Size = new System.Drawing.Size(136, 20);
this.MaterialTypeComboBox.TabIndex = 19;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(59, 82);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(65, 12);
this.label4.TabIndex = 18;
this.label4.Text = "物料类型:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(59, 55);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 12);
this.label3.TabIndex = 17;
this.label3.Text = "物料名称:";
//
// MaterialNameTextBox
//
this.MaterialNameTextBox.Location = new System.Drawing.Point(130, 52);
this.MaterialNameTextBox.Name = "MaterialNameTextBox";
this.MaterialNameTextBox.Size = new System.Drawing.Size(136, 21);
this.MaterialNameTextBox.TabIndex = 16;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(59, 28);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 12);
this.label2.TabIndex = 15;
this.label2.Text = "物料代码:";
//
// MaterialCodeTextBox
//
this.MaterialCodeTextBox.Location = new System.Drawing.Point(130, 24);
this.MaterialCodeTextBox.Name = "MaterialCodeTextBox";
this.MaterialCodeTextBox.Size = new System.Drawing.Size(136, 21);
this.MaterialCodeTextBox.TabIndex = 14;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(88, 56);
this.label1.Name = "label1";
this.label1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.label1.Size = new System.Drawing.Size(0, 12);
this.label1.TabIndex = 13;
//
// MaterialUpdateForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(319, 227);
this.Controls.Add(this.IsUseCheckBox);
this.Controls.Add(this.ChildComboBox);
this.Controls.Add(this.label5);
this.Controls.Add(this.ConfrimAddButton);
this.Controls.Add(this.MaterialTypeComboBox);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.MaterialNameTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.MaterialCodeTextBox);
this.Controls.Add(this.label1);
this.Name = "MaterialUpdateForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "修改物料信息";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox IsUseCheckBox;
private System.Windows.Forms.ComboBox ChildComboBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button ConfrimAddButton;
private System.Windows.Forms.ComboBox MaterialTypeComboBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox MaterialNameTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox MaterialCodeTextBox;
private System.Windows.Forms.Label label1;
}
}

@ -0,0 +1,44 @@
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HighWayIot.Winform.UserControlPages.SysConfigPages
{
public partial class MaterialUpdateForm : Form
{
/// <summary>
/// 物料数据库业务实例
/// </summary>
private ZxMaterialService zxMaterialService = ZxMaterialService.Instance;
/// <summary>
/// 要修改的实体
/// </summary>
private ZxMaterialEntity _entity;
public MaterialUpdateForm(ZxMaterialEntity entity)
{
InitializeComponent();
_entity = entity;
}
/// <summary>
/// 确认修改按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ConfrimAddButton_Click(object sender, EventArgs e)
{
}
}
}

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -101,7 +101,7 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages
if (_sysUserRoleService.UpdateRoleInfo(_roleEntity))
{
MessageBox.Show("角色修改成功,若重新应用权限需重启软件", "提示", MessageBoxButtons.OK);
MessageBox.Show("角色修改成功,若重新应用权限需注销或重启软件", "提示", MessageBoxButtons.OK);
}
else
{

Loading…
Cancel
Save