add - 配方添加功能完毕

master
SoulStar 7 months ago
parent 4b96561a96
commit c1f5d9c13a

@ -0,0 +1,91 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.domain
{
public class WeightDataSourceEntity
{
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
public int Id { get; set; }
/// <summary>
/// 备 注:配方编号
/// 默认值:
///</summary>
public string RecipeCode { get; set; } = null;
/// <summary>
/// 备 注:物料编号
/// 默认值:
///</summary>
public string MaterialCode { get; set; } = null;
/// <summary>
/// 备 注:物料名称
/// 默认值:
///</summary>
public string MaterialName { get; set; } = null;
/// <summary>
/// 备 注:物料类型
/// 默认值:
///</summary>
public string MaterialType { get; set; } = null;
/// <summary>
/// 备 注:物料子类型
/// 默认值:
///</summary>
public string MaterialChildType { get; set; } = null;
/// <summary>
/// 备 注:厚度
/// 默认值:
///</summary>
public decimal? SetThickness { get; set; }
/// <summary>
/// 备 注:宽度
/// 默认值:
///</summary>
public decimal? SetWidth { get; set; }
/// <summary>
/// 备 注:层数
/// 默认值:
///</summary>
public int? SetLayer { get; set; }
/// <summary>
/// 备 注:重量
/// 默认值:
///</summary>
public decimal? SetWeight { get; set; }
/// <summary>
/// 备 注:公差
/// 默认值:
///</summary>
public decimal? SetError { get; set; }
/// <summary>
/// 备 注:是否使用
/// 默认值:
///</summary>
public bool? IsUse { get; set; }
/// <summary>
/// 备 注:是否删除
/// 默认值:
///</summary>
public bool? IsDeleted { get; set; }
}
}

@ -20,12 +20,333 @@ namespace Models
public int Id { get; set; }
/// <summary>
/// 备 注:
/// 备 注:配方代码
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "recipe_code")]
public string RecipeCode { get; set; } = null;
/// <summary>
/// 备 注:是否删除
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "is_deleted")]
public bool? IsDeleted { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P1")]
public int? E1P1 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P2")]
public int? E1P2 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P3")]
public int? E1P3 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P4")]
public int? E1P4 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P5")]
public int? E1P5 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P6")]
public int? E1P6 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P7")]
public int? E1P7 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P8")]
public int? E1P8 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P9")]
public int? E1P9 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P10")]
public int? E1P10 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P11")]
public int? E1P11 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P12")]
public int? E1P12 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P13")]
public int? E1P13 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P14")]
public int? E1P14 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E1P15")]
public int? E1P15 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P1")]
public int? E2P1 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P2")]
public int? E2P2 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P3")]
public int? E2P3 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P4")]
public int? E2P4 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P5")]
public int? E2P5 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P6")]
public int? E2P6 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P7")]
public int? E2P7 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P8")]
public int? E2P8 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P9")]
public int? E2P9 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P10")]
public int? E2P10 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P11")]
public int? E2P11 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P12")]
public int? E2P12 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P13")]
public int? E2P13 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P14")]
public int? E2P14 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E2P15")]
public int? E2P15 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P1")]
public int? E3P1 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P2")]
public int? E3P2 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P3")]
public int? E3P3 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P4")]
public int? E3P4 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P5")]
public int? E3P5 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P6")]
public int? E3P6 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P7")]
public int? E3P7 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P8")]
public int? E3P8 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P9")]
public int? E3P9 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P10")]
public int? E3P10 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P11")]
public int? E3P11 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P12")]
public int? E3P12 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P13")]
public int? E3P13 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P14")]
public int? E3P14 { get; set; }
/// <summary>
/// 备 注:
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "E3P15")]
public int? E3P15 { get; set; }
}

@ -75,7 +75,12 @@ namespace Models
[SugarColumn(ColumnName = "is_use")]
public bool? IsUse { get; set; }
/// <summary>
/// 备 注:是否删除
/// 默认值:
///</summary>
[SugarColumn(ColumnName = "is_deleted")]
public bool? IsDeleted { get; set; }
}
}

@ -70,6 +70,24 @@ namespace HighWayIot.Repository.service
}
}
/// <summary>
/// 根据物料编号获取单条数据
/// </summary>
/// <param name="materialCode">物料编号</param>
/// <returns></returns>
public ZxMaterialEntity GetSingleEntityByCode(string materialCode)
{
try
{
return _repository.GetById(materialCode);
}
catch(Exception ex)
{
log.Error("单条物料信息获取异常", ex);
return null;
}
}
/// <summary>
/// 修改物料信息
/// </summary>

