From a1b669a75a75e632e1c0c1ebbea08df2be0d147c Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Mon, 15 Sep 2025 10:59:51 +0800 Subject: [PATCH] 1 --- DataBase/版本日志/HJGLDB_DS_2025-09-15_gf.sql | 4 ++++ .../BLL/WeldMat/BaseInfo/UnitStoreService.cs | 9 ++++--- .../WeldMat/BaseInfo/UnitStore.aspx | 6 ++++- .../WeldMat/BaseInfo/UnitStore.aspx.cs | 8 +++++-- .../BaseInfo/UnitStore.aspx.designer.cs | 9 +++++++ .../WeldMat/UsingSentMat/UsingtMatSelect.aspx | 7 +++--- HJGL_DS/Model/Model.cs | 24 +++++++++++++++++++ 7 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 DataBase/版本日志/HJGLDB_DS_2025-09-15_gf.sql diff --git a/DataBase/版本日志/HJGLDB_DS_2025-09-15_gf.sql b/DataBase/版本日志/HJGLDB_DS_2025-09-15_gf.sql new file mode 100644 index 0000000..a0c93e8 --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2025-09-15_gf.sql @@ -0,0 +1,4 @@ +alter table Weld_UnitStore add IsUsed bit null +GO +update Weld_UnitStore set IsUsed=1 +GO \ No newline at end of file diff --git a/HJGL_DS/BLL/WeldMat/BaseInfo/UnitStoreService.cs b/HJGL_DS/BLL/WeldMat/BaseInfo/UnitStoreService.cs index c74a795..5434127 100644 --- a/HJGL_DS/BLL/WeldMat/BaseInfo/UnitStoreService.cs +++ b/HJGL_DS/BLL/WeldMat/BaseInfo/UnitStoreService.cs @@ -5,7 +5,7 @@ using System.Text; namespace BLL { - public static class UnitStoreService + public static class UnitStoreService { /// /// 根据主键获取单位仓库 @@ -19,7 +19,7 @@ namespace BLL public static List GetUnitStoreByUnitId(string unitId) { - return Funs.DB.Weld_UnitStore.Where(e => e.UnitId==unitId).ToList(); + return Funs.DB.Weld_UnitStore.Where(e => e.UnitId == unitId).ToList(); } /// @@ -35,6 +35,7 @@ namespace BLL newUnitStore.UnitStoreCode = unitStore.UnitStoreCode; newUnitStore.UnitStoreName = unitStore.UnitStoreName; newUnitStore.StorePosition = unitStore.StorePosition; + newUnitStore.IsUsed = unitStore.IsUsed; db.Weld_UnitStore.InsertOnSubmit(newUnitStore); db.SubmitChanges(); } @@ -53,6 +54,7 @@ namespace BLL newUnitStore.UnitStoreCode = unitStore.UnitStoreCode; newUnitStore.UnitStoreName = unitStore.UnitStoreName; newUnitStore.StorePosition = unitStore.StorePosition; + newUnitStore.IsUsed = unitStore.IsUsed; db.SubmitChanges(); } } @@ -118,6 +120,7 @@ namespace BLL { var store = from x in Funs.DB.Weld_UnitStore join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId + where x.IsUsed == true orderby y.UnitName, x.UnitStoreCode select new { x.UnitStoreId, UnitStoreName = x.UnitStoreName, y.UnitName, x.UnitId }; if (!string.IsNullOrEmpty(unitId)) @@ -146,7 +149,7 @@ namespace BLL string name = string.Empty; var store = from x in Funs.DB.Weld_UnitStore join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.UnitStoreId== unitStoreId + where x.UnitStoreId == unitStoreId orderby y.UnitName, x.UnitStoreCode select new { x.UnitStoreId, UnitStoreName = (y.UnitName + "(" + x.UnitStoreName + ")"), y.UnitName, x.UnitId }; if (store.Count() > 0) diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx index ec59e34..bc56432 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx +++ b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx @@ -34,7 +34,7 @@ - @@ -46,6 +46,7 @@ HeaderText="仓库位置" HeaderTextAlign="Center" TextAlign="Left" SortField="StorePosition" ExpandUnusedSpace="true"> + @@ -82,6 +83,7 @@ + @@ -136,6 +138,7 @@ var txtUnitStoreCodeClientID = '<%= txtUnitStoreCode.ClientID %>'; var txtUnitStoreNameClientID = '<%= txtUnitStoreName.ClientID %>'; var txtStorePositionClientID = '<%= txtStorePosition.ClientID %>'; + var cbIsUsedClientID = '<%= cbIsUsed.ClientID %>'; function onGridRowSelect(event, rowId) { var grid = F(gridClientID); @@ -152,6 +155,7 @@ F(txtUnitStoreCodeClientID).setValue(rowValue['UnitStoreCode']); F(txtUnitStoreNameClientID).setValue(rowValue['UnitStoreName']); F(txtStorePositionClientID).setValue(rowValue['tStorePosition']); + F(cbIsUsedClientID).setValue(rowValue['IsUsed']); // 更新提交按钮文本 F(btnSaveClientID).setText('提交数据(编辑)'); diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx.cs b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx.cs index 813f568..153b9f7 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx.cs @@ -51,7 +51,7 @@ namespace FineUIPro.Web.WeldMat.BaseInfo /// private void BindGrid() { - string strSql = @"SELECT s.UnitStoreId,s.UnitId,s.UnitStoreCode,s.UnitStoreName,s.StorePosition ,u.UnitName + string strSql = @"SELECT s.UnitStoreId,s.UnitId,s.UnitStoreCode,s.UnitStoreName,s.StorePosition ,u.UnitName,s.IsUsed FROM dbo.Weld_UnitStore s LEFT JOIN dbo.Base_Unit u ON u.UnitId = s.UnitId WHERE 1=1"; @@ -235,7 +235,10 @@ namespace FineUIPro.Web.WeldMat.BaseInfo this.txtUnitStoreCode.Text = unitStore.UnitStoreCode; this.txtUnitStoreName.Text = unitStore.UnitStoreName; txtStorePosition.Text = unitStore.StorePosition; - + if (unitStore.IsUsed == true) + { + this.cbIsUsed.Checked = true; + } hfFormID.Text = Id; this.btnDelete.Enabled = true; } @@ -269,6 +272,7 @@ namespace FineUIPro.Web.WeldMat.BaseInfo store.UnitStoreCode = this.txtUnitStoreCode.Text.Trim(); store.UnitStoreName = this.txtUnitStoreName.Text.Trim(); store.StorePosition = txtStorePosition.Text.Trim(); + store.IsUsed = this.cbIsUsed.Checked; if (string.IsNullOrEmpty(strRowID)) { var stores = BLL.UnitStoreService.GetUnitStoreByUnitId(drpUnitId.SelectedValue); diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx.designer.cs index 7ec49ec..44532bb 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/UnitStore.aspx.designer.cs @@ -147,6 +147,15 @@ namespace FineUIPro.Web.WeldMat.BaseInfo { /// protected global::FineUIPro.TextBox txtStorePosition; + /// + /// cbIsUsed 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox cbIsUsed; + /// /// Toolbar1 控件。 /// diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx index 35813ae..aa5ff29 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx +++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx @@ -94,9 +94,7 @@ - - + @@ -131,6 +129,9 @@ <%-- --%> + + _IsUsed; + private EntitySet _HJGL_BakeRecordsProject; private EntitySet _HJGL_TemperatureAndHumidity; @@ -111681,6 +111683,8 @@ namespace Model partial void OnUnitStoreNameChanged(); partial void OnStorePositionChanging(string value); partial void OnStorePositionChanged(); + partial void OnIsUsedChanging(System.Nullable value); + partial void OnIsUsedChanged(); #endregion public Weld_UnitStore() @@ -111797,6 +111801,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUsed", DbType="Bit")] + public System.Nullable IsUsed + { + get + { + return this._IsUsed; + } + set + { + if ((this._IsUsed != value)) + { + this.OnIsUsedChanging(value); + this.SendPropertyChanging(); + this._IsUsed = value; + this.SendPropertyChanged("IsUsed"); + this.OnIsUsedChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_BakeRecordsProject_Weld_UnitStore", Storage="_HJGL_BakeRecordsProject", ThisKey="UnitStoreId", OtherKey="UnitStoreId", DeleteRule="NO ACTION")] public EntitySet HJGL_BakeRecordsProject {