diff --git a/HighWayIot.Repository/domain/WeightDataSourceEntity.cs b/HighWayIot.Repository/domain/WeightDataSourceEntity.cs new file mode 100644 index 0000000..93316fa --- /dev/null +++ b/HighWayIot.Repository/domain/WeightDataSourceEntity.cs @@ -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 + { + + /// + /// 备 注: + /// 默认值: + /// + public int Id { get; set; } + + /// + /// 备 注:配方编号 + /// 默认值: + /// + public string RecipeCode { get; set; } = null; + + /// + /// 备 注:物料编号 + /// 默认值: + /// + public string MaterialCode { get; set; } = null; + + /// + /// 备 注:物料名称 + /// 默认值: + /// + public string MaterialName { get; set; } = null; + + /// + /// 备 注:物料类型 + /// 默认值: + /// + public string MaterialType { get; set; } = null; + + /// + /// 备 注:物料子类型 + /// 默认值: + /// + public string MaterialChildType { get; set; } = null; + + /// + /// 备 注:厚度 + /// 默认值: + /// + public decimal? SetThickness { get; set; } + + /// + /// 备 注:宽度 + /// 默认值: + /// + public decimal? SetWidth { get; set; } + + /// + /// 备 注:层数 + /// 默认值: + /// + public int? SetLayer { get; set; } + + /// + /// 备 注:重量 + /// 默认值: + /// + public decimal? SetWeight { get; set; } + + /// + /// 备 注:公差 + /// 默认值: + /// + public decimal? SetError { get; set; } + + /// + /// 备 注:是否使用 + /// 默认值: + /// + public bool? IsUse { get; set; } + + /// + /// 备 注:是否删除 + /// 默认值: + /// + public bool? IsDeleted { get; set; } + } +} diff --git a/HighWayIot.Repository/domain/ZxRecipeParaEntity.cs b/HighWayIot.Repository/domain/ZxRecipeParaEntity.cs index c1b550f..50c56ae 100644 --- a/HighWayIot.Repository/domain/ZxRecipeParaEntity.cs +++ b/HighWayIot.Repository/domain/ZxRecipeParaEntity.cs @@ -20,12 +20,333 @@ namespace Models public int Id { get; set; } /// - /// 备 注: + /// 备 注:配方代码 /// 默认值: /// [SugarColumn(ColumnName = "recipe_code")] public string RecipeCode { get; set; } = null; + /// + /// 备 注:是否删除 + /// 默认值: + /// + [SugarColumn(ColumnName = "is_deleted")] + public bool? IsDeleted { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P1")] + public int? E1P1 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P2")] + public int? E1P2 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P3")] + public int? E1P3 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P4")] + public int? E1P4 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P5")] + public int? E1P5 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P6")] + public int? E1P6 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P7")] + public int? E1P7 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P8")] + public int? E1P8 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P9")] + public int? E1P9 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P10")] + public int? E1P10 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P11")] + public int? E1P11 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P12")] + public int? E1P12 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P13")] + public int? E1P13 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P14")] + public int? E1P14 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E1P15")] + public int? E1P15 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P1")] + public int? E2P1 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P2")] + public int? E2P2 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P3")] + public int? E2P3 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P4")] + public int? E2P4 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P5")] + public int? E2P5 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P6")] + public int? E2P6 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P7")] + public int? E2P7 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P8")] + public int? E2P8 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P9")] + public int? E2P9 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P10")] + public int? E2P10 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P11")] + public int? E2P11 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P12")] + public int? E2P12 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P13")] + public int? E2P13 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P14")] + public int? E2P14 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E2P15")] + public int? E2P15 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P1")] + public int? E3P1 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P2")] + public int? E3P2 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P3")] + public int? E3P3 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P4")] + public int? E3P4 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P5")] + public int? E3P5 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P6")] + public int? E3P6 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P7")] + public int? E3P7 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P8")] + public int? E3P8 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P9")] + public int? E3P9 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P10")] + public int? E3P10 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P11")] + public int? E3P11 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P12")] + public int? E3P12 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P13")] + public int? E3P13 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P14")] + public int? E3P14 { get; set; } + + /// + /// 备 注: + /// 默认值: + /// + [SugarColumn(ColumnName = "E3P15")] + public int? E3P15 { get; set; } } diff --git a/HighWayIot.Repository/domain/ZxWeightEntity.cs b/HighWayIot.Repository/domain/ZxWeightEntity.cs index 4ea53b7..8a89aba 100644 --- a/HighWayIot.Repository/domain/ZxWeightEntity.cs +++ b/HighWayIot.Repository/domain/ZxWeightEntity.cs @@ -75,7 +75,12 @@ namespace Models [SugarColumn(ColumnName = "is_use")] public bool? IsUse { get; set; } - + /// + /// 备 注:是否删除 + /// 默认值: + /// + [SugarColumn(ColumnName = "is_deleted")] + public bool? IsDeleted { get; set; } } } \ No newline at end of file diff --git a/HighWayIot.Repository/service/ZxMaterialService.cs b/HighWayIot.Repository/service/ZxMaterialService.cs index a7efb70..d5a0599 100644 --- a/HighWayIot.Repository/service/ZxMaterialService.cs +++ b/HighWayIot.Repository/service/ZxMaterialService.cs @@ -70,6 +70,24 @@ namespace HighWayIot.Repository.service } } + /// + /// 根据物料编号获取单条数据 + /// + /// 物料编号 + /// + public ZxMaterialEntity GetSingleEntityByCode(string materialCode) + { + try + { + return _repository.GetById(materialCode); + } + catch(Exception ex) + { + log.Error("单条物料信息获取异常", ex); + return null; + } + } + /// /// 修改物料信息 /// diff --git a/HighWayIot.Repository/service/ZxWeightService.cs b/HighWayIot.Repository/service/ZxWeightService.cs index 38c70f6..26577ad 100644 --- a/HighWayIot.Repository/service/ZxWeightService.cs +++ b/HighWayIot.Repository/service/ZxWeightService.cs @@ -26,29 +26,48 @@ namespace HighWayIot.Repository.service Repository _repository => new Repository("sqlserver"); /// - /// 条件查询所有用户列表 用户名为模糊查询 + /// 根据配方编号查询称量信息 /// + /// 配方号 /// - public List GetShiftInfos() + public List GetWeightInfos(string recipeCode) { try { - List entity = _repository.GetList(); + List entity = _repository.GetList(x => x.RecipeCode == recipeCode && x.IsDeleted == false); return entity; } catch (Exception ex) { - log.Error("用户信息获取异常", ex); + log.Error("称量信息获取异常", ex); return null; } } /// - /// 修改班次信息 + /// 新增称量信息 /// - /// + /// 称量信息 /// - public bool UpdateShiftInfo(ZxWeightEntity entity) + public bool InsertWeightInfo(ZxWeightEntity entity) + { + try + { + return _repository.Insert(entity); + } + catch (Exception ex) + { + log.Error("称量信息添加异常", ex); + return false; + } + } + + /// + /// 修改称量信息 + /// + /// 称量信息 + /// + 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; + } + } + + /// + /// 根据ID删除称量信息 + /// + /// 配方号 + /// + 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; + } + } + + /// + /// 根据RecipeCode删除称量信息 + /// + /// 配方号 + /// + public bool DeleteWeightInfoByRecipeCode(string recipeCode) + { + try + { + List 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; } } diff --git a/HighWayIot.Winform/Business/GeneralUtils.cs b/HighWayIot.Winform/Business/GeneralUtils.cs new file mode 100644 index 0000000..d580fa3 --- /dev/null +++ b/HighWayIot.Winform/Business/GeneralUtils.cs @@ -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 + { + /// + /// 在数组前面加一个空字符串 + /// + /// + 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; + } + } +} diff --git a/HighWayIot.Winform/HighWayIot.Winform.csproj b/HighWayIot.Winform/HighWayIot.Winform.csproj index 0fb63f6..85aeb04 100644 --- a/HighWayIot.Winform/HighWayIot.Winform.csproj +++ b/HighWayIot.Winform/HighWayIot.Winform.csproj @@ -49,6 +49,7 @@ + @@ -101,6 +102,18 @@ MonitorMainPage.cs + + Form + + + AddRecipeForm.cs + + + Form + + + AddWeightForm.cs + UserControl @@ -213,6 +226,12 @@ MonitorMainPage.cs + + AddRecipeForm.cs + + + AddWeightForm.cs + RecipeConfigPage.cs diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.cs index 522ac11..a2a1641 100644 --- a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.cs +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialAddForm.cs @@ -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 /// 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; } diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.cs index 00819f3..4867029 100644 --- a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.cs +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialConfigPage.cs @@ -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; } diff --git a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.cs b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.cs index 9ce809d..d1db6f9 100644 --- a/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.cs +++ b/HighWayIot.Winform/UserControlPages/MaterialConfigPages/MaterialUpdateForm.cs @@ -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; } diff --git a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddRecipeForm.Designer.cs b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddRecipeForm.Designer.cs new file mode 100644 index 0000000..4e301cc --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddRecipeForm.Designer.cs @@ -0,0 +1,254 @@ +namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages +{ + partial class AddRecipeForm + { + /// + /// 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.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; + } +} \ No newline at end of file diff --git a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddRecipeForm.cs b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddRecipeForm.cs new file mode 100644 index 0000000..6ec80d2 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddRecipeForm.cs @@ -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; + } + } + } +} diff --git a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddRecipeForm.resx b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddRecipeForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddRecipeForm.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/RecipeConfigPages/AddWeightForm.Designer.cs b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddWeightForm.Designer.cs new file mode 100644 index 0000000..4b70dec --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddWeightForm.Designer.cs @@ -0,0 +1,326 @@ +namespace HighWayIot.Winform.UserControlPages.RecipeConfigPages +{ + partial class AddWeightForm + { + /// + /// 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.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; + } +} \ No newline at end of file diff --git a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddWeightForm.cs b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddWeightForm.cs new file mode 100644 index 0000000..4acccce --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddWeightForm.cs @@ -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 + { + /// + /// 物料子类型服务类实例 + /// + ZxMaterialChildTypeService zxMaterialChildTypeService = ZxMaterialChildTypeService.Instance; + + /// + /// 物料类型服务类实例 + /// + ZxMaterialTypeService zxMaterialTypeService = ZxMaterialTypeService.Instance; + + /// + /// 物料服务类实例 + /// + ZxMaterialService zxMaterialService = ZxMaterialService.Instance; + + /// + /// 称量服务类实例 + /// + ZxWeightService zxWeightService = ZxWeightService.Instance; + + /// + /// 物料编号数组 + /// + string[] MaterialCodeArray; + + /// + /// 物料名称数组 + /// + string[] MaterialNameArray; + + /// + /// 物料子类型数组 + /// + string[] MaterialChildTypeArray; + + /// + /// 物料类型数组 + /// + string[] MaterialTypeArray; + + /// + /// 配方编号 + /// + 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 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(); + } + + /// + /// 物料类型选择事件 + /// + /// + /// + private void MaterialTypeComboBox_SelectionChangeCommitted(object sender, EventArgs e) + { + List 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; + } + + /// + /// 物料子类型选择事件 + /// + /// + /// + private void ChildTypeComboBox_SelectionChangeCommitted(object sender, EventArgs e) + { + List 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; + } + + /// + /// 物料编号选择事件 + /// + /// + /// + 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; + } + + /// + /// 物料名称选择事件 + /// + /// + /// + private void MaterialNameComboBox_SelectionChangeCommitted(object sender, EventArgs e) + { + List 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; + } + } + + /// + /// 物料类型更改事件 + /// + /// + /// + 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; + } + } +} diff --git a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddWeightForm.resx b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddWeightForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/AddWeightForm.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/RecipeConfigPages/RecipeConfigPage.Designer.cs b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.Designer.cs index 5ac6d58..954825c 100644 --- a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.Designer.cs +++ b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.Designer.cs @@ -34,11 +34,12 @@ namespace HighWayIot.Winform.UserControlPages this.WeightDataGridView = new System.Windows.Forms.DataGridView(); this.AddRecipeButton = new System.Windows.Forms.Button(); this.ButtonPanel = new System.Windows.Forms.Panel(); + this.RefreshRecipeButton = new System.Windows.Forms.Button(); + this.UpdateRecipeButton = new System.Windows.Forms.Button(); + this.DeleteRecipeButton = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.RecipeDataGridView = new System.Windows.Forms.DataGridView(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); this.RecipeCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.RecipeName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.RecipeSpecCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -47,13 +48,70 @@ namespace HighWayIot.Winform.UserControlPages this.FixedWidth = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.WeightError = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.IsUse = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.DeleteRecipeButton = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.E1P4TextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.E1P3TextBox = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.E1P2TextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.E1P1TextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.E2P4TextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.E2P3TextBox = new System.Windows.Forms.TextBox(); + this.E2P1TextBox = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.E2P2TextBox = new System.Windows.Forms.TextBox(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.E3P10TextBox = new System.Windows.Forms.TextBox(); + this.label22 = new System.Windows.Forms.Label(); + this.E3P15TextBox = new System.Windows.Forms.TextBox(); + this.label21 = new System.Windows.Forms.Label(); + this.E3P14TextBox = new System.Windows.Forms.TextBox(); + this.E3P11TextBox = new System.Windows.Forms.TextBox(); + this.label17 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.E3P13TextBox = new System.Windows.Forms.TextBox(); + this.label19 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.E3P12TextBox = new System.Windows.Forms.TextBox(); + this.E3P9TextBox = new System.Windows.Forms.TextBox(); + this.E3P6TextBox = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.E3P8TextBox = new System.Windows.Forms.TextBox(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.E3P7TextBox = new System.Windows.Forms.TextBox(); + this.E3P5CheckBox = new System.Windows.Forms.CheckBox(); + this.E3P4TextBox = new System.Windows.Forms.TextBox(); + this.E3P1TextBox = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.E3P3TextBox = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.E3P2TextBox = new System.Windows.Forms.TextBox(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.NowCopyLabel = new System.Windows.Forms.Label(); + this.label23 = new System.Windows.Forms.Label(); + this.ClearCutBoradButton = new System.Windows.Forms.Button(); + this.PasteParaButton = new System.Windows.Forms.Button(); + this.CopyParaButton = new System.Windows.Forms.Button(); + this.SaveParaButton = new System.Windows.Forms.Button(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.panel1 = new System.Windows.Forms.Panel(); + this.RefreshWeightButton = new System.Windows.Forms.Button(); + this.UpdateWeightButton = new System.Windows.Forms.Button(); this.AddWeightButton = new System.Windows.Forms.Button(); this.DeleteWeightButton = new System.Windows.Forms.Button(); - this.UpdateRecipeButton = new System.Windows.Forms.Button(); - this.UpdateWeightButton = new System.Windows.Forms.Button(); this.Id = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.MaterialCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.MaterialName = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -65,14 +123,18 @@ namespace HighWayIot.Winform.UserControlPages this.SetWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.SetError = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.WeightIsUse = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.RefreshRecipeButton = new System.Windows.Forms.Button(); - this.RefreshWeightButton = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.WeightDataGridView)).BeginInit(); this.ButtonPanel.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.RecipeDataGridView)).BeginInit(); this.tableLayoutPanel1.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.groupBox4.SuspendLayout(); + this.groupBox5.SuspendLayout(); + this.groupBox6.SuspendLayout(); + this.groupBox7.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); this.panel1.SuspendLayout(); this.SuspendLayout(); @@ -129,6 +191,40 @@ namespace HighWayIot.Winform.UserControlPages this.ButtonPanel.Size = new System.Drawing.Size(886, 58); this.ButtonPanel.TabIndex = 4; // + // RefreshRecipeButton + // + this.RefreshRecipeButton.Location = new System.Drawing.Point(229, 9); + this.RefreshRecipeButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.RefreshRecipeButton.Name = "RefreshRecipeButton"; + this.RefreshRecipeButton.Size = new System.Drawing.Size(103, 39); + this.RefreshRecipeButton.TabIndex = 4; + this.RefreshRecipeButton.Text = "刷新配方信息"; + this.RefreshRecipeButton.UseVisualStyleBackColor = true; + this.RefreshRecipeButton.Click += new System.EventHandler(this.RefreshRecipeButton_Click); + // + // UpdateRecipeButton + // + this.UpdateRecipeButton.Location = new System.Drawing.Point(120, 9); + this.UpdateRecipeButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.UpdateRecipeButton.Name = "UpdateRecipeButton"; + this.UpdateRecipeButton.Size = new System.Drawing.Size(103, 39); + this.UpdateRecipeButton.TabIndex = 3; + this.UpdateRecipeButton.Text = "修改配方信息"; + this.UpdateRecipeButton.UseVisualStyleBackColor = true; + this.UpdateRecipeButton.Click += new System.EventHandler(this.UpdateRecipeButton_Click); + // + // DeleteRecipeButton + // + this.DeleteRecipeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.DeleteRecipeButton.Location = new System.Drawing.Point(771, 9); + this.DeleteRecipeButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.DeleteRecipeButton.Name = "DeleteRecipeButton"; + this.DeleteRecipeButton.Size = new System.Drawing.Size(103, 39); + this.DeleteRecipeButton.TabIndex = 2; + this.DeleteRecipeButton.Text = "删除配方信息"; + this.DeleteRecipeButton.UseVisualStyleBackColor = true; + this.DeleteRecipeButton.Click += new System.EventHandler(this.DeleteRecipeButton_Click); + // // groupBox1 // this.groupBox1.Controls.Add(this.WeightDataGridView); @@ -176,6 +272,65 @@ namespace HighWayIot.Winform.UserControlPages this.RecipeDataGridView.Size = new System.Drawing.Size(880, 763); this.RecipeDataGridView.TabIndex = 0; this.RecipeDataGridView.Tag = ""; + this.RecipeDataGridView.SelectionChanged += new System.EventHandler(this.RecipeDataGridView_SelectionChanged); + // + // RecipeCode + // + this.RecipeCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.RecipeCode.DataPropertyName = "RecipeCode"; + this.RecipeCode.HeaderText = "配方编号"; + this.RecipeCode.Name = "RecipeCode"; + // + // RecipeName + // + this.RecipeName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.RecipeName.DataPropertyName = "RecipeName"; + this.RecipeName.HeaderText = "配方名称"; + this.RecipeName.Name = "RecipeName"; + // + // RecipeSpecCode + // + this.RecipeSpecCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.RecipeSpecCode.DataPropertyName = "RecipeSpecCode"; + this.RecipeSpecCode.HeaderText = "SPEC编号"; + this.RecipeSpecCode.Name = "RecipeSpecCode"; + // + // RecipeSpecName + // + this.RecipeSpecName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.RecipeSpecName.DataPropertyName = "RecipeSpecName"; + this.RecipeSpecName.HeaderText = "SPEC名称"; + this.RecipeSpecName.Name = "RecipeSpecName"; + // + // SizeKind + // + this.SizeKind.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.SizeKind.DataPropertyName = "SizeKind"; + this.SizeKind.HeaderText = "寸别"; + this.SizeKind.Name = "SizeKind"; + // + // FixedWidth + // + this.FixedWidth.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.FixedWidth.DataPropertyName = "FixedWidth"; + this.FixedWidth.HeaderText = "固定胶宽度"; + this.FixedWidth.Name = "FixedWidth"; + // + // WeightError + // + this.WeightError.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.WeightError.DataPropertyName = "WeightError"; + this.WeightError.HeaderText = "重量公差"; + this.WeightError.Name = "WeightError"; + // + // IsUse + // + this.IsUse.DataPropertyName = "IsUse"; + this.IsUse.HeaderText = "启用"; + this.IsUse.Name = "IsUse"; + this.IsUse.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.IsUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.IsUse.Width = 40; // // tableLayoutPanel1 // @@ -199,6 +354,7 @@ namespace HighWayIot.Winform.UserControlPages // this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox3.Controls.Add(this.tableLayoutPanel3); this.groupBox3.Location = new System.Drawing.Point(0, 63); this.groupBox3.Margin = new System.Windows.Forms.Padding(0); this.groupBox3.Name = "groupBox3"; @@ -207,67 +363,545 @@ namespace HighWayIot.Winform.UserControlPages this.groupBox3.TabStop = false; this.groupBox3.Text = "配方参数"; // - // RecipeCode + // tableLayoutPanel3 // - this.RecipeCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.RecipeCode.HeaderText = "配方编号"; - this.RecipeCode.Name = "RecipeCode"; + this.tableLayoutPanel3.ColumnCount = 4; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 22.22222F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 22.22222F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 55.55556F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 179F)); + this.tableLayoutPanel3.Controls.Add(this.groupBox4, 0, 0); + this.tableLayoutPanel3.Controls.Add(this.groupBox5, 1, 0); + this.tableLayoutPanel3.Controls.Add(this.groupBox6, 2, 0); + this.tableLayoutPanel3.Controls.Add(this.groupBox7, 3, 0); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 17); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 1; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 170F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(1767, 170); + this.tableLayoutPanel3.TabIndex = 0; // - // RecipeName + // groupBox4 // - this.RecipeName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.RecipeName.HeaderText = "配方名称"; - this.RecipeName.Name = "RecipeName"; + this.groupBox4.Controls.Add(this.E1P4TextBox); + this.groupBox4.Controls.Add(this.label4); + this.groupBox4.Controls.Add(this.E1P3TextBox); + this.groupBox4.Controls.Add(this.label3); + this.groupBox4.Controls.Add(this.E1P2TextBox); + this.groupBox4.Controls.Add(this.label2); + this.groupBox4.Controls.Add(this.E1P1TextBox); + this.groupBox4.Controls.Add(this.label1); + this.groupBox4.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox4.Location = new System.Drawing.Point(0, 0); + this.groupBox4.Margin = new System.Windows.Forms.Padding(0); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(352, 170); + this.groupBox4.TabIndex = 0; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "开炼机#1参数"; // - // RecipeSpecCode + // E1P4TextBox // - this.RecipeSpecCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.RecipeSpecCode.HeaderText = "SPEC编号"; - this.RecipeSpecCode.Name = "RecipeSpecCode"; + this.E1P4TextBox.Location = new System.Drawing.Point(146, 101); + this.E1P4TextBox.Name = "E1P4TextBox"; + this.E1P4TextBox.Size = new System.Drawing.Size(95, 21); + this.E1P4TextBox.TabIndex = 7; // - // RecipeSpecName + // label4 // - this.RecipeSpecName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.RecipeSpecName.HeaderText = "SPEC名称"; - this.RecipeSpecName.Name = "RecipeSpecName"; + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(27, 104); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(113, 12); + this.label4.TabIndex = 6; + this.label4.Text = "1#工位胶片贴合时间"; // - // SizeKind + // E1P3TextBox // - this.SizeKind.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.SizeKind.HeaderText = "寸别"; - this.SizeKind.Name = "SizeKind"; + this.E1P3TextBox.Location = new System.Drawing.Point(146, 74); + this.E1P3TextBox.Name = "E1P3TextBox"; + this.E1P3TextBox.Size = new System.Drawing.Size(95, 21); + this.E1P3TextBox.TabIndex = 5; // - // FixedWidth + // label3 // - this.FixedWidth.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.FixedWidth.HeaderText = "固定胶宽度"; - this.FixedWidth.Name = "FixedWidth"; + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(15, 78); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(125, 12); + this.label3.TabIndex = 4; + this.label3.Text = "1#工位贴合末横裁延时"; // - // WeightError + // E1P2TextBox // - this.WeightError.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.WeightError.HeaderText = "重量公差"; - this.WeightError.Name = "WeightError"; + this.E1P2TextBox.Location = new System.Drawing.Point(146, 47); + this.E1P2TextBox.Name = "E1P2TextBox"; + this.E1P2TextBox.Size = new System.Drawing.Size(95, 21); + this.E1P2TextBox.TabIndex = 3; // - // IsUse + // label2 // - this.IsUse.HeaderText = "启用"; - this.IsUse.Name = "IsUse"; - this.IsUse.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.IsUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.IsUse.Width = 40; + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(15, 51); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(125, 12); + this.label2.TabIndex = 2; + this.label2.Text = "1#工位贴合鼓脱开延时"; // - // DeleteRecipeButton + // E1P1TextBox // - this.DeleteRecipeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.DeleteRecipeButton.Location = new System.Drawing.Point(771, 9); - this.DeleteRecipeButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.DeleteRecipeButton.Name = "DeleteRecipeButton"; - this.DeleteRecipeButton.Size = new System.Drawing.Size(103, 39); - this.DeleteRecipeButton.TabIndex = 2; - this.DeleteRecipeButton.Text = "删除配方信息"; - this.DeleteRecipeButton.UseVisualStyleBackColor = true; - this.DeleteRecipeButton.Click += new System.EventHandler(this.DeleteRecipeButton_Click); + this.E1P1TextBox.Location = new System.Drawing.Point(146, 20); + this.E1P1TextBox.Name = "E1P1TextBox"; + this.E1P1TextBox.Size = new System.Drawing.Size(95, 21); + this.E1P1TextBox.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(15, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(125, 12); + this.label1.TabIndex = 0; + this.label1.Text = "1#工位贴合鼓到位延时"; + // + // groupBox5 + // + this.groupBox5.Controls.Add(this.E2P4TextBox); + this.groupBox5.Controls.Add(this.label5); + this.groupBox5.Controls.Add(this.label8); + this.groupBox5.Controls.Add(this.E2P3TextBox); + this.groupBox5.Controls.Add(this.E2P1TextBox); + this.groupBox5.Controls.Add(this.label6); + this.groupBox5.Controls.Add(this.label7); + this.groupBox5.Controls.Add(this.E2P2TextBox); + this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox5.Location = new System.Drawing.Point(352, 0); + this.groupBox5.Margin = new System.Windows.Forms.Padding(0); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(352, 170); + this.groupBox5.TabIndex = 1; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "开炼机#2参数"; + // + // E2P4TextBox + // + this.E2P4TextBox.Location = new System.Drawing.Point(147, 102); + this.E2P4TextBox.Name = "E2P4TextBox"; + this.E2P4TextBox.Size = new System.Drawing.Size(95, 21); + this.E2P4TextBox.TabIndex = 15; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(28, 105); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(113, 12); + this.label5.TabIndex = 14; + this.label5.Text = "2#工位胶片贴合时间"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(16, 25); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(125, 12); + this.label8.TabIndex = 8; + this.label8.Text = "2#工位贴合鼓到位延时"; + // + // E2P3TextBox + // + this.E2P3TextBox.Location = new System.Drawing.Point(147, 75); + this.E2P3TextBox.Name = "E2P3TextBox"; + this.E2P3TextBox.Size = new System.Drawing.Size(95, 21); + this.E2P3TextBox.TabIndex = 13; + // + // E2P1TextBox + // + this.E2P1TextBox.Location = new System.Drawing.Point(147, 21); + this.E2P1TextBox.Name = "E2P1TextBox"; + this.E2P1TextBox.Size = new System.Drawing.Size(95, 21); + this.E2P1TextBox.TabIndex = 9; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(16, 79); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(125, 12); + this.label6.TabIndex = 12; + this.label6.Text = "2#工位贴合末横裁延时"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(16, 52); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(125, 12); + this.label7.TabIndex = 10; + this.label7.Text = "2#工位贴合鼓脱开延时"; + // + // E2P2TextBox + // + this.E2P2TextBox.Location = new System.Drawing.Point(147, 48); + this.E2P2TextBox.Name = "E2P2TextBox"; + this.E2P2TextBox.Size = new System.Drawing.Size(95, 21); + this.E2P2TextBox.TabIndex = 11; + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.E3P10TextBox); + this.groupBox6.Controls.Add(this.label22); + this.groupBox6.Controls.Add(this.E3P15TextBox); + this.groupBox6.Controls.Add(this.label21); + this.groupBox6.Controls.Add(this.E3P14TextBox); + this.groupBox6.Controls.Add(this.E3P11TextBox); + this.groupBox6.Controls.Add(this.label17); + this.groupBox6.Controls.Add(this.label18); + this.groupBox6.Controls.Add(this.E3P13TextBox); + this.groupBox6.Controls.Add(this.label19); + this.groupBox6.Controls.Add(this.label20); + this.groupBox6.Controls.Add(this.E3P12TextBox); + this.groupBox6.Controls.Add(this.E3P9TextBox); + this.groupBox6.Controls.Add(this.E3P6TextBox); + this.groupBox6.Controls.Add(this.label13); + this.groupBox6.Controls.Add(this.label14); + this.groupBox6.Controls.Add(this.E3P8TextBox); + this.groupBox6.Controls.Add(this.label15); + this.groupBox6.Controls.Add(this.label16); + this.groupBox6.Controls.Add(this.E3P7TextBox); + this.groupBox6.Controls.Add(this.E3P5CheckBox); + this.groupBox6.Controls.Add(this.E3P4TextBox); + this.groupBox6.Controls.Add(this.E3P1TextBox); + this.groupBox6.Controls.Add(this.label9); + this.groupBox6.Controls.Add(this.label12); + this.groupBox6.Controls.Add(this.E3P3TextBox); + this.groupBox6.Controls.Add(this.label11); + this.groupBox6.Controls.Add(this.label10); + this.groupBox6.Controls.Add(this.E3P2TextBox); + this.groupBox6.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox6.Location = new System.Drawing.Point(704, 0); + this.groupBox6.Margin = new System.Windows.Forms.Padding(0); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(882, 170); + this.groupBox6.TabIndex = 2; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "开炼机#3参数"; + // + // E3P10TextBox + // + this.E3P10TextBox.Location = new System.Drawing.Point(380, 129); + this.E3P10TextBox.Name = "E3P10TextBox"; + this.E3P10TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P10TextBox.TabIndex = 44; + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(297, 133); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(77, 12); + this.label22.TabIndex = 43; + this.label22.Text = "压合进给速度"; + // + // E3P15TextBox + // + this.E3P15TextBox.Location = new System.Drawing.Point(590, 128); + this.E3P15TextBox.Name = "E3P15TextBox"; + this.E3P15TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P15TextBox.TabIndex = 42; + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Location = new System.Drawing.Point(483, 132); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(101, 12); + this.label21.TabIndex = 41; + this.label21.Text = "进退准备位置速度"; + // + // E3P14TextBox + // + this.E3P14TextBox.Location = new System.Drawing.Point(590, 101); + this.E3P14TextBox.Name = "E3P14TextBox"; + this.E3P14TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P14TextBox.TabIndex = 40; + // + // E3P11TextBox + // + this.E3P11TextBox.Location = new System.Drawing.Point(590, 20); + this.E3P11TextBox.Name = "E3P11TextBox"; + this.E3P11TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P11TextBox.TabIndex = 34; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(483, 105); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(101, 12); + this.label17.TabIndex = 39; + this.label17.Text = "分合准备位置速度"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(507, 24); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(77, 12); + this.label18.TabIndex = 33; + this.label18.Text = "包边压合起点"; + // + // E3P13TextBox + // + this.E3P13TextBox.Location = new System.Drawing.Point(590, 74); + this.E3P13TextBox.Name = "E3P13TextBox"; + this.E3P13TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P13TextBox.TabIndex = 38; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(507, 51); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(77, 12); + this.label19.TabIndex = 35; + this.label19.Text = "包边压合终点"; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(507, 78); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(77, 12); + this.label20.TabIndex = 37; + this.label20.Text = "包边压合宽度"; + // + // E3P12TextBox + // + this.E3P12TextBox.Location = new System.Drawing.Point(590, 47); + this.E3P12TextBox.Name = "E3P12TextBox"; + this.E3P12TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P12TextBox.TabIndex = 36; + // + // E3P9TextBox + // + this.E3P9TextBox.Location = new System.Drawing.Point(380, 102); + this.E3P9TextBox.Name = "E3P9TextBox"; + this.E3P9TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P9TextBox.TabIndex = 32; + // + // E3P6TextBox + // + this.E3P6TextBox.Location = new System.Drawing.Point(380, 21); + this.E3P6TextBox.Name = "E3P6TextBox"; + this.E3P6TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P6TextBox.TabIndex = 26; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(273, 105); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(101, 12); + this.label13.TabIndex = 31; + this.label13.Text = "3#包边鼓脱开延时"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(261, 25); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(113, 12); + this.label14.TabIndex = 25; + this.label14.Text = "3#工位包边贴合时间"; + // + // E3P8TextBox + // + this.E3P8TextBox.Location = new System.Drawing.Point(380, 75); + this.E3P8TextBox.Name = "E3P8TextBox"; + this.E3P8TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P8TextBox.TabIndex = 30; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(249, 52); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(125, 12); + this.label15.TabIndex = 27; + this.label15.Text = "3#工位包边末横裁延时"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(273, 79); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(101, 12); + this.label16.TabIndex = 29; + this.label16.Text = "3#包边工作位延时"; + // + // E3P7TextBox + // + this.E3P7TextBox.Location = new System.Drawing.Point(380, 48); + this.E3P7TextBox.Name = "E3P7TextBox"; + this.E3P7TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P7TextBox.TabIndex = 28; + // + // E3P5CheckBox + // + this.E3P5CheckBox.AutoSize = true; + this.E3P5CheckBox.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.E3P5CheckBox.Location = new System.Drawing.Point(151, 128); + this.E3P5CheckBox.Name = "E3P5CheckBox"; + this.E3P5CheckBox.Size = new System.Drawing.Size(90, 20); + this.E3P5CheckBox.TabIndex = 24; + this.E3P5CheckBox.Text = "包边压合"; + this.E3P5CheckBox.UseVisualStyleBackColor = true; + // + // E3P4TextBox + // + this.E3P4TextBox.Location = new System.Drawing.Point(148, 101); + this.E3P4TextBox.Name = "E3P4TextBox"; + this.E3P4TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P4TextBox.TabIndex = 23; + // + // E3P1TextBox + // + this.E3P1TextBox.Location = new System.Drawing.Point(148, 20); + this.E3P1TextBox.Name = "E3P1TextBox"; + this.E3P1TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P1TextBox.TabIndex = 17; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(29, 104); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(113, 12); + this.label9.TabIndex = 22; + this.label9.Text = "3#工位胶片贴合时间"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(17, 24); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(125, 12); + this.label12.TabIndex = 16; + this.label12.Text = "3#工位贴合鼓到位延时"; + // + // E3P3TextBox + // + this.E3P3TextBox.Location = new System.Drawing.Point(148, 74); + this.E3P3TextBox.Name = "E3P3TextBox"; + this.E3P3TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P3TextBox.TabIndex = 21; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(17, 51); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(125, 12); + this.label11.TabIndex = 18; + this.label11.Text = "3#工位贴合鼓脱开延时"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(17, 78); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(125, 12); + this.label10.TabIndex = 20; + this.label10.Text = "3#工位贴合末横裁延时"; + // + // E3P2TextBox + // + this.E3P2TextBox.Location = new System.Drawing.Point(148, 47); + this.E3P2TextBox.Name = "E3P2TextBox"; + this.E3P2TextBox.Size = new System.Drawing.Size(95, 21); + this.E3P2TextBox.TabIndex = 19; + // + // groupBox7 + // + this.groupBox7.Controls.Add(this.NowCopyLabel); + this.groupBox7.Controls.Add(this.label23); + this.groupBox7.Controls.Add(this.ClearCutBoradButton); + this.groupBox7.Controls.Add(this.PasteParaButton); + this.groupBox7.Controls.Add(this.CopyParaButton); + this.groupBox7.Controls.Add(this.SaveParaButton); + this.groupBox7.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox7.Location = new System.Drawing.Point(1586, 0); + this.groupBox7.Margin = new System.Windows.Forms.Padding(0); + this.groupBox7.Name = "groupBox7"; + this.groupBox7.Size = new System.Drawing.Size(181, 170); + this.groupBox7.TabIndex = 3; + this.groupBox7.TabStop = false; + this.groupBox7.Text = "参数操作"; + // + // NowCopyLabel + // + this.NowCopyLabel.AutoSize = true; + this.NowCopyLabel.Location = new System.Drawing.Point(6, 142); + this.NowCopyLabel.Name = "NowCopyLabel"; + this.NowCopyLabel.Size = new System.Drawing.Size(23, 12); + this.NowCopyLabel.TabIndex = 5; + this.NowCopyLabel.Text = "N/A"; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(6, 118); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(77, 12); + this.label23.TabIndex = 4; + this.label23.Text = "当前复制编号"; + // + // ClearCutBoradButton + // + this.ClearCutBoradButton.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.ClearCutBoradButton.Location = new System.Drawing.Point(88, 118); + this.ClearCutBoradButton.Name = "ClearCutBoradButton"; + this.ClearCutBoradButton.Size = new System.Drawing.Size(76, 43); + this.ClearCutBoradButton.TabIndex = 3; + this.ClearCutBoradButton.Text = "清除"; + this.ClearCutBoradButton.UseVisualStyleBackColor = true; + this.ClearCutBoradButton.Click += new System.EventHandler(this.ClearCutBoradButton_Click); + // + // PasteParaButton + // + this.PasteParaButton.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.PasteParaButton.Location = new System.Drawing.Point(88, 69); + this.PasteParaButton.Name = "PasteParaButton"; + this.PasteParaButton.Size = new System.Drawing.Size(76, 43); + this.PasteParaButton.TabIndex = 2; + this.PasteParaButton.Text = "粘贴"; + this.PasteParaButton.UseVisualStyleBackColor = true; + this.PasteParaButton.Click += new System.EventHandler(this.PasteParaButton_Click); + // + // CopyParaButton + // + this.CopyParaButton.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.CopyParaButton.Location = new System.Drawing.Point(6, 69); + this.CopyParaButton.Name = "CopyParaButton"; + this.CopyParaButton.Size = new System.Drawing.Size(76, 43); + this.CopyParaButton.TabIndex = 1; + this.CopyParaButton.Text = "复制"; + this.CopyParaButton.UseVisualStyleBackColor = true; + this.CopyParaButton.Click += new System.EventHandler(this.CopyParaButton_Click); + // + // SaveParaButton + // + this.SaveParaButton.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.SaveParaButton.Location = new System.Drawing.Point(6, 20); + this.SaveParaButton.Name = "SaveParaButton"; + this.SaveParaButton.Size = new System.Drawing.Size(158, 43); + this.SaveParaButton.TabIndex = 0; + this.SaveParaButton.Text = "保存此参数"; + this.SaveParaButton.UseVisualStyleBackColor = true; + this.SaveParaButton.Click += new System.EventHandler(this.SaveParaButton_Click); // // tableLayoutPanel2 // @@ -300,6 +934,28 @@ namespace HighWayIot.Winform.UserControlPages this.panel1.Size = new System.Drawing.Size(887, 58); this.panel1.TabIndex = 5; // + // RefreshWeightButton + // + this.RefreshWeightButton.Location = new System.Drawing.Point(229, 9); + this.RefreshWeightButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.RefreshWeightButton.Name = "RefreshWeightButton"; + this.RefreshWeightButton.Size = new System.Drawing.Size(103, 39); + this.RefreshWeightButton.TabIndex = 4; + this.RefreshWeightButton.Text = "刷新称量信息"; + this.RefreshWeightButton.UseVisualStyleBackColor = true; + this.RefreshWeightButton.Click += new System.EventHandler(this.RefreshWeightButton_Click); + // + // UpdateWeightButton + // + this.UpdateWeightButton.Location = new System.Drawing.Point(120, 9); + this.UpdateWeightButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.UpdateWeightButton.Name = "UpdateWeightButton"; + this.UpdateWeightButton.Size = new System.Drawing.Size(103, 39); + this.UpdateWeightButton.TabIndex = 3; + this.UpdateWeightButton.Text = "修改称量信息"; + this.UpdateWeightButton.UseVisualStyleBackColor = true; + this.UpdateWeightButton.Click += new System.EventHandler(this.UpdateWeightButton_Click); + // // AddWeightButton // this.AddWeightButton.Location = new System.Drawing.Point(11, 9); @@ -323,30 +979,9 @@ namespace HighWayIot.Winform.UserControlPages this.DeleteWeightButton.UseVisualStyleBackColor = true; this.DeleteWeightButton.Click += new System.EventHandler(this.DeleteWeightButton_Click); // - // UpdateRecipeButton - // - this.UpdateRecipeButton.Location = new System.Drawing.Point(120, 9); - this.UpdateRecipeButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.UpdateRecipeButton.Name = "UpdateRecipeButton"; - this.UpdateRecipeButton.Size = new System.Drawing.Size(103, 39); - this.UpdateRecipeButton.TabIndex = 3; - this.UpdateRecipeButton.Text = "修改配方信息"; - this.UpdateRecipeButton.UseVisualStyleBackColor = true; - this.UpdateRecipeButton.Click += new System.EventHandler(this.UpdateRecipeButton_Click); - // - // UpdateWeightButton - // - this.UpdateWeightButton.Location = new System.Drawing.Point(120, 9); - this.UpdateWeightButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.UpdateWeightButton.Name = "UpdateWeightButton"; - this.UpdateWeightButton.Size = new System.Drawing.Size(103, 39); - this.UpdateWeightButton.TabIndex = 3; - this.UpdateWeightButton.Text = "修改称量信息"; - this.UpdateWeightButton.UseVisualStyleBackColor = true; - this.UpdateWeightButton.Click += new System.EventHandler(this.UpdateWeightButton_Click); - // // Id // + this.Id.DataPropertyName = "Id"; this.Id.HeaderText = "编号"; this.Id.Name = "Id"; this.Id.ReadOnly = true; @@ -355,12 +990,15 @@ namespace HighWayIot.Winform.UserControlPages // MaterialCode // this.MaterialCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.MaterialCode.DataPropertyName = "MaterialCode"; this.MaterialCode.HeaderText = "物料编码"; this.MaterialCode.Name = "MaterialCode"; + this.MaterialCode.Resizable = System.Windows.Forms.DataGridViewTriState.True; // // MaterialName // this.MaterialName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.MaterialName.DataPropertyName = "MaterialName"; this.MaterialName.HeaderText = "物料名称"; this.MaterialName.Name = "MaterialName"; this.MaterialName.ReadOnly = true; @@ -368,77 +1006,65 @@ namespace HighWayIot.Winform.UserControlPages // MaterialType // this.MaterialType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.MaterialType.DataPropertyName = "MaterialType"; this.MaterialType.HeaderText = "物料类型"; this.MaterialType.Name = "MaterialType"; this.MaterialType.ReadOnly = true; + this.MaterialType.Resizable = System.Windows.Forms.DataGridViewTriState.True; // // MaterialChildType // this.MaterialChildType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.MaterialChildType.DataPropertyName = "MaterialChildType"; this.MaterialChildType.HeaderText = "子类型"; this.MaterialChildType.Name = "MaterialChildType"; this.MaterialChildType.ReadOnly = true; + this.MaterialChildType.Resizable = System.Windows.Forms.DataGridViewTriState.True; // // SetThickness // this.SetThickness.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.SetThickness.DataPropertyName = "SetThickness"; this.SetThickness.HeaderText = "厚度"; this.SetThickness.Name = "SetThickness"; // // SetWidth // this.SetWidth.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.SetWidth.DataPropertyName = "SetWidth"; this.SetWidth.HeaderText = "宽度"; this.SetWidth.Name = "SetWidth"; // // SetLayer // this.SetLayer.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.SetLayer.DataPropertyName = "SetLayer"; this.SetLayer.HeaderText = "层数"; this.SetLayer.Name = "SetLayer"; // // SetWeight // this.SetWeight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.SetWeight.DataPropertyName = "SetWeight"; this.SetWeight.HeaderText = "重量"; this.SetWeight.Name = "SetWeight"; // // SetError // this.SetError.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.SetError.DataPropertyName = "SetError"; this.SetError.HeaderText = "公差"; this.SetError.Name = "SetError"; // // WeightIsUse // - this.WeightIsUse.HeaderText = "使用"; + this.WeightIsUse.DataPropertyName = "IsUse"; + this.WeightIsUse.HeaderText = "启用"; this.WeightIsUse.Name = "WeightIsUse"; this.WeightIsUse.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.WeightIsUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.WeightIsUse.Width = 40; // - // RefreshRecipeButton - // - this.RefreshRecipeButton.Location = new System.Drawing.Point(229, 9); - this.RefreshRecipeButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.RefreshRecipeButton.Name = "RefreshRecipeButton"; - this.RefreshRecipeButton.Size = new System.Drawing.Size(103, 39); - this.RefreshRecipeButton.TabIndex = 4; - this.RefreshRecipeButton.Text = "刷新配方信息"; - this.RefreshRecipeButton.UseVisualStyleBackColor = true; - this.RefreshRecipeButton.Click += new System.EventHandler(this.RefreshRecipeButton_Click); - // - // RefreshWeightButton - // - this.RefreshWeightButton.Location = new System.Drawing.Point(229, 9); - this.RefreshWeightButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.RefreshWeightButton.Name = "RefreshWeightButton"; - this.RefreshWeightButton.Size = new System.Drawing.Size(103, 39); - this.RefreshWeightButton.TabIndex = 4; - this.RefreshWeightButton.Text = "刷新称量信息"; - this.RefreshWeightButton.UseVisualStyleBackColor = true; - this.RefreshWeightButton.Click += new System.EventHandler(this.RefreshWeightButton_Click); - // // RecipeConfigPage // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -456,6 +1082,16 @@ namespace HighWayIot.Winform.UserControlPages this.groupBox2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.RecipeDataGridView)).EndInit(); this.tableLayoutPanel1.ResumeLayout(false); + this.groupBox3.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.groupBox7.ResumeLayout(false); + this.groupBox7.PerformLayout(); this.tableLayoutPanel2.ResumeLayout(false); this.panel1.ResumeLayout(false); this.ResumeLayout(false); @@ -472,6 +1108,71 @@ namespace HighWayIot.Winform.UserControlPages private DataGridView RecipeDataGridView; private TableLayoutPanel tableLayoutPanel1; private GroupBox groupBox3; + private Button DeleteRecipeButton; + private TableLayoutPanel tableLayoutPanel2; + private Panel panel1; + private Button AddWeightButton; + private Button DeleteWeightButton; + private Button UpdateRecipeButton; + private Button UpdateWeightButton; + private Button RefreshRecipeButton; + private Button RefreshWeightButton; + private TableLayoutPanel tableLayoutPanel3; + private GroupBox groupBox4; + private GroupBox groupBox5; + private GroupBox groupBox6; + private TextBox E1P4TextBox; + private Label label4; + private TextBox E1P3TextBox; + private Label label3; + private TextBox E1P2TextBox; + private Label label2; + private TextBox E1P1TextBox; + private Label label1; + private TextBox E2P4TextBox; + private Label label5; + private Label label8; + private TextBox E2P3TextBox; + private TextBox E2P1TextBox; + private Label label6; + private Label label7; + private TextBox E2P2TextBox; + private TextBox E3P4TextBox; + private TextBox E3P1TextBox; + private Label label9; + private Label label12; + private TextBox E3P3TextBox; + private Label label11; + private Label label10; + private TextBox E3P2TextBox; + private TextBox E3P14TextBox; + private TextBox E3P11TextBox; + private Label label17; + private Label label18; + private TextBox E3P13TextBox; + private Label label19; + private Label label20; + private TextBox E3P12TextBox; + private TextBox E3P9TextBox; + private TextBox E3P6TextBox; + private Label label13; + private Label label14; + private TextBox E3P8TextBox; + private Label label15; + private Label label16; + private TextBox E3P7TextBox; + private CheckBox E3P5CheckBox; + private TextBox E3P10TextBox; + private Label label22; + private TextBox E3P15TextBox; + private Label label21; + private GroupBox groupBox7; + private Button PasteParaButton; + private Button CopyParaButton; + private Button SaveParaButton; + private Label NowCopyLabel; + private Label label23; + private Button ClearCutBoradButton; private DataGridViewTextBoxColumn RecipeCode; private DataGridViewTextBoxColumn RecipeName; private DataGridViewTextBoxColumn RecipeSpecCode; @@ -480,13 +1181,6 @@ namespace HighWayIot.Winform.UserControlPages private DataGridViewTextBoxColumn FixedWidth; private DataGridViewTextBoxColumn WeightError; private DataGridViewCheckBoxColumn IsUse; - private Button DeleteRecipeButton; - private TableLayoutPanel tableLayoutPanel2; - private Panel panel1; - private Button AddWeightButton; - private Button DeleteWeightButton; - private Button UpdateRecipeButton; - private Button UpdateWeightButton; private DataGridViewTextBoxColumn Id; private DataGridViewTextBoxColumn MaterialCode; private DataGridViewTextBoxColumn MaterialName; @@ -498,7 +1192,5 @@ namespace HighWayIot.Winform.UserControlPages private DataGridViewTextBoxColumn SetWeight; private DataGridViewTextBoxColumn SetError; private DataGridViewCheckBoxColumn WeightIsUse; - private Button RefreshRecipeButton; - private Button RefreshWeightButton; } } diff --git a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.cs b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.cs index 5b0b1b9..130be67 100644 --- a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.cs +++ b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.cs @@ -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 { + /// + /// 配方服务类实例 + /// + ZxRecipeService zxRecipeService = ZxRecipeService.Instance; + + /// + /// 称重服务类实例 + /// + ZxWeightService zxWeightService = ZxWeightService.Instance; + + /// + /// 配方字段服务类实例 + /// + ZxRecipeParaService zxRecipeParaService = ZxRecipeParaService.Instance; + + /// + /// 称重DataGridView数据源 + /// + List weightDataSourceEntities; + + /// + /// 配方列表 + /// + List RecipeLists; + + /// + /// 称量列表 + /// + List 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; } /// @@ -30,7 +72,11 @@ namespace HighWayIot.Winform.UserControlPages /// private void AddRecipeButton_Click(object sender, EventArgs e) { - + AddRecipeForm form = new AddRecipeForm(); + form.ShowDialog(); + RecipeLists = zxRecipeService.GetRecipeInfos(); + RecipeDataGridView.DataSource = null; + RecipeDataGridView.DataSource = RecipeLists; } /// @@ -70,7 +116,19 @@ namespace HighWayIot.Winform.UserControlPages /// 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; } /// @@ -102,5 +160,70 @@ namespace HighWayIot.Winform.UserControlPages { } + + /// + /// 参数保存 + /// + /// + /// + private void SaveParaButton_Click(object sender, EventArgs e) + { + + } + + /// + /// 参数复制 + /// + /// + /// + private void CopyParaButton_Click(object sender, EventArgs e) + { + + } + + /// + /// 参数粘贴 + /// + /// + /// + private void PasteParaButton_Click(object sender, EventArgs e) + { + + } + + /// + /// 参数清空 + /// + /// + /// + private void ClearCutBoradButton_Click(object sender, EventArgs e) + { + + } + + /// + /// 所选配方内容更改事件 + /// + /// + /// + 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; + } + + /// + /// 称重和物料数据联查 + /// + private void WeighCombineMaterialData() + { + + } + } } diff --git a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.resx b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.resx index 1111578..3107fcf 100644 --- a/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.resx +++ b/HighWayIot.Winform/UserControlPages/RecipeConfigPages/RecipeConfigPage.resx @@ -174,61 +174,4 @@ True - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - \ No newline at end of file diff --git a/HighWayIot.Winform/UserControlPages/SysConfigPages/UserAddForm.cs b/HighWayIot.Winform/UserControlPages/SysConfigPages/UserAddForm.cs index 422d3b3..7124a7e 100644 --- a/HighWayIot.Winform/UserControlPages/SysConfigPages/UserAddForm.cs +++ b/HighWayIot.Winform/UserControlPages/SysConfigPages/UserAddForm.cs @@ -32,10 +32,15 @@ namespace HighWayIot.Winform.UserControlPages.SysConfigPages /// 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); diff --git a/HighWayIot.Winform/UserControlPages/SysConfigPages/UserConfigPage.cs b/HighWayIot.Winform/UserControlPages/SysConfigPages/UserConfigPage.cs index a9308f4..64cc291 100644 --- a/HighWayIot.Winform/UserControlPages/SysConfigPages/UserConfigPage.cs +++ b/HighWayIot.Winform/UserControlPages/SysConfigPages/UserConfigPage.cs @@ -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);