@ -26,29 +26,48 @@ namespace HighWayIot.Repository.service
Repository<ZxWeightEntity> _repository => new Repository<ZxWeightEntity>("sqlserver");
/// <summary>
/// 条件查询所有用户列表 用户名为模糊查询
/// 根据配方编号查询称量信息
/// </summary>
/// <param name="recipeCode">配方号</param>
/// <returns></returns>
public List<ZxWeightEntity> GetShiftInfos()
public List<ZxWeightEntity> GetWeightInfos(string recipeCode)
{
try
{
List<ZxWeightEntity> entity = _repository.GetList();
List<ZxWeightEntity> entity = _repository.GetList(x => x.RecipeCode == recipeCode && x.IsDeleted == false);
return entity;
}
catch (Exception ex)
{
log.Error("用户信息获取异常", ex);
log.Error("称量信息获取异常", ex);
return null;
}
}
/// <summary>
/// 修改班次信息
/// 新增称量信息
/// </summary>
/// <param name="entity"></param>
/// <param name="entity">称量信息</param>
/// <returns></returns>
public bool UpdateShiftInfo(ZxWeightEntity entity)
public bool InsertWeightInfo(ZxWeightEntity entity)
{
try
{
return _repository.Insert(entity);
}
catch (Exception ex)
{
log.Error("称量信息添加异常", ex);
return false;
}
}
/// <summary>
/// 修改称量信息
/// </summary>
/// <param name="entity">称量信息</param>
/// <returns></returns>
public bool UpdateWeightInfo(ZxWeightEntity entity)
{
try
{
@ -56,7 +75,49 @@ namespace HighWayIot.Repository.service
}
catch(Exception ex)
{
log.Error("用户信息修改异常", ex);
log.Error("称量信息修改异常", ex);
return false;
}
}
/// <summary>
/// 根据ID删除称量信息
/// </summary>
/// <param name="id">配方号</param>
/// <returns></returns>
public bool DeleteWeightInfoById(string id)
{
try
{
ZxWeightEntity e = _repository.GetById(id);
e.IsDeleted = true;
return _repository.Update(e);
}
catch (Exception ex)
{
log.Error("称量信息删除异常", ex);
return false;
}
}
/// <summary>
/// 根据RecipeCode删除称量信息
/// </summary>
/// <param name="recipeCode">配方号</param>
/// <returns></returns>
public bool DeleteWeightInfoByRecipeCode(string recipeCode)
{
try
{
List<ZxWeightEntity> es = _repository.GetList(x => x.RecipeCode == recipeCode && x.IsDeleted == false);
es.ForEach(x => x.IsDeleted = true);
return _repository.UpdateRange(es);
}
catch (Exception ex)
{
log.Error("称量信息删除异常", ex);
return false;
}
}

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Winform.Business
{
public class GeneralUtils
{
/// <summary>
/// 在数组前面加一个空字符串
/// </summary>
/// <param name="str"></param>
public static string[] HeadAddEmptyString(string[] str)
{
Array.Resize(ref str, str.Length + 1);
Array.Copy(str, 0, str, 1, str.Length - 1);
str[0] = string.Empty;
return str;
}
}
}

@ -49,6 +49,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Business\GeneralUtils.cs" />
<Compile Include="Business\RoleBusiness.cs" />
<Compile Include="Business\XmlUtil.cs" />
<Compile Include="MainForm\BaseForm.cs">
@ -101,6 +102,18 @@
<Compile Include="UserControlPages\MonitorMainPage.Designer.cs">
<DependentUpon>MonitorMainPage.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\RecipeConfigPages\AddRecipeForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UserControlPages\RecipeConfigPages\AddRecipeForm.Designer.cs">
<DependentUpon>AddRecipeForm.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\RecipeConfigPages\AddWeightForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UserControlPages\RecipeConfigPages\AddWeightForm.Designer.cs">
<DependentUpon>AddWeightForm.cs</DependentUpon>
</Compile>
<Compile Include="UserControlPages\RecipeConfigPages\RecipeConfigPage.cs">
<SubType>UserControl</SubType>
</Compile>
@ -213,6 +226,12 @@
<EmbeddedResource Include="UserControlPages\MonitorMainPage.resx">
<DependentUpon>MonitorMainPage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\RecipeConfigPages\AddRecipeForm.resx">
<DependentUpon>AddRecipeForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\RecipeConfigPages\AddWeightForm.resx">
<DependentUpon>AddWeightForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControlPages\RecipeConfigPages\RecipeConfigPage.resx">
<DependentUpon>RecipeConfigPage.cs</DependentUpon>
</EmbeddedResource>

@ -1,5 +1,6 @@
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using HighWayIot.Winform.Business;
using Models;
using System;
using System.Collections.Generic;
@ -50,9 +51,7 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages
{
//绑定物料类型
MaterialTypeArray = zxMaterialTypeService.GetMaterialTypeInfos().Select(x => x.MaterialTypeName).ToArray();
Array.Resize(ref MaterialTypeArray, MaterialTypeArray.Length + 1);
Array.Copy(MaterialTypeArray, 0, MaterialTypeArray, 1, MaterialTypeArray.Length - 1);
MaterialTypeArray[0] = string.Empty;
MaterialTypeArray = GeneralUtils.HeadAddEmptyString(MaterialTypeArray);
MaterialTypeComboBox.DataSource = MaterialTypeArray;
}
@ -64,11 +63,16 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages
/// <param name="e"></param>
private void ConfrimAddButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(MaterialCodeTextBox.Text.Trim()))
{
MessageBox.Show("物料编号不能为空!");
return;
}
ZxMaterialEntity entity = new ZxMaterialEntity()
{
MaterialCode = MaterialCodeTextBox.Text,
MaterialName = MaterialNameTextBox.Text,
MaterialType = MaterialTypeComboBox.Text,
MaterialCode = MaterialCodeTextBox.Text.Trim(),
MaterialName = MaterialNameTextBox.Text.Trim(),
MaterialType = MaterialTypeComboBox.Text.Trim(),
ChildType = ChildComboBox.Text,
IsUse = IsUseCheckBox.Checked,
IsDeleted = false
@ -92,9 +96,7 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages
private void MaterialTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
MaterialChildTypeArray = zxMaterialChildTypeService.GetMaterialChildTypeInfos(x => x.MaterialTypeName == MaterialTypeComboBox.Text).Select(x => x.MaterialChlidTypeName).ToArray();
Array.Resize(ref MaterialChildTypeArray, MaterialChildTypeArray.Length + 1);
Array.Copy(MaterialChildTypeArray, 0, MaterialChildTypeArray, 1, MaterialChildTypeArray.Length - 1);
MaterialChildTypeArray[0] = string.Empty;
MaterialChildTypeArray = GeneralUtils.HeadAddEmptyString(MaterialChildTypeArray);
ChildComboBox.DataSource = MaterialChildTypeArray;
}

