This commit is contained in:
高飞 2025-09-15 10:59:51 +08:00
parent 62654a7aea
commit a1b669a75a
7 changed files with 58 additions and 9 deletions

View File

@ -0,0 +1,4 @@
alter table Weld_UnitStore add IsUsed bit null
GO
update Weld_UnitStore set IsUsed=1
GO

View File

@ -5,7 +5,7 @@ using System.Text;
namespace BLL
{
public static class UnitStoreService
public static class UnitStoreService
{
/// <summary>
/// 根据主键获取单位仓库
@ -19,7 +19,7 @@ namespace BLL
public static List<Model.Weld_UnitStore> 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();
}
/// <summary>
@ -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)

View File

@ -34,7 +34,7 @@
<f:RenderField Width="180px" ColumnID="UnitName" DataField="UnitName" FieldType="String"
HeaderText="所属单位" HeaderTextAlign="Center" TextAlign="Left" SortField="UnitName">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="UnitStoreCode" DataField="UnitStoreCode"
<f:RenderField Width="80px" ColumnID="UnitStoreCode" DataField="UnitStoreCode"
FieldType="String" HeaderText="仓库编码" HeaderTextAlign="Center" TextAlign="Left"
SortField="UnitStoreCode">
</f:RenderField>
@ -46,6 +46,7 @@
HeaderText="仓库位置" HeaderTextAlign="Center" TextAlign="Left" SortField="StorePosition"
ExpandUnusedSpace="true">
</f:RenderField>
<f:CheckBoxField Width="80px" RenderAsStaticField="true" TextAlign="Center" DataField="IsUsed" HeaderText="是否在用" />
</Columns>
<Listeners>
<f:Listener Event="rowselect" Handler="onGridRowSelect" />
@ -82,6 +83,7 @@
<f:TextBox ID="txtStorePosition" Label="仓库位置" runat="server"
LabelAlign="right" MaxLength="50">
</f:TextBox>
<f:CheckBox runat="server" ID="cbIsUsed" Label="是否在用" LabelAlign="right"></f:CheckBox>
</Items>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
@ -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('提交数据(编辑)');

View File

@ -51,7 +51,7 @@ namespace FineUIPro.Web.WeldMat.BaseInfo
/// </summary>
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);

View File

@ -147,6 +147,15 @@ namespace FineUIPro.Web.WeldMat.BaseInfo {
/// </remarks>
protected global::FineUIPro.TextBox txtStorePosition;
/// <summary>
/// cbIsUsed 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox cbIsUsed;
/// <summary>
/// Toolbar1 控件。
/// </summary>

View File

@ -94,9 +94,7 @@
<f:RenderField Width="80px" ColumnID="WeldSpec" DataField="WeldSpec" FieldType="String"
HeaderText="规格" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="UnitStoreName" DataField="UnitStoreName" FieldType="String"
HeaderText="焊材库" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="STE_Name" DataField="STE_Name" FieldType="String"
HeaderText="焊件材质" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
@ -131,6 +129,9 @@
<%--<f:RenderField Width="100px" ColumnID="UnitStoreName" DataField="UnitStoreName" FieldType="String"
HeaderText="领用仓库" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField> --%>
<f:RenderField Width="120px" ColumnID="UnitStoreName" DataField="UnitStoreName" FieldType="String"
HeaderText="焊材库" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:LinkButtonField ID="lbtnUrl" HeaderText="签名" Icon="ApplicationEdit" Width="80px" CommandName="url" ColumnID="Url"
HeaderTextAlign="Center" TextAlign="Center" ToolTip="显示签名" />
<f:LinkButtonField ID="lbtnPrint" HeaderText="打印" Icon="Printer" Width="80px" CommandName="print"

View File

@ -111657,6 +111657,8 @@ namespace Model
private string _StorePosition;
private System.Nullable<bool> _IsUsed;
private EntitySet<HJGL_BakeRecordsProject> _HJGL_BakeRecordsProject;
private EntitySet<HJGL_TemperatureAndHumidity> _HJGL_TemperatureAndHumidity;
@ -111681,6 +111683,8 @@ namespace Model
partial void OnUnitStoreNameChanged();
partial void OnStorePositionChanging(string value);
partial void OnStorePositionChanged();
partial void OnIsUsedChanging(System.Nullable<bool> 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<bool> 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> HJGL_BakeRecordsProject
{