diff --git a/DataBase/版本日志/SGGLDB_V2025-12-08-xiaj(事故警示).sql b/DataBase/版本日志/SGGLDB_V2025-12-08-xiaj(事故警示).sql index a2f8a86..33f6bbb 100644 --- a/DataBase/版本日志/SGGLDB_V2025-12-08-xiaj(事故警示).sql +++ b/DataBase/版本日志/SGGLDB_V2025-12-08-xiaj(事故警示).sql @@ -18,6 +18,7 @@ END GO +drop table Accident_Warning --¹ʾʾ IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Accident_Warning') AND type = N'U') BEGIN @@ -26,7 +27,9 @@ CREATE TABLE [dbo].[Accident_Warning]( [Code] [nvarchar](50) NOT NULL, [Title] [nvarchar](100) NOT NULL, [Content] [nvarchar](2000) NOT NULL, - [Address] [nvarchar](50) NOT NULL, + [Type] [nvarchar](50) NOT NULL, + [Address] [nvarchar](50) NULL, + [Source] [nvarchar](50) NULL, [ResponsibleUnit] [nvarchar](200) NULL, [AccidentDate] datetime NOT NULL, [AccidentMonthDay] [nvarchar](50) NOT NULL, @@ -43,7 +46,9 @@ EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¹ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Accident_Warning', @level2type=N'COLUMN',@level2name=N'Code' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Accident_Warning', @level2type=N'COLUMN',@level2name=N'Title' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Accident_Warning', @level2type=N'COLUMN',@level2name=N'Content' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Accident_Warning', @level2type=N'COLUMN',@level2name=N'Type' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ص' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Accident_Warning', @level2type=N'COLUMN',@level2name=N'Address' +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Դ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Accident_Warning', @level2type=N'COLUMN',@level2name=N'Source' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ελ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Accident_Warning', @level2type=N'COLUMN',@level2name=N'ResponsibleUnit' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Accident_Warning', @level2type=N'COLUMN',@level2name=N'AccidentDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'¹' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Accident_Warning', @level2type=N'COLUMN',@level2name=N'AccidentMonthDay' diff --git a/SGGL/BLL/Accident/AccidentWarningService.cs b/SGGL/BLL/Accident/AccidentWarningService.cs index 39c64b3..8022f90 100644 --- a/SGGL/BLL/Accident/AccidentWarningService.cs +++ b/SGGL/BLL/Accident/AccidentWarningService.cs @@ -46,7 +46,9 @@ namespace BLL Code = model.Code, Title = model.Title, Content = model.Content, + Type = model.Type, Address = model.Address, + Source = model.Source, ResponsibleUnit = model.ResponsibleUnit, AccidentDate = model.AccidentDate, AccidentMonthDay = model.AccidentMonthDay, @@ -71,7 +73,9 @@ namespace BLL { newModel.Title = model.Title; newModel.Content = model.Content; + newModel.Type = model.Type; newModel.Address = model.Address; + newModel.Source = model.Source; newModel.ResponsibleUnit = model.ResponsibleUnit; newModel.AccidentDate = model.AccidentDate; newModel.AccidentMonthDay = model.AccidentMonthDay; diff --git a/SGGL/FineUIPro.Web/Accident/AccidentWarning.aspx b/SGGL/FineUIPro.Web/Accident/AccidentWarning.aspx index 5c85276..8ac654b 100644 --- a/SGGL/FineUIPro.Web/Accident/AccidentWarning.aspx +++ b/SGGL/FineUIPro.Web/Accident/AccidentWarning.aspx @@ -21,8 +21,8 @@ - + @@ -55,15 +55,19 @@ SortField="Code" FieldType="String" HeaderText="编号" HeaderTextAlign="Center" TextAlign="Left"> - + + - @@ -71,6 +75,10 @@ FieldType="String" HeaderText="责任单位" HeaderTextAlign="Center" TextAlign="Left"> + + diff --git a/SGGL/FineUIPro.Web/Accident/AccidentWarning.aspx.cs b/SGGL/FineUIPro.Web/Accident/AccidentWarning.aspx.cs index 466c930..65b7294 100644 --- a/SGGL/FineUIPro.Web/Accident/AccidentWarning.aspx.cs +++ b/SGGL/FineUIPro.Web/Accident/AccidentWarning.aspx.cs @@ -64,9 +64,14 @@ namespace FineUIPro.Web.Accident List listStr = new List(); if (!string.IsNullOrEmpty(this.txtSearch.Text.Trim())) { - sb.Append("and (Code like @txtSearch or Title like @txtSearch or Address like @txtSearch ) "); + sb.Append("and (Code like @txtSearch or Title like @txtSearch or Type like @txtSearch or Address like @txtSearch or Source like @txtSearch ) "); listStr.Add(new SqlParameter("@txtSearch", "%" + this.txtSearch.Text.Trim() + "%")); } + //if (!string.IsNullOrEmpty(this.txtType.Text.Trim())) + //{ + // sb.Append("and (Type like @txtType ) "); + // listStr.Add(new SqlParameter("@txtType", "%" + this.txtType.Text.Trim() + "%")); + //} if (!string.IsNullOrEmpty(this.txtAccidentDateStart.Text.Trim())) { sb.Append("and AccidentDate >= @AccidentDateStart "); diff --git a/SGGL/FineUIPro.Web/Accident/AccidentWarningDataIn.aspx.cs b/SGGL/FineUIPro.Web/Accident/AccidentWarningDataIn.aspx.cs index 188221e..2f96b31 100644 --- a/SGGL/FineUIPro.Web/Accident/AccidentWarningDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Accident/AccidentWarningDataIn.aspx.cs @@ -177,27 +177,32 @@ namespace FineUIPro.Web.Accident string row1 = pds.Rows[i][1].ToString(); if (string.IsNullOrEmpty(row1)) { - errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "事故地点", Reason = "此项为必填项!" }); + errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "事故类型", Reason = "此项为必填项!" }); } string row2 = pds.Rows[i][2].ToString(); - if (!string.IsNullOrEmpty(row2)) + if (string.IsNullOrEmpty(row2)) + { + errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "事故地点", Reason = "此项为必填项!" }); + } + string row3 = pds.Rows[i][3].ToString(); + if (!string.IsNullOrEmpty(row3)) { try { - DateTime date = Convert.ToDateTime(row2.Trim()); + DateTime date = Convert.ToDateTime(row3.Trim()); } catch (Exception) { - errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "事故日期", Reason = $"[{row2}]错误!" }); + errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "事故日期", Reason = $"[{row3}]错误!" }); } } else { errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "事故日期", Reason = "此项为必填项!" }); } - if (!string.IsNullOrWhiteSpace(row0) && !string.IsNullOrWhiteSpace(row1) && !string.IsNullOrWhiteSpace(row2)) + if (!string.IsNullOrWhiteSpace(row0) && !string.IsNullOrWhiteSpace(row1) && !string.IsNullOrWhiteSpace(row2) && !string.IsNullOrWhiteSpace(row3)) { - var acc = oldViewInfos.Where(x => x.Title == row0 && x.Address == row1 && x.AccidentDate == Convert.ToDateTime(row2.Trim())); + var acc = oldViewInfos.Where(x => x.Title == row0 && x.Address == row1 && x.Type == row2 && x.AccidentDate == Convert.ToDateTime(row2.Trim())); if (acc.Any()) { errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "事故标题", Reason = "此项事故已存在!" }); @@ -322,13 +327,15 @@ namespace FineUIPro.Web.Accident model.Id = SQLHelper.GetNewID(typeof(Model.Accident_Warning)); model.Code = BLL.SQLHelper.RunProcNewId("SpGetNewCode5", "Accident_Warning", "Code", $"SG-"); model.Title = pds.Rows[i][0].ToString().Trim(); - model.Address = pds.Rows[i][1].ToString().Trim(); - DateTime accDate = Convert.ToDateTime(pds.Rows[i][2].ToString().Trim()); + model.Type = pds.Rows[i][1].ToString().Trim(); + model.Address = pds.Rows[i][2].ToString().Trim(); + DateTime accDate = Convert.ToDateTime(pds.Rows[i][3].ToString().Trim()); model.AccidentDate = accDate; model.AccidentMonthDay = accDate.ToString("MM-dd"); - model.ResponsibleUnit = pds.Rows[i][3].ToString().Trim(); - model.Content = pds.Rows[i][4].ToString().Trim(); - model.Remarks = pds.Rows[i][5].ToString().Trim(); + model.ResponsibleUnit = pds.Rows[i][4].ToString().Trim(); + model.Content = pds.Rows[i][5].ToString().Trim(); + model.Source = pds.Rows[i][6].ToString().Trim(); + model.Remarks = pds.Rows[i][7].ToString().Trim(); model.CompileMan = this.CurrUser.UserId; model.CompileManName = this.CurrUser.UserName; model.CreateTime = DateTime.Now; diff --git a/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx b/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx index 8c55580..ed762b1 100644 --- a/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx +++ b/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx @@ -28,14 +28,20 @@ - + - + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx.cs b/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx.cs index d7a752d..2ac7109 100644 --- a/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx.cs @@ -92,7 +92,9 @@ namespace FineUIPro.Web.Accident model.Code = this.txtCode.Text.Trim(); model.Title = this.txtTitle.Text.Trim(); model.Content = this.txtContent.Text.Trim(); + model.Type = this.txtType.Text.Trim(); model.Address = this.txtAddress.Text.Trim(); + model.Source = this.txtSource.Text.Trim(); model.ResponsibleUnit = this.txtResponsibleUnit.Text.Trim(); model.Remarks = this.txtRemarks.Text.Trim(); model.AccidentDate = Funs.GetNewDateTimeOrNow(this.txtAccidentDate.Text.Trim()); diff --git a/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx.designer.cs index 844f60c..19018fb 100644 --- a/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Accident/AccidentWarningEdit.aspx.designer.cs @@ -60,13 +60,13 @@ namespace FineUIPro.Web.Accident protected global::FineUIPro.TextBox txtTitle; /// - /// txtAddress 控件。 + /// txtType 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextBox txtAddress; + protected global::FineUIPro.TextBox txtType; /// /// txtAccidentDate 控件。 @@ -77,6 +77,24 @@ namespace FineUIPro.Web.Accident /// protected global::FineUIPro.DatePicker txtAccidentDate; + /// + /// txtAddress 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAddress; + + /// + /// txtSource 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSource; + /// /// txtResponsibleUnit 控件。 /// diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/事故警示导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/事故警示导入模板.xls index 2b9c647..29916ea 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/事故警示导入模板.xls and b/SGGL/FineUIPro.Web/File/Excel/DataIn/事故警示导入模板.xls differ diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 1918f88..5573bc2 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -15205,8 +15205,12 @@ namespace Model private string _Content; + private string _Type; + private string _Address; + private string _Source; + private string _ResponsibleUnit; private System.DateTime _AccidentDate; @@ -15233,8 +15237,12 @@ namespace Model partial void OnTitleChanged(); partial void OnContentChanging(string value); partial void OnContentChanged(); + partial void OnTypeChanging(string value); + partial void OnTypeChanged(); partial void OnAddressChanging(string value); partial void OnAddressChanged(); + partial void OnSourceChanging(string value); + partial void OnSourceChanged(); partial void OnResponsibleUnitChanging(string value); partial void OnResponsibleUnitChanged(); partial void OnAccidentDateChanging(System.DateTime value); @@ -15336,7 +15344,27 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Type", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string Type + { + get + { + return this._Type; + } + set + { + if ((this._Type != value)) + { + this.OnTypeChanging(value); + this.SendPropertyChanging(); + this._Type = value; + this.SendPropertyChanged("Type"); + this.OnTypeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(50)")] public string Address { get @@ -15356,6 +15384,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Source", DbType="NVarChar(50)")] + public string Source + { + get + { + return this._Source; + } + set + { + if ((this._Source != value)) + { + this.OnSourceChanging(value); + this.SendPropertyChanging(); + this._Source = value; + this.SendPropertyChanged("Source"); + this.OnSourceChanged(); + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResponsibleUnit", DbType="NVarChar(200)")] public string ResponsibleUnit {