@ -1,4 +1,5 @@
using HighWayIot.Repository.service;
using HighWayIot.Winform.Business;
using HighWayIot.Winform.UserControlPages.SysConfigPages;
using Models;
using System;
@ -58,9 +59,7 @@ namespace HighWayIot.Winform.UserControlPages
//绑定物料类型
MaterialTypeArray = zxMaterialTypeService.GetMaterialTypeInfos().Select(x => x.MaterialTypeName).ToArray();
Array.Resize(ref MaterialTypeArray, MaterialTypeArray.Length + 1);
Array.Copy(MaterialTypeArray, 0, MaterialTypeArray, 1, MaterialTypeArray.Length - 1);
MaterialTypeArray[0] = string.Empty;
MaterialTypeArray = GeneralUtils.HeadAddEmptyString(MaterialTypeArray);
MaterialTypeComboBox.DataSource = MaterialTypeArray;
@ -152,9 +151,7 @@ namespace HighWayIot.Winform.UserControlPages
private void MaterialTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
MaterialChildTypeArray = zxMaterialChildTypeService.GetMaterialChildTypeInfos(x => x.MaterialTypeName == MaterialTypeComboBox.Text).Select(x => x.MaterialChlidTypeName).ToArray();
Array.Resize(ref MaterialChildTypeArray, MaterialChildTypeArray.Length + 1);
Array.Copy(MaterialChildTypeArray, 0, MaterialChildTypeArray, 1, MaterialChildTypeArray.Length - 1);
MaterialChildTypeArray[0] = string.Empty;
MaterialChildTypeArray = GeneralUtils.HeadAddEmptyString(MaterialChildTypeArray);
ChildComboBox.DataSource = MaterialChildTypeArray;
}

@ -1,5 +1,6 @@
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using HighWayIot.Winform.Business;
using Models;
using System;
using System.Collections.Generic;
@ -62,9 +63,7 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages
//绑定物料类型
MaterialTypeArray = zxMaterialTypeService.GetMaterialTypeInfos().Select(x => x.MaterialTypeName).ToArray();
Array.Resize(ref MaterialTypeArray, MaterialTypeArray.Length + 1);
Array.Copy(MaterialTypeArray, 0, MaterialTypeArray, 1, MaterialTypeArray.Length - 1);
MaterialTypeArray[0] = string.Empty;
MaterialTypeArray = GeneralUtils.HeadAddEmptyString(MaterialTypeArray);
MaterialTypeComboBox.DataSource = MaterialTypeArray;
@ -127,9 +126,7 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages
private void MaterialTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
MaterialChildTypeArray = zxMaterialChildTypeService.GetMaterialChildTypeInfos(x => x.MaterialTypeName == MaterialTypeComboBox.Text).Select(x => x.MaterialChlidTypeName).ToArray();
Array.Resize(ref MaterialChildTypeArray, MaterialChildTypeArray.Length + 1);
Array.Copy(MaterialChildTypeArray, 0, MaterialChildTypeArray, 1, MaterialChildTypeArray.Length - 1);
MaterialChildTypeArray[0] = string.Empty;
MaterialChildTypeArray = GeneralUtils.HeadAddEmptyString(MaterialChildTypeArray);
ChildComboBox.DataSource = MaterialChildTypeArray;
}

