diff --git a/HighWayIot.Repository/HighWayIot.Repository.csproj b/HighWayIot.Repository/HighWayIot.Repository.csproj index 47bded0..5c2d5a0 100644 --- a/HighWayIot.Repository/HighWayIot.Repository.csproj +++ b/HighWayIot.Repository/HighWayIot.Repository.csproj @@ -55,12 +55,16 @@ + + + + diff --git a/HighWayIot.Repository/domain/ZxMaterialChildTypeEntity.cs b/HighWayIot.Repository/domain/ZxMaterialChildTypeEntity.cs new file mode 100644 index 0000000..146f159 --- /dev/null +++ b/HighWayIot.Repository/domain/ZxMaterialChildTypeEntity.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace Models +{ + /// + /// 物料子类别 + /// + [SugarTable("zx_material_child_type")] + public class ZxMaterialChildTypeEntity + { + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 备 注:物料类型 + /// 默认值: + /// + [SugarColumn(ColumnName = "material_type_name")] + public string MaterialTypeName { get; set; } = null; + + /// + /// 备 注:物料子类型 + /// 默认值: + /// + [SugarColumn(ColumnName = "material_chlid_type_name")] + public string MaterialChlidTypeName { get; set; } = null; + } + +} \ No newline at end of file diff --git a/HighWayIot.Repository/domain/ZxMaterialEntity.cs b/HighWayIot.Repository/domain/ZxMaterialEntity.cs index f8b59ff..043fdea 100644 --- a/HighWayIot.Repository/domain/ZxMaterialEntity.cs +++ b/HighWayIot.Repository/domain/ZxMaterialEntity.cs @@ -5,7 +5,7 @@ using SqlSugar; namespace Models { /// - /// + /// 物料 /// [SugarTable("zx_material")] public class ZxMaterialEntity diff --git a/HighWayIot.Repository/domain/ZxMaterialTypeEntity.cs b/HighWayIot.Repository/domain/ZxMaterialTypeEntity.cs new file mode 100644 index 0000000..655a10a --- /dev/null +++ b/HighWayIot.Repository/domain/ZxMaterialTypeEntity.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace Models +{ + /// + /// 物料类别 + /// + [SugarTable("zx_material_type")] + public class ZxMaterialTypeEntity + { + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 备 注:物料类型名 + /// 默认值: + /// + [SugarColumn(ColumnName = "material_type_name")] + public string MaterialTypeName { get; set; } = null; + + } + +} \ No newline at end of file diff --git a/HighWayIot.Repository/service/SysShiftTimeService.cs b/HighWayIot.Repository/service/SysShiftTimeService.cs index 4c2a9b3..b1a8e13 100644 --- a/HighWayIot.Repository/service/SysShiftTimeService.cs +++ b/HighWayIot.Repository/service/SysShiftTimeService.cs @@ -32,8 +32,8 @@ namespace HighWayIot.Repository.service { try { - List deviceInfo = _repository.GetList(); - return deviceInfo; + List entity = _repository.GetList(); + return entity; } catch (Exception ex) { @@ -45,13 +45,13 @@ namespace HighWayIot.Repository.service /// /// 修改班次信息 /// - /// + /// /// - public bool UpdateShiftInfo(SysShiftTimeEntity sysUserEntity) + public bool UpdateShiftInfo(SysShiftTimeEntity entity) { try { - return _repository.Update(sysUserEntity); + return _repository.Update(entity); } catch(Exception ex) { diff --git a/HighWayIot.Repository/service/SysUserInfoService.cs b/HighWayIot.Repository/service/SysUserInfoService.cs index bb49e51..d4dbb1b 100644 --- a/HighWayIot.Repository/service/SysUserInfoService.cs +++ b/HighWayIot.Repository/service/SysUserInfoService.cs @@ -37,24 +37,24 @@ namespace HighWayIot.Repository.service { try { - List deviceInfo = _repository.GetList(x => x.IsDeleted == false); + List 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) { diff --git a/HighWayIot.Repository/service/SysUserRoleService.cs b/HighWayIot.Repository/service/SysUserRoleService.cs index f77de97..470676f 100644 --- a/HighWayIot.Repository/service/SysUserRoleService.cs +++ b/HighWayIot.Repository/service/SysUserRoleService.cs @@ -32,10 +32,8 @@ namespace HighWayIot.Repository.service { try { - List deviceInfo = _repository.GetList(); - - - return deviceInfo; + List entity = _repository.GetList(); + return entity; } catch (Exception ex) { diff --git a/HighWayIot.Repository/service/ZxMaterialChildTypeService.cs b/HighWayIot.Repository/service/ZxMaterialChildTypeService.cs new file mode 100644 index 0000000..b56f9c6 --- /dev/null +++ b/HighWayIot.Repository/service/ZxMaterialChildTypeService.cs @@ -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 lazy = new Lazy(() => new ZxMaterialChildTypeService()); + + public static ZxMaterialChildTypeService Instance + { + get + { + return lazy.Value; + } + } + + private LogHelper log = LogHelper.Instance; + Repository _repository => new Repository("sqlserver"); + + /// + /// Lambda查询所有物料子类别信息 + /// + /// + public List GetMaterialChildTypeInfos(Expression> whereExpression) + { + try + { + List entity = _repository.GetList(whereExpression); + return entity; + } + catch (Exception ex) + { + log.Error("物料子类别信息获取异常", ex); + return null; + } + } + + /// + /// 新增物料子类别信息 + /// + /// + /// + public bool InsertMaterialChildTypeInfo(ZxMaterialChildTypeEntity entity) + { + try + { + return _repository.Insert(entity); + } + catch (Exception ex) + { + log.Error("物料子类别信息添加异常", ex); + return false; + } + } + + /// + /// 删除物料子类别信息 + /// + /// + /// + public bool DeleteMaterialChildTypeInfoById(int id) + { + try + { + return _repository.DeleteById(id); + } + catch (Exception ex) + { + log.Error("物料子类别信息删除异常", ex); + return false; + } + } + } +} diff --git a/HighWayIot.Repository/service/ZxMaterialService.cs b/HighWayIot.Repository/service/ZxMaterialService.cs index d2ff782..568aad5 100644 --- a/HighWayIot.Repository/service/ZxMaterialService.cs +++ b/HighWayIot.Repository/service/ZxMaterialService.cs @@ -33,8 +33,8 @@ namespace HighWayIot.Repository.service { try { - List deviceInfo = _repository.GetList(x => x.IsDeleted == false); - return deviceInfo; + List entity = _repository.GetList(x => x.IsDeleted == false); + return entity; } catch (Exception ex) { @@ -46,13 +46,13 @@ namespace HighWayIot.Repository.service /// /// 修改物料信息 /// - /// + /// /// - 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) + /// + /// 新增物料信息 + /// + /// + /// + 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 } } + /// + /// 删除物料信息 + /// + /// + /// public bool DeleteMaterialInfoByMaterialCode(string materialCode) { try diff --git a/HighWayIot.Repository/service/ZxMaterialTypeService.cs b/HighWayIot.Repository/service/ZxMaterialTypeService.cs new file mode 100644 index 0000000..c8d9b31 --- /dev/null +++ b/HighWayIot.Repository/service/ZxMaterialTypeService.cs @@ -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 lazy = new Lazy(() => new ZxMaterialTypeService()); + + public static ZxMaterialTypeService Instance + { + get + { + return lazy.Value; + } + } + + private LogHelper log = LogHelper.Instance; + Repository _repository => new Repository("sqlserver"); + + /// + /// 查询所有物料类别信息 + /// + /// + public List GetMaterialTypeInfos() + { + try + { + List entity = _repository.GetList(); + return entity; + } + catch (Exception ex) + { + log.Error("物料类别信息获取异常", ex); + return null; + } + } + + /// + /// 新增物料类别信息 + /// + /// + /// + public bool InsertMaterialTypeInfo(ZxMaterialTypeEntity entity) + { + try + { + return _repository.Insert(entity); + } + catch (Exception ex) + { + log.Error("物料信息添加异常", ex); + return false; + } + } + + /// + /// 删除物料类别信息 + /// + /// + /// + public bool DeleteMaterialTypeInfoById(int id) + { + try + { + return _repository.DeleteById(id); + } + catch (Exception ex) + { + log.Error("物料信息删除异常", ex); + return false; + } + } + } +} diff --git a/HighWayIot.Repository/service/ZxRecipeParaService.cs b/HighWayIot.Repository/service/ZxRecipeParaService.cs index 6f0aca2..db0bf84 100644 --- a/HighWayIot.Repository/service/ZxRecipeParaService.cs +++ b/HighWayIot.Repository/service/ZxRecipeParaService.cs @@ -26,15 +26,15 @@ namespace HighWayIot.Repository.service Repository _repository => new Repository("sqlserver"); /// - /// 条件查询所有用户列表 用户名为模糊查询 + /// 查询配方字段信息 /// /// - public List GetShiftInfos() + public List GetRecipeParaInfos() { try { - List deviceInfo = _repository.GetList(); - return deviceInfo; + List entity = _repository.GetList(); + return entity; } catch (Exception ex) { @@ -44,15 +44,15 @@ namespace HighWayIot.Repository.service } /// - /// 修改班次信息 + /// 修改配方字段信息 /// - /// + /// /// - public bool UpdateShiftInfo(ZxRecipeParaEntity sysUserEntity) + public bool UpdateRecipeParaInfo(ZxRecipeParaEntity entity) { try { - return _repository.Update(sysUserEntity); + return _repository.Update(entity); } catch(Exception ex) { @@ -60,5 +60,23 @@ namespace HighWayIot.Repository.service return false; } } + + /// + /// 添加配方字段信息 + /// + /// + /// + public bool InsertRecipeParaInfo(ZxRecipeParaEntity entity) + { + try + { + return _repository.Insert(entity); + } + catch (Exception ex) + { + log.Error("用户信息修改异常", ex); + return false; + } + } } } diff --git a/HighWayIot.Repository/service/ZxRecipeService.cs b/HighWayIot.Repository/service/ZxRecipeService.cs index bf04c4b..9aeff65 100644 --- a/HighWayIot.Repository/service/ZxRecipeService.cs +++ b/HighWayIot.Repository/service/ZxRecipeService.cs @@ -26,15 +26,15 @@ namespace HighWayIot.Repository.service Repository _repository => new Repository("sqlserver"); /// - /// 条件查询所有用户列表 用户名为模糊查询 + /// 查询配方信息 /// /// - public List GetShiftInfos() + public List GetRecipeInfos() { try { - List deviceInfo = _repository.GetList(x => x.IsDeleted == false); - return deviceInfo; + List entity = _repository.GetList(x => x.IsDeleted == false); + return entity; } catch (Exception ex) { @@ -44,15 +44,15 @@ namespace HighWayIot.Repository.service } /// - /// 修改班次信息 + /// 修改配方信息 /// - /// + /// /// - 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; } } + + + /// + /// 新增配方信息 + /// + /// + /// + public bool InsertRecipeInfo(ZxRecipeEntity recipeEntity) + { + try + { + return _repository.Insert(recipeEntity); + } + catch (Exception ex) + { + log.Error("物料信息添加异常", ex); + return false; + } + } + + /// + /// 删除配方信息 + /// + /// + /// + 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; + } + } } } diff --git a/HighWayIot.Repository/service/ZxWeightService.cs b/HighWayIot.Repository/service/ZxWeightService.cs index ece667e..38c70f6 100644 --- a/HighWayIot.Repository/service/ZxWeightService.cs +++ b/HighWayIot.Repository/service/ZxWeightService.cs @@ -33,8 +33,8 @@ namespace HighWayIot.Repository.service { try { - List deviceInfo = _repository.GetList(); - return deviceInfo; + List entity = _repository.GetList(); + return entity; } catch (Exception ex) { @@ -46,13 +46,13 @@ namespace HighWayIot.Repository.service /// /// 修改班次信息 /// - /// + /// /// - public bool UpdateShiftInfo(ZxWeightEntity sysUserEntity) + public bool UpdateShiftInfo(ZxWeightEntity entity) { try { - return _repository.Update(sysUserEntity); + return _repository.Update(entity); } catch(Exception ex) { diff --git a/HighWayIot.Winform/HighWayIot.Winform.csproj b/HighWayIot.Winform/HighWayIot.Winform.csproj index 695eb85..b552dba 100644 --- a/HighWayIot.Winform/HighWayIot.Winform.csproj +++ b/HighWayIot.Winform/HighWayIot.Winform.csproj @@ -77,6 +77,24 @@ OperateConfigPage.cs + + Form + + + MaterialAddForm.cs + + + UserControl + + + MaterialTypeConfigPage.cs + + + Form + + + MaterialUpdateForm.cs + UserControl @@ -107,10 +125,10 @@ ProductionScheduling.cs - + UserControl - + MaterialConfigPage.cs @@ -183,6 +201,15 @@ OperateConfigPage.cs + + MaterialAddForm.cs + + + MaterialTypeConfigPage.cs + + + MaterialUpdateForm.cs + MonitorMainPage.cs @@ -198,7 +225,7 @@ ProductionScheduling.cs - + MaterialConfigPage.cs diff --git a/HighWayIot.Winform/MainForm/BaseForm.Designer.cs b/HighWayIot.Winform/MainForm/BaseForm.Designer.cs index 5d85f1e..846e789 100644 --- a/HighWayIot.Winform/MainForm/BaseForm.Designer.cs +++ b/HighWayIot.Winform/MainForm/BaseForm.Designer.cs @@ -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; } } \ No newline at end of file diff --git a/HighWayIot.Winform/MainForm/BaseForm.cs b/HighWayIot.Winform/MainForm/BaseForm.cs index af6d25b..e65d9ad 100644 --- a/HighWayIot.Winform/MainForm/BaseForm.cs +++ b/HighWayIot.Winform/MainForm/BaseForm.cs @@ -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); } } - } } diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPage.Designer.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPage.Designer.cs deleted file mode 100644 index 7e6d9e6..0000000 --- a/HighWayIot.Winform/UserControlPages/MaterialConfigPage.Designer.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System.Drawing; -using System.Windows.Forms; - -namespace HighWayIot.Winform.UserControlPages -{ - partial class MaterialConfigPage - { - /// - /// 必需的设计器变量。 - /// - private System.ComponentModel.IContainer components = null; - - /// - /// 清理所有正在使用的资源。 - /// - /// 如果应释放托管资源,为 true;否则为 false。 - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region 组件设计器生成的代码 - - /// - /// 设计器支持所需的方法 - 不要修改 - /// 使用代码编辑器修改此方法的内容。 - /// - 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; - } -} diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPage.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPage.cs deleted file mode 100644 index 3a971b5..0000000 --- a/HighWayIot.Winform/UserControlPages/MaterialConfigPage.cs +++ /dev/null @@ -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) - { - - } - } -} diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.Designer.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.Designer.cs new file mode 100644 index 0000000..c8bf757 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.Designer.cs @@ -0,0 +1,177 @@ +namespace HighWayIot.Winform.UserControlPages.SysConfigPages +{ + partial class MaterialAddForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + 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; + } +} \ No newline at end of file diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.cs new file mode 100644 index 0000000..dcfd8eb --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.cs @@ -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 + { + /// + /// 物料数据库业务实例 + /// + ZxMaterialService zxMaterialService = ZxMaterialService.Instance; + + public MaterialAddForm() + { + InitializeComponent(); + } + + /// + /// 确认添加按钮 + /// + /// + /// + private void ConfrimAddButton_Click(object sender, EventArgs e) + { + + this.Close(); + this.Dispose(); + } + } +} diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPage.resx b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.resx similarity index 100% rename from HighWayIot.Winform/UserControlPages/MaterialConfigPage.resx rename to HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.resx diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.Designer.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.Designer.cs new file mode 100644 index 0000000..1635718 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.Designer.cs @@ -0,0 +1,215 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace HighWayIot.Winform.UserControlPages +{ + partial class MaterialConfigPage + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + 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; + } +} diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.cs new file mode 100644 index 0000000..c1571f9 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.cs @@ -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 Lists; + + public MaterialConfigPage() + { + InitializeComponent(); + Init(); + } + + private void Init() + { + MaterialDataGridView.AutoGenerateColumns = false; + + Lists = zxMaterialService.GetMaterialInfos(); + + MaterialDataGridView.DataSource = null; + MaterialDataGridView.DataSource = Lists; + } + + /// + /// 添加物料 + /// + /// + /// + private void AddMaterial_Click(object sender, EventArgs e) + { + MaterialAddForm form = new MaterialAddForm(); + form.ShowDialog(); + Lists = zxMaterialService.GetMaterialInfos(); + MaterialDataGridView.DataSource = null; + MaterialDataGridView.DataSource = Lists; + } + + /// + /// 更新物料 + /// + /// + /// + 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; + } + + /// + /// 删除物料 + /// + /// + /// + private void DeleteMaterial_Click(object sender, EventArgs e) + { + Lists = zxMaterialService.GetMaterialInfos(); + MaterialDataGridView.DataSource = null; + MaterialDataGridView.DataSource = Lists; + } + + /// + /// 查询物料 + /// + /// + /// + private void SelectMaterial_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.resx b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.resx new file mode 100644 index 0000000..fae432a --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.Designer.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.Designer.cs new file mode 100644 index 0000000..d1e72e6 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.Designer.cs @@ -0,0 +1,314 @@ +namespace HighWayIot.Winform.UserControlPages.MaterialConfigPages +{ + partial class MaterialTypeConfigPage + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + 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; + } +} diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.cs new file mode 100644 index 0000000..1763192 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.cs @@ -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 + { + /// + /// 物料子类型服务类实例 + /// + ZxMaterialChildTypeService zxMaterialChildTypeService = ZxMaterialChildTypeService.Instance; + + /// + /// 物料类型服务类实例 + /// + ZxMaterialTypeService zxMaterialTypeService = ZxMaterialTypeService.Instance; + + /// + /// 物料子类型列表 + /// + List zxMaterialChildTypeList; + + /// + /// 物料类型列表 + /// + List zxMaterialTypeList; + + public MaterialTypeConfigPage() + { + InitializeComponent(); + Init(); + } + + private void Init() + { + MaterialTypeDataGridView.AutoGenerateColumns = false; + MaterialChildTypeDataGridView.AutoGenerateColumns = false; + + zxMaterialTypeList = zxMaterialTypeService.GetMaterialTypeInfos(); + + MaterialTypeDataGridView.DataSource = null; + MaterialTypeDataGridView.DataSource = zxMaterialTypeList; + + } + + /// + /// 物料类型添加 + /// + /// + /// + private void AddMaterialTypeButton_Click(object sender, EventArgs e) + { + + } + + /// + /// 物料子类型添加 + /// + /// + /// + private void AddMaterialChildTypeButton_Click(object sender, EventArgs e) + { + + } + + /// + /// 物料类型删除 + /// + /// + /// + private void DeleteMaterialTypeButton_Click(object sender, EventArgs e) + { + + } + + /// + /// 物料子类型删除 + /// + /// + /// + private void DeleteMaterialChildTypeButton_Click(object sender, EventArgs e) + { + + } + + /// + /// 所选内容更改事件 + /// + /// + /// + 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; + } + } +} diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.resx b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.resx new file mode 100644 index 0000000..f9ba3e8 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialTypeConfigPage.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.Designer.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.Designer.cs new file mode 100644 index 0000000..70bc4c9 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.Designer.cs @@ -0,0 +1,177 @@ +namespace HighWayIot.Winform.UserControlPages.SysConfigPages +{ + partial class MaterialUpdateForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + 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; + } +} \ No newline at end of file diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.cs new file mode 100644 index 0000000..7e786d8 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.cs @@ -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 + { + /// + /// 物料数据库业务实例 + /// + private ZxMaterialService zxMaterialService = ZxMaterialService.Instance; + + /// + /// 要修改的实体 + /// + private ZxMaterialEntity _entity; + + public MaterialUpdateForm(ZxMaterialEntity entity) + { + InitializeComponent(); + _entity = entity; + } + + /// + /// 确认修改按钮 + /// + /// + /// + private void ConfrimAddButton_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.resx b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/HighWayIot.Winform/UserControlPages/SysConfigPages/RoleUpdateForm.cs b/HighWayIot.Winform/UserControlPages/SysConfigPages/RoleUpdateForm.cs index 2ce9280..7f07d4e 100644 --- a/HighWayIot.Winform/UserControlPages/SysConfigPages/RoleUpdateForm.cs +++ b/HighWayIot.Winform/UserControlPages/SysConfigPages/RoleUpdateForm.cs @@ -101,7 +101,7 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages if (_sysUserRoleService.UpdateRoleInfo(_roleEntity)) { - MessageBox.Show("角色修改成功,若重新应用权限需重启软件", "提示", MessageBoxButtons.OK); + MessageBox.Show("角色修改成功,若重新应用权限需注销或重启软件", "提示", MessageBoxButtons.OK); } else {