@ -0,0 +1,254 @@
namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages
{
partial class AddRecipeForm
{
/// <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.ConfrimAddButton = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.RecipeNameTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.RecipeCodeTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.SpecNameTextBox = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.SpecCodeTextBox = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.SizeKindTextBox = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.FixedWidthTextBox = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.WeightErrorTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// IsUseCheckBox
//
this.IsUseCheckBox.AutoSize = true;
this.IsUseCheckBox.Checked = true;
this.IsUseCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.IsUseCheckBox.Location = new System.Drawing.Point(501, 85);
this.IsUseCheckBox.Name = "IsUseCheckBox";
this.IsUseCheckBox.Size = new System.Drawing.Size(72, 16);
this.IsUseCheckBox.TabIndex = 23;
this.IsUseCheckBox.Text = "是否启用";
this.IsUseCheckBox.UseVisualStyleBackColor = true;
//
// ConfrimAddButton
//
this.ConfrimAddButton.Location = new System.Drawing.Point(241, 125);
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);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(239, 31);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 12);
this.label3.TabIndex = 17;
this.label3.Text = "配方名称:";
//
// RecipeNameTextBox
//
this.RecipeNameTextBox.Location = new System.Drawing.Point(310, 28);
this.RecipeNameTextBox.Name = "RecipeNameTextBox";
this.RecipeNameTextBox.Size = new System.Drawing.Size(256, 21);
this.RecipeNameTextBox.TabIndex = 16;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(32, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 12);
this.label2.TabIndex = 15;
this.label2.Text = "配方代码:";
//
// RecipeCodeTextBox
//
this.RecipeCodeTextBox.Location = new System.Drawing.Point(103, 28);
this.RecipeCodeTextBox.Name = "RecipeCodeTextBox";
this.RecipeCodeTextBox.Size = new System.Drawing.Size(130, 21);
this.RecipeCodeTextBox.TabIndex = 14;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(268, 32);
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;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(239, 58);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(65, 12);
this.label4.TabIndex = 28;
this.label4.Text = "SPEC名称";
//
// SpecNameTextBox
//
this.SpecNameTextBox.Location = new System.Drawing.Point(310, 55);
this.SpecNameTextBox.Name = "SpecNameTextBox";
this.SpecNameTextBox.Size = new System.Drawing.Size(256, 21);
this.SpecNameTextBox.TabIndex = 27;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(32, 59);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(65, 12);
this.label5.TabIndex = 26;
this.label5.Text = "SPEC代码";
//
// SpecCodeTextBox
//
this.SpecCodeTextBox.Location = new System.Drawing.Point(103, 55);
this.SpecCodeTextBox.Name = "SpecCodeTextBox";
this.SpecCodeTextBox.Size = new System.Drawing.Size(130, 21);
this.SpecCodeTextBox.TabIndex = 25;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(268, 59);
this.label6.Name = "label6";
this.label6.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.label6.Size = new System.Drawing.Size(0, 12);
this.label6.TabIndex = 24;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(32, 86);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(41, 12);
this.label7.TabIndex = 30;
this.label7.Text = "寸别:";
//
// SizeKindTextBox
//
this.SizeKindTextBox.Location = new System.Drawing.Point(79, 82);
this.SizeKindTextBox.Name = "SizeKindTextBox";
this.SizeKindTextBox.Size = new System.Drawing.Size(83, 21);
this.SizeKindTextBox.TabIndex = 29;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(168, 86);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(77, 12);
this.label8.TabIndex = 32;
this.label8.Text = "固定胶宽度:";
//
// FixedWidthTextBox
//
this.FixedWidthTextBox.Location = new System.Drawing.Point(251, 82);
this.FixedWidthTextBox.Name = "FixedWidthTextBox";
this.FixedWidthTextBox.Size = new System.Drawing.Size(83, 21);
this.FixedWidthTextBox.TabIndex = 31;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(340, 86);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(71, 12);
this.label9.TabIndex = 34;
this.label9.Text = "重量公差%";
//
// WeightErrorTextBox
//
this.WeightErrorTextBox.Location = new System.Drawing.Point(412, 82);
this.WeightErrorTextBox.Name = "WeightErrorTextBox";
this.WeightErrorTextBox.Size = new System.Drawing.Size(83, 21);
this.WeightErrorTextBox.TabIndex = 33;
//
// AddRecipeForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(601, 188);
this.Controls.Add(this.label9);
this.Controls.Add(this.WeightErrorTextBox);
this.Controls.Add(this.label8);
this.Controls.Add(this.FixedWidthTextBox);
this.Controls.Add(this.label7);
this.Controls.Add(this.SizeKindTextBox);
this.Controls.Add(this.label4);
this.Controls.Add(this.SpecNameTextBox);
this.Controls.Add(this.label5);
this.Controls.Add(this.SpecCodeTextBox);
this.Controls.Add(this.label6);
this.Controls.Add(this.IsUseCheckBox);
this.Controls.Add(this.ConfrimAddButton);
this.Controls.Add(this.label3);
this.Controls.Add(this.RecipeNameTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.RecipeCodeTextBox);
this.Controls.Add(this.label1);
this.Name = "AddRecipeForm";
this.Text = "配方添加";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox IsUseCheckBox;
private System.Windows.Forms.Button ConfrimAddButton;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox RecipeNameTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox RecipeCodeTextBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox SpecNameTextBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox SpecCodeTextBox;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox SizeKindTextBox;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox FixedWidthTextBox;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox WeightErrorTextBox;
}
}

@ -0,0 +1,78 @@
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.RecipeConfigPages
{
public partial class AddRecipeForm : Form
{
ZxRecipeService zxRecipeService = ZxRecipeService.Instance;
public AddRecipeForm()
{
InitializeComponent();
Init();
}
private void Init()
{
}
private void ConfrimAddButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(RecipeCodeTextBox.Text.Trim()))
{
MessageBox.Show("配方编号不能为空!");
return;
}
ZxRecipeEntity zxRecipeEntity = new ZxRecipeEntity()
{
RecipeCode = RecipeCodeTextBox.Text.Trim(),
RecipeName = RecipeNameTextBox.Text.Trim(),
RecipeSpecCode = SpecCodeTextBox.Text.Trim(),
RecipeSpecName = SpecNameTextBox.Text.Trim(),
IsDeleted = false,
IsUse = IsUseCheckBox.Checked,
};
if (!int.TryParse(SizeKindTextBox.Text.Trim(), out int sizeKind))
{
MessageBox.Show("寸别请填入整数阿拉伯数字");
return;
}
zxRecipeEntity.SizeKind = sizeKind;
if (!decimal.TryParse(FixedWidthTextBox.Text.Trim(), out decimal fixedWidth))
{
MessageBox.Show("固定胶宽度请填入可带小数点的阿拉伯数字");
return;
}
zxRecipeEntity.FixedWidth = fixedWidth;
if (!int.TryParse(WeightErrorTextBox.Text.Trim(), out int weightError))
{
MessageBox.Show("重量公差请填入整数阿拉伯数字");
return;
}
zxRecipeEntity.WeightError = weightError;
if(zxRecipeService.InsertRecipeInfo(zxRecipeEntity))
{
MessageBox.Show("配方信息添加成功");
this.Close();
this.Dispose();
}
else
{
MessageBox.Show("请检查配方编号是否重复或者为空");
return;
}
}
}
}

@ -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>

@ -0,0 +1,326 @@
namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages
{
partial class AddWeightForm
{
/// <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.RecipeCodeTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.MaterialCodeComboBox = new System.Windows.Forms.ComboBox();
this.MaterialTypeComboBox = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.ChildTypeComboBox = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.MaterialNameComboBox = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.IsUseCheckBox = new System.Windows.Forms.CheckBox();
this.SetThicknessTextBox = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.SetWidthTextBox = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.SetLayerTextBox = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.SetWeightTextBox = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.SetErrorTextBox = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.AddButton = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(51, 42);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 0;
this.label1.Text = "配方编号:";
//
// RecipeCodeTextBox
//
this.RecipeCodeTextBox.Location = new System.Drawing.Point(122, 38);
this.RecipeCodeTextBox.Name = "RecipeCodeTextBox";
this.RecipeCodeTextBox.ReadOnly = true;
this.RecipeCodeTextBox.Size = new System.Drawing.Size(123, 21);
this.RecipeCodeTextBox.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(6, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 12);
this.label2.TabIndex = 2;
this.label2.Text = "物料编号:";
//
// MaterialCodeComboBox
//
this.MaterialCodeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.MaterialCodeComboBox.FormattingEnabled = true;
this.MaterialCodeComboBox.Location = new System.Drawing.Point(77, 20);
this.MaterialCodeComboBox.Name = "MaterialCodeComboBox";
this.MaterialCodeComboBox.Size = new System.Drawing.Size(123, 20);
this.MaterialCodeComboBox.TabIndex = 3;
this.MaterialCodeComboBox.SelectionChangeCommitted += new System.EventHandler(this.MaterialCodeComboBox_SelectionChangeCommitted);
//
// MaterialTypeComboBox
//
this.MaterialTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.MaterialTypeComboBox.FormattingEnabled = true;
this.MaterialTypeComboBox.Location = new System.Drawing.Point(277, 33);
this.MaterialTypeComboBox.Name = "MaterialTypeComboBox";
this.MaterialTypeComboBox.Size = new System.Drawing.Size(93, 20);
this.MaterialTypeComboBox.TabIndex = 5;
this.MaterialTypeComboBox.SelectedIndexChanged += new System.EventHandler(this.MaterialTypeComboBox_SelectedIndexChanged);
this.MaterialTypeComboBox.SelectionChangeCommitted += new System.EventHandler(this.MaterialTypeComboBox_SelectionChangeCommitted);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(206, 37);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 12);
this.label3.TabIndex = 4;
this.label3.Text = "物料类型:";
//
// ChildTypeComboBox
//
this.ChildTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ChildTypeComboBox.FormattingEnabled = true;
this.ChildTypeComboBox.Location = new System.Drawing.Point(435, 33);
this.ChildTypeComboBox.Name = "ChildTypeComboBox";
this.ChildTypeComboBox.Size = new System.Drawing.Size(93, 20);
this.ChildTypeComboBox.TabIndex = 7;
this.ChildTypeComboBox.SelectionChangeCommitted += new System.EventHandler(this.ChildTypeComboBox_SelectionChangeCommitted);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(376, 37);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(53, 12);
this.label4.TabIndex = 6;
this.label4.Text = "子类型:";
//
// MaterialNameComboBox
//
this.MaterialNameComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.MaterialNameComboBox.FormattingEnabled = true;
this.MaterialNameComboBox.Location = new System.Drawing.Point(77, 46);
this.MaterialNameComboBox.Name = "MaterialNameComboBox";
this.MaterialNameComboBox.Size = new System.Drawing.Size(123, 20);
this.MaterialNameComboBox.TabIndex = 10;
this.MaterialNameComboBox.SelectionChangeCommitted += new System.EventHandler(this.MaterialNameComboBox_SelectionChangeCommitted);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 50);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(65, 12);
this.label6.TabIndex = 9;
this.label6.Text = "物料名称:";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.MaterialCodeComboBox);
this.groupBox1.Controls.Add(this.MaterialNameComboBox);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.ChildTypeComboBox);
this.groupBox1.Controls.Add(this.MaterialTypeComboBox);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Location = new System.Drawing.Point(45, 65);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(535, 74);
this.groupBox1.TabIndex = 11;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "可以先按类型选择物料";
//
// IsUseCheckBox
//
this.IsUseCheckBox.AutoSize = true;
this.IsUseCheckBox.Checked = true;
this.IsUseCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.IsUseCheckBox.Location = new System.Drawing.Point(278, 40);
this.IsUseCheckBox.Name = "IsUseCheckBox";
this.IsUseCheckBox.Size = new System.Drawing.Size(72, 16);
this.IsUseCheckBox.TabIndex = 12;
this.IsUseCheckBox.Text = "是否使用";
this.IsUseCheckBox.UseVisualStyleBackColor = true;
//
// SetThicknessTextBox
//
this.SetThicknessTextBox.Location = new System.Drawing.Point(98, 145);
this.SetThicknessTextBox.Name = "SetThicknessTextBox";
this.SetThicknessTextBox.Size = new System.Drawing.Size(123, 21);
this.SetThicknessTextBox.TabIndex = 14;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(51, 149);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(41, 12);
this.label5.TabIndex = 13;
this.label5.Text = "厚度:";
//
// SetWidthTextBox
//
this.SetWidthTextBox.Location = new System.Drawing.Point(274, 145);
this.SetWidthTextBox.Name = "SetWidthTextBox";
this.SetWidthTextBox.Size = new System.Drawing.Size(123, 21);
this.SetWidthTextBox.TabIndex = 16;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(227, 149);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(41, 12);
this.label7.TabIndex = 15;
this.label7.Text = "宽度:";
//
// SetLayerTextBox
//
this.SetLayerTextBox.Location = new System.Drawing.Point(450, 145);
this.SetLayerTextBox.Name = "SetLayerTextBox";
this.SetLayerTextBox.Size = new System.Drawing.Size(123, 21);
this.SetLayerTextBox.TabIndex = 18;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(403, 149);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(41, 12);
this.label8.TabIndex = 17;
this.label8.Text = "层数:";
//
// SetWeightTextBox
//
this.SetWeightTextBox.Location = new System.Drawing.Point(98, 172);
this.SetWeightTextBox.Name = "SetWeightTextBox";
this.SetWeightTextBox.Size = new System.Drawing.Size(123, 21);
this.SetWeightTextBox.TabIndex = 20;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(51, 176);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(41, 12);
this.label9.TabIndex = 19;
this.label9.Text = "重量:";
//
// SetErrorTextBox
//
this.SetErrorTextBox.Location = new System.Drawing.Point(298, 172);
this.SetErrorTextBox.Name = "SetErrorTextBox";
this.SetErrorTextBox.Size = new System.Drawing.Size(99, 21);
this.SetErrorTextBox.TabIndex = 22;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(227, 176);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(65, 12);
this.label10.TabIndex = 21;
this.label10.Text = "重量公差:";
//
// AddButton
//
this.AddButton.Location = new System.Drawing.Point(253, 214);
this.AddButton.Name = "AddButton";
this.AddButton.Size = new System.Drawing.Size(124, 37);
this.AddButton.TabIndex = 23;
this.AddButton.Text = "添加";
this.AddButton.UseVisualStyleBackColor = true;
this.AddButton.Click += new System.EventHandler(this.AddButton_Click);
//
// AddWeightForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(638, 274);
this.Controls.Add(this.AddButton);
this.Controls.Add(this.SetErrorTextBox);
this.Controls.Add(this.label10);
this.Controls.Add(this.SetWeightTextBox);
this.Controls.Add(this.label9);
this.Controls.Add(this.SetLayerTextBox);
this.Controls.Add(this.label8);
this.Controls.Add(this.SetWidthTextBox);
this.Controls.Add(this.label7);
this.Controls.Add(this.SetThicknessTextBox);
this.Controls.Add(this.label5);
this.Controls.Add(this.IsUseCheckBox);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.RecipeCodeTextBox);
this.Controls.Add(this.label1);
this.Name = "AddWeightForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "添加称量信息";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox RecipeCodeTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox MaterialCodeComboBox;
private System.Windows.Forms.ComboBox MaterialTypeComboBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox ChildTypeComboBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox MaterialNameComboBox;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox IsUseCheckBox;
private System.Windows.Forms.TextBox SetThicknessTextBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox SetWidthTextBox;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox SetLayerTextBox;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox SetWeightTextBox;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox SetErrorTextBox;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Button AddButton;
}
}

@ -0,0 +1,268 @@
using HighWayIot.Repository.service;
using HighWayIot.Winform.Business;
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;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages
{
public partial class AddWeightForm : Form
{
/// <summary>
/// 物料子类型服务类实例
/// </summary>
ZxMaterialChildTypeService zxMaterialChildTypeService = ZxMaterialChildTypeService.Instance;
/// <summary>
/// 物料类型服务类实例
/// </summary>
ZxMaterialTypeService zxMaterialTypeService = ZxMaterialTypeService.Instance;
/// <summary>
/// 物料服务类实例
/// </summary>
ZxMaterialService zxMaterialService = ZxMaterialService.Instance;
/// <summary>
/// 称量服务类实例
/// </summary>
ZxWeightService zxWeightService = ZxWeightService.Instance;
/// <summary>
/// 物料编号数组
/// </summary>
string[] MaterialCodeArray;
/// <summary>
/// 物料名称数组
/// </summary>
string[] MaterialNameArray;
/// <summary>
/// 物料子类型数组
/// </summary>
string[] MaterialChildTypeArray;
/// <summary>
/// 物料类型数组
/// </summary>
string[] MaterialTypeArray;
/// <summary>
/// 配方编号
/// </summary>
string RecipeCode;
public AddWeightForm(string recipeCode)
{
InitializeComponent();
RecipeCode = recipeCode;
Init();
}
private void Init()
{
RecipeCodeTextBox.Text = RecipeCode;
//获取数据
MaterialTypeArray = zxMaterialTypeService.GetMaterialTypeInfos().Select(x => x.MaterialTypeName).ToArray();
List<ZxMaterialEntity> list = zxMaterialService.GetMaterialInfos();
MaterialCodeArray = list.Select(x => x.MaterialCode).ToArray();
MaterialNameArray = list.Select(x => x.MaterialName).ToArray();
//添加空白行
MaterialTypeArray = GeneralUtils.HeadAddEmptyString(MaterialTypeArray);
MaterialCodeArray = GeneralUtils.HeadAddEmptyString(MaterialCodeArray);
MaterialNameArray = GeneralUtils.HeadAddEmptyString(MaterialNameArray);
//绑定combobox数据源
MaterialTypeComboBox.DataSource = MaterialTypeArray;
MaterialCodeComboBox.DataSource = MaterialCodeArray;
MaterialNameComboBox.DataSource = MaterialNameArray;
}
private void AddButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(MaterialCodeComboBox.Text))
{
MessageBox.Show("物料编号不可为空!");
return;
}
ZxWeightEntity zxWeightEntity = new ZxWeightEntity()
{
RecipeCode = this.RecipeCode,
MaterialCode = MaterialCodeComboBox.Text.Trim(),
IsUse = IsUseCheckBox.Checked,
IsDeleted = false,
};
if (!decimal.TryParse(SetThicknessTextBox.Text.Trim(), out decimal thickness))
{
MessageBox.Show("厚度请填入可带小数的阿拉伯数字");
return;
}
zxWeightEntity.SetThickness = thickness;
if (!decimal.TryParse(SetWidthTextBox.Text.Trim(), out decimal width))
{
MessageBox.Show("宽度请填入可带小数的阿拉伯数字");
return;
}
zxWeightEntity.SetWidth = width;
if (!int.TryParse(SetLayerTextBox.Text.Trim(), out int layer))
{
MessageBox.Show("层数请填入整数阿拉伯数字");
return;
}
zxWeightEntity.SetLayer = layer;
if (!decimal.TryParse(SetWeightTextBox.Text.Trim(), out decimal weight))
{
MessageBox.Show("重量请填入可带小数的阿拉伯数字");
return;
}
zxWeightEntity.SetWeight = weight;
if (!decimal.TryParse(SetErrorTextBox.Text.Trim(), out decimal error))
{
MessageBox.Show("重量公差请填入可带小数的阿拉伯数字");
return;
}
zxWeightEntity.SetError = error;
if (zxWeightService.InsertWeightInfo(zxWeightEntity))
{
MessageBox.Show("称量信息添加成功!");
}
else
{
MessageBox.Show("称量信息添加失败!请尝试重新添加");
return;
}
this.Close();
this.Dispose();
}
/// <summary>
/// 物料类型选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MaterialTypeComboBox_SelectionChangeCommitted(object sender, EventArgs e)
{
List<ZxMaterialEntity> list = zxMaterialService.GetMaterialInfos(null, MaterialTypeComboBox.Text.Trim());
MaterialCodeArray = list.Select(x => x.MaterialCode).ToArray();
MaterialNameArray = list.Select(x => x.MaterialName).ToArray();
//添加空白行
MaterialCodeArray = GeneralUtils.HeadAddEmptyString(MaterialCodeArray);
MaterialNameArray = GeneralUtils.HeadAddEmptyString(MaterialNameArray);
//绑定combobox数据源
MaterialCodeComboBox.DataSource = MaterialCodeArray;
MaterialNameComboBox.DataSource = MaterialNameArray;
MaterialChildTypeArray = zxMaterialChildTypeService.GetMaterialChildTypeInfos(x => x.MaterialTypeName == MaterialTypeComboBox.Text).Select(x => x.MaterialChlidTypeName).ToArray();
MaterialChildTypeArray = GeneralUtils.HeadAddEmptyString(MaterialChildTypeArray);
ChildTypeComboBox.DataSource = MaterialChildTypeArray;
}
/// <summary>
/// 物料子类型选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ChildTypeComboBox_SelectionChangeCommitted(object sender, EventArgs e)
{
List<ZxMaterialEntity> list = zxMaterialService.GetMaterialInfos(null, MaterialTypeComboBox.Text.Trim(), ChildTypeComboBox.Text.Trim());
MaterialCodeArray = list.Select(x => x.MaterialCode).ToArray();
MaterialNameArray = list.Select(x => x.MaterialName).ToArray();
//添加空白行
MaterialCodeArray = GeneralUtils.HeadAddEmptyString(MaterialCodeArray);
MaterialNameArray = GeneralUtils.HeadAddEmptyString(MaterialNameArray);
//绑定combobox数据源
MaterialCodeComboBox.DataSource = MaterialCodeArray;
MaterialNameComboBox.DataSource = MaterialNameArray;
}
/// <summary>
/// 物料编号选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MaterialCodeComboBox_SelectionChangeCommitted(object sender, EventArgs e)
{
ZxMaterialEntity entity = zxMaterialService.GetSingleEntityByCode(MaterialCodeComboBox.Text.Trim());
if (entity == null)
{
return;
}
MaterialNameComboBox.Text = entity.MaterialName;
MaterialTypeComboBox.Text = entity.MaterialType;
ChildTypeComboBox.Text = entity.ChildType;
}
/// <summary>
/// 物料名称选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MaterialNameComboBox_SelectionChangeCommitted(object sender, EventArgs e)
{
List<ZxMaterialEntity> entitys = zxMaterialService.GetMaterialInfos(MaterialNameComboBox.Text.Trim());
if (entitys.Count == 1)
{
ZxMaterialEntity entity = entitys[0];
MaterialCodeComboBox.Text = entity.MaterialCode;
MaterialTypeComboBox.Text = entity.MaterialType;
ChildTypeComboBox.Text = entity.ChildType;
}
else if (entitys == null)
{
return;
}
else
{
MaterialCodeArray = entitys.Select(x => x.MaterialCode).ToArray();
//添加空白行
MaterialCodeArray = GeneralUtils.HeadAddEmptyString(MaterialCodeArray);
//绑定combobox数据源
MaterialCodeComboBox.DataSource = MaterialCodeArray;
MaterialTypeComboBox.Text = string.Empty;
ChildTypeComboBox.Text = string.Empty;
}
}
/// <summary>
/// 物料类型更改事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MaterialTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
MaterialChildTypeArray = zxMaterialChildTypeService.GetMaterialChildTypeInfos(x => x.MaterialTypeName == MaterialTypeComboBox.Text).Select(x => x.MaterialChlidTypeName).ToArray();
MaterialChildTypeArray = GeneralUtils.HeadAddEmptyString(MaterialChildTypeArray);
ChildTypeComboBox.DataSource = MaterialChildTypeArray;
}
}
}

@ -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>

@ -1,4 +1,10 @@
using System;
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using HighWayIot.Winform.UserControlPages.RecipeConfigPages;
using HighWayIot.Winform.UserControlPages.SysConfigPages;
using Models;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@ -12,6 +18,36 @@ namespace HighWayIot.Winform.UserControlPages
{
public partial class RecipeConfigPage : UserControl
{
/// <summary>
/// 配方服务类实例
/// </summary>
ZxRecipeService zxRecipeService = ZxRecipeService.Instance;
/// <summary>
/// 称重服务类实例
/// </summary>
ZxWeightService zxWeightService = ZxWeightService.Instance;
/// <summary>
/// 配方字段服务类实例
/// </summary>
ZxRecipeParaService zxRecipeParaService = ZxRecipeParaService.Instance;
/// <summary>
/// 称重DataGridView数据源
/// </summary>
List<WeightDataSourceEntity> weightDataSourceEntities;
/// <summary>
/// 配方列表
/// </summary>
List<ZxRecipeEntity> RecipeLists;
/// <summary>
/// 称量列表
/// </summary>
List<ZxWeightEntity> WeightLists;
public RecipeConfigPage()
{
InitializeComponent();
@ -20,7 +56,13 @@ namespace HighWayIot.Winform.UserControlPages
private void Init()
{
RecipeDataGridView.AutoGenerateColumns = false;
WeightDataGridView.AutoGenerateColumns = false;
RecipeLists = zxRecipeService.GetRecipeInfos();
RecipeDataGridView.DataSource = null;
RecipeDataGridView.DataSource = RecipeLists;
}
/// <summary>
@ -30,7 +72,11 @@ namespace HighWayIot.Winform.UserControlPages
/// <param name="e"></param>
private void AddRecipeButton_Click(object sender, EventArgs e)
{
AddRecipeForm form = new AddRecipeForm();
form.ShowDialog();
RecipeLists = zxRecipeService.GetRecipeInfos();
RecipeDataGridView.DataSource = null;
RecipeDataGridView.DataSource = RecipeLists;
}
/// <summary>
@ -70,7 +116,19 @@ namespace HighWayIot.Winform.UserControlPages
/// <param name="e"></param>
private void AddWeightButton_Click(object sender, EventArgs e)
{
if(RecipeDataGridView.CurrentRow == null)
{
MessageBox.Show("请先选择一条配方!");
return;
}
int a = RecipeDataGridView.CurrentRow.Index;
string s = RecipeDataGridView.Rows[a].Cells["RecipeCode"].Value.ToString();
AddWeightForm form = new AddWeightForm(s);
form.ShowDialog();
WeightLists = zxWeightService.GetWeightInfos(s);
WeightDataGridView.DataSource = null;
WeightDataGridView.DataSource = WeightLists;
}
/// <summary>
@ -102,5 +160,70 @@ namespace HighWayIot.Winform.UserControlPages
{
}
/// <summary>
/// 参数保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SaveParaButton_Click(object sender, EventArgs e)
{
}
/// <summary>
/// 参数复制
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CopyParaButton_Click(object sender, EventArgs e)
{
}
/// <summary>
/// 参数粘贴
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PasteParaButton_Click(object sender, EventArgs e)
{
}
/// <summary>
/// 参数清空
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ClearCutBoradButton_Click(object sender, EventArgs e)
{
}
/// <summary>
/// 所选配方内容更改事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void RecipeDataGridView_SelectionChanged(object sender, EventArgs e)
{
int a = RecipeDataGridView.CurrentRow.Index;
string s = RecipeDataGridView.Rows[a].Cells["RecipeCode"].Value.ToString();
WeightLists = zxWeightService.GetWeightInfos(s);
WeightDataGridView.DataSource = null;
WeightDataGridView.DataSource = WeightLists;
}
/// <summary>
/// 称重和物料数据联查
/// </summary>
private void WeighCombineMaterialData()
{
}
}
}

@ -174,61 +174,4 @@
<metadata name="IsUse.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RecipeCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RecipeName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RecipeSpecCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="RecipeSpecName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SizeKind.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FixedWidth.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="WeightError.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>
<metadata name="Id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<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="MaterialChildType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetThickness.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetWidth.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetLayer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetWeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SetError.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="WeightIsUse.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

@ -32,10 +32,15 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages
/// <param name="e"></param>
private void ConfrimAddButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(UserNameTextBox.Text.Trim()))
{
MessageBox.Show("用户名编号不能为空!");
return;
}
SysUserEntity userEntity = new SysUserEntity()
{
UserName = UserNameTextBox.Text,
Password = PasswordTextBox.Text,
UserName = UserNameTextBox.Text.Trim(),
Password = PasswordTextBox.Text.Trim(),
UserRole = UserRoleComboBox.SelectedText
};
var list = SysUserInfoService.GetUserInfoByUserName(UserNameTextBox.Text);

@ -1,5 +1,6 @@
using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using HighWayIot.Winform.Business;
using HighWayIot.Winform.UserControlPages.SysConfigPages;
using System;
using System.Collections.Generic;
@ -47,9 +48,7 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages
List = sysUserInfoService.GetUserInfos();
RoleNames = sysUserRoleService.GetRoleInfos().Select(x => x.RoleName).ToArray();
Array.Resize(ref RoleNames, RoleNames.Length + 1);
Array.Copy(RoleNames, 0, RoleNames, 1, RoleNames.Length - 1);
RoleNames[0] = string.Empty;
RoleNames = GeneralUtils.HeadAddEmptyString(RoleNames);
SelectUserLoginBeginTime.Value = DateTime.Now - TimeSpan.FromDays(3);

Loading…
Cancel
Save