diff --git a/DataBase/版本日志/SGGLDB_WH_2024-01-26-gaofei.sql b/DataBase/版本日志/SGGLDB_WH_2024-01-26-gaofei.sql index 8bb9d8be..cadd0a7f 100644 --- a/DataBase/版本日志/SGGLDB_WH_2024-01-26-gaofei.sql +++ b/DataBase/版本日志/SGGLDB_WH_2024-01-26-gaofei.sql @@ -53,6 +53,52 @@ GO +CREATE TABLE [dbo].[Transfer_StaticEquipment]( + [Id] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [StaticEquipment] [nvarchar](50) NULL, + [SYSTEM] [nvarchar](50) NULL, + [Subsystem] [nvarchar](50) NULL, + [TestPackage] [nvarchar](50) NULL, + [TestPackageSTART] [datetime] NULL, + [TestPackageFINISH] [datetime] NULL, + [MechanicalFINALStatus] [nvarchar](50) NULL, + CONSTRAINT [PK_Transfer_StaticEquipment] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'StaticEquipment' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Transfer_StaticEquipment' +GO + + + +CREATE TABLE [dbo].[Transfer_RotatingEquipment]( + [Id] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [RotatingEquipment] [nvarchar](50) NULL, + [SYSTEM] [nvarchar](50) NULL, + [Subsystem] [nvarchar](50) NULL, + [TestPackage] [nvarchar](50) NULL, + [TestPackageSTART] [datetime] NULL, + [TestPackageFINISH] [datetime] NULL, + [MechanicalFINALStatus] [nvarchar](50) NULL, + CONSTRAINT [PK_Transfer_RotatingEquipment] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'RotatingEquipment' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Transfer_RotatingEquipment' +GO + + + CREATE TABLE [dbo].[Transfer_Instrumentation]( diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 541c99ef..3a175126 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -769,6 +769,8 @@ + + diff --git a/SGGL/BLL/Transfer/RotatingEquipmentService.cs b/SGGL/BLL/Transfer/RotatingEquipmentService.cs new file mode 100644 index 00000000..b20f390b --- /dev/null +++ b/SGGL/BLL/Transfer/RotatingEquipmentService.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class RotatingEquipmentService + { + /// + /// 根据主键获取设备材料报验信息 + /// + /// + /// + public static Model.Transfer_RotatingEquipment GetRotatingEquipmentById(string Id) + { + return Funs.DB.Transfer_RotatingEquipment.FirstOrDefault(e => e.Id == Id); + } + + /// + /// 添加设备材料报验 + /// + /// + public static void AddRotatingEquipment(Model.Transfer_RotatingEquipment RotatingEquipment) + { + Model.SGGLDB db = Funs.DB; + Model.Transfer_RotatingEquipment newRotatingEquipment = new Model.Transfer_RotatingEquipment(); + newRotatingEquipment.Id = RotatingEquipment.Id; + newRotatingEquipment.ProjectId = RotatingEquipment.ProjectId; + newRotatingEquipment.RotatingEquipment = RotatingEquipment.RotatingEquipment; + newRotatingEquipment.SYSTEM = RotatingEquipment.SYSTEM; + newRotatingEquipment.Subsystem = RotatingEquipment.Subsystem; + newRotatingEquipment.TestPackage = RotatingEquipment.TestPackage; + newRotatingEquipment.TestPackageSTART = RotatingEquipment.TestPackageSTART; + newRotatingEquipment.TestPackageFINISH = RotatingEquipment.TestPackageFINISH; + newRotatingEquipment.MechanicalFINALStatus = RotatingEquipment.MechanicalFINALStatus; + db.Transfer_RotatingEquipment.InsertOnSubmit(newRotatingEquipment); + db.SubmitChanges(); + } + + /// + /// 修改设备材料报验 + /// + /// + public static void UpdateRotatingEquipment(Model.Transfer_RotatingEquipment RotatingEquipment) + { + Model.SGGLDB db = Funs.DB; + Model.Transfer_RotatingEquipment newRotatingEquipment = db.Transfer_RotatingEquipment.FirstOrDefault(e => e.Id == RotatingEquipment.Id); + if (newRotatingEquipment != null) + { + newRotatingEquipment.ProjectId = RotatingEquipment.ProjectId; + newRotatingEquipment.RotatingEquipment = RotatingEquipment.RotatingEquipment; + newRotatingEquipment.SYSTEM = RotatingEquipment.SYSTEM; + newRotatingEquipment.Subsystem = RotatingEquipment.Subsystem; + newRotatingEquipment.TestPackage = RotatingEquipment.TestPackage; + newRotatingEquipment.TestPackageSTART = RotatingEquipment.TestPackageSTART; + newRotatingEquipment.TestPackageFINISH = RotatingEquipment.TestPackageFINISH; + newRotatingEquipment.MechanicalFINALStatus = RotatingEquipment.MechanicalFINALStatus; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除设备材料报验 + /// + /// + public static void DeleteRotatingEquipment(string Id) + { + Model.SGGLDB db = Funs.DB; + Model.Transfer_RotatingEquipment RotatingEquipment = db.Transfer_RotatingEquipment.FirstOrDefault(e => e.Id == Id); + if (RotatingEquipment != null) + { + db.Transfer_RotatingEquipment.DeleteOnSubmit(RotatingEquipment); + db.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/Transfer/StaticEquipmentService.cs b/SGGL/BLL/Transfer/StaticEquipmentService.cs new file mode 100644 index 00000000..bdeed534 --- /dev/null +++ b/SGGL/BLL/Transfer/StaticEquipmentService.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class StaticEquipmentService + { + /// + /// 根据主键获取设备材料报验信息 + /// + /// + /// + public static Model.Transfer_StaticEquipment GetStaticEquipmentById(string Id) + { + return Funs.DB.Transfer_StaticEquipment.FirstOrDefault(e => e.Id == Id); + } + + /// + /// 添加设备材料报验 + /// + /// + public static void AddStaticEquipment(Model.Transfer_StaticEquipment StaticEquipment) + { + Model.SGGLDB db = Funs.DB; + Model.Transfer_StaticEquipment newStaticEquipment = new Model.Transfer_StaticEquipment(); + newStaticEquipment.Id = StaticEquipment.Id; + newStaticEquipment.ProjectId = StaticEquipment.ProjectId; + newStaticEquipment.StaticEquipment = StaticEquipment.StaticEquipment; + newStaticEquipment.SYSTEM = StaticEquipment.SYSTEM; + newStaticEquipment.Subsystem = StaticEquipment.Subsystem; + newStaticEquipment.TestPackage = StaticEquipment.TestPackage; + newStaticEquipment.TestPackageSTART = StaticEquipment.TestPackageSTART; + newStaticEquipment.TestPackageFINISH = StaticEquipment.TestPackageFINISH; + newStaticEquipment.MechanicalFINALStatus = StaticEquipment.MechanicalFINALStatus; + db.Transfer_StaticEquipment.InsertOnSubmit(newStaticEquipment); + db.SubmitChanges(); + } + + /// + /// 修改设备材料报验 + /// + /// + public static void UpdateStaticEquipment(Model.Transfer_StaticEquipment StaticEquipment) + { + Model.SGGLDB db = Funs.DB; + Model.Transfer_StaticEquipment newStaticEquipment = db.Transfer_StaticEquipment.FirstOrDefault(e => e.Id == StaticEquipment.Id); + if (newStaticEquipment != null) + { + newStaticEquipment.ProjectId = StaticEquipment.ProjectId; + newStaticEquipment.StaticEquipment = StaticEquipment.StaticEquipment; + newStaticEquipment.SYSTEM = StaticEquipment.SYSTEM; + newStaticEquipment.Subsystem = StaticEquipment.Subsystem; + newStaticEquipment.TestPackage = StaticEquipment.TestPackage; + newStaticEquipment.TestPackageSTART = StaticEquipment.TestPackageSTART; + newStaticEquipment.TestPackageFINISH = StaticEquipment.TestPackageFINISH; + newStaticEquipment.MechanicalFINALStatus = StaticEquipment.MechanicalFINALStatus; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除设备材料报验 + /// + /// + public static void DeleteStaticEquipment(string Id) + { + Model.SGGLDB db = Funs.DB; + Model.Transfer_StaticEquipment StaticEquipment = db.Transfer_StaticEquipment.FirstOrDefault(e => e.Id == Id); + if (StaticEquipment != null) + { + db.Transfer_StaticEquipment.DeleteOnSubmit(StaticEquipment); + db.SubmitChanges(); + } + } + } +} diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/Piping导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/Piping导入模板.xls new file mode 100644 index 00000000..26f8263c Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/Piping导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/RotatingEquipment导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/RotatingEquipment导入模板.xls new file mode 100644 index 00000000..25111830 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/RotatingEquipment导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/StaticEquipment导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/StaticEquipment导入模板.xls new file mode 100644 index 00000000..640e8001 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/StaticEquipment导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index d94d6880..d96dbe04 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1835,8 +1835,13 @@ + + + + + @@ -16372,6 +16377,13 @@ Piping.aspx + + PipingDataIn.aspx + ASPXCodeBehind + + + PipingDataIn.aspx + ProjectSetup.aspx ASPXCodeBehind @@ -16386,6 +16398,34 @@ ProjectSetupDataIn.aspx + + RotatingEquipment.aspx + ASPXCodeBehind + + + RotatingEquipment.aspx + + + RotatingEquipmentDataIn.aspx + ASPXCodeBehind + + + RotatingEquipmentDataIn.aspx + + + StaticEquipment.aspx + ASPXCodeBehind + + + StaticEquipment.aspx + + + StaticEquipmentDataIn.aspx + ASPXCodeBehind + + + StaticEquipmentDataIn.aspx + Video.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user index c78536b4..5c318055 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU true false diff --git a/SGGL/FineUIPro.Web/Transfer/Piping.aspx b/SGGL/FineUIPro.Web/Transfer/Piping.aspx index f80d2b82..e0049131 100644 --- a/SGGL/FineUIPro.Web/Transfer/Piping.aspx +++ b/SGGL/FineUIPro.Web/Transfer/Piping.aspx @@ -16,12 +16,24 @@ + + + + + + + + + + + @@ -38,43 +50,47 @@ + HeaderTextAlign="Center" Width="170px"> + HeaderTextAlign="Center" Width="120px"> + HeaderTextAlign="Center" Width="120px"> + HeaderTextAlign="Center" Width="120px"> - + - - - + + HeaderTextAlign="Center" Width="130px"> + HeaderTextAlign="Center" Width="170px"> + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/Piping.aspx.cs b/SGGL/FineUIPro.Web/Transfer/Piping.aspx.cs index 09da90ac..dc32495c 100644 --- a/SGGL/FineUIPro.Web/Transfer/Piping.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/Piping.aspx.cs @@ -30,10 +30,25 @@ namespace FineUIPro.Web.Transfer /// public void BindGrid() { - string strSql = @"select * from Transfer_ProjectSetup C + string strSql = @"select * from Transfer_Piping C where C.ProjectId = @ProjectId"; List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + if (!string.IsNullOrEmpty(this.txtPIPINGLINENUMBER.Text.Trim())) + { + strSql += " AND PIPINGLINENUMBER like @PIPINGLINENUMBER"; + listStr.Add(new SqlParameter("@PIPINGLINENUMBER", "%" + this.txtPIPINGLINENUMBER.Text.Trim() + "%")); + } + if (!string.IsNullOrEmpty(txtStarTime.Text.Trim())) + { + strSql += " AND TestPackageSTART >= @InspectionDateA"; + listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim()))); + } + if (!string.IsNullOrEmpty(txtEndTime.Text.Trim())) + { + strSql += " AND TestPackageSTART <= @InspectionDateZ"; + listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim()))); + } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.RecordCount = tb.Rows.Count; @@ -154,10 +169,10 @@ namespace FineUIPro.Web.Transfer foreach (int rowIndex in Grid1.SelectedRowIndexArray) { string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - var data = BLL.ProjectSetupService.GetProjectSetupById(rowID); + var data = BLL.PipingService.GetPipingById(rowID); if (data != null) { - BLL.ProjectSetupService.DeleteProjectSetup(rowID); + BLL.PipingService.DeletePiping(rowID); } } BindGrid(); @@ -174,7 +189,7 @@ namespace FineUIPro.Web.Transfer /// protected void btnImport_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("ProjectSetupDataIn.aspx", "导入 - "))); + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("PipingDataIn.aspx", "导入 - "))); } #endregion @@ -190,7 +205,7 @@ namespace FineUIPro.Web.Transfer { return; } - var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectSetupMenuId); + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.PipingMenuId); if (buttonList.Count() > 0) { if (buttonList.Contains(BLL.Const.BtnDelete)) diff --git a/SGGL/FineUIPro.Web/Transfer/Piping.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/Piping.aspx.designer.cs index d7ce9219..9ddaec3f 100644 --- a/SGGL/FineUIPro.Web/Transfer/Piping.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/Piping.aspx.designer.cs @@ -57,6 +57,51 @@ namespace FineUIPro.Web.Transfer { /// protected global::FineUIPro.Toolbar ToolSearch; + /// + /// txtPIPINGLINENUMBER 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPIPINGLINENUMBER; + + /// + /// txtStarTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStarTime; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// txtEndTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndTime; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + /// /// btnImport 控件。 /// @@ -111,6 +156,15 @@ namespace FineUIPro.Web.Transfer { /// protected global::FineUIPro.GroupField g4; + /// + /// g5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupField g5; + /// /// ToolbarText1 控件。 /// diff --git a/SGGL/FineUIPro.Web/Transfer/PipingDataIn.aspx b/SGGL/FineUIPro.Web/Transfer/PipingDataIn.aspx new file mode 100644 index 00000000..0fb8ea7f --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/PipingDataIn.aspx @@ -0,0 +1,68 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PipingDataIn.aspx.cs" Inherits="FineUIPro.Web.Transfer.PipingDataIn" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/PipingDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/PipingDataIn.aspx.cs new file mode 100644 index 00000000..6288b651 --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/PipingDataIn.aspx.cs @@ -0,0 +1,421 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.OleDb; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.Transfer +{ + public partial class PipingDataIn : PageBase + { + #region 定义变量 + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + + /// + /// 错误集合 + /// + public static List errorInfos = new List(); + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.hdCheckResult.Text = string.Empty; + this.hdFileName.Text = string.Empty; + if (errorInfos != null) + { + errorInfos.Clear(); + } + } + } + #endregion + + #region 审核 + /// + /// 审核 + /// + /// + /// + protected void btnAudit_Click(object sender, EventArgs e) + { + try + { + if (this.fuAttachUrl.HasFile == false) + { + ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls") + { + ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning); + return; + } + if (errorInfos != null) + { + errorInfos.Clear(); + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls; + string filePath = initFullPath + this.hdFileName.Text; + this.fuAttachUrl.PostedFile.SaveAs(filePath); + ImportXlsToData(rootPath + initPath + this.hdFileName.Text); + } + catch (Exception ex) + { + ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL(ds.Tables[0], 9); + hdCheckResult.Text = "1"; + } + catch (Exception exc) + { + Response.Write(exc); + //return null; + // return dt; + } + finally + { + } + } + #endregion + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集行数 + /// + private bool AddDatasetToSQL(DataTable pds, int Cols) + { + string result = string.Empty; + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + return false; + } + + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + for (int i = 1; i < ir; i++) + { + string row4 = pds.Rows[i][4].ToString(); + if (!string.IsNullOrEmpty(row4)) + { + try + { + DateTime date = Convert.ToDateTime(row4.Trim()); + } + catch (Exception) + { + result += (i + 3).ToString() + "," + "Test Package START" + "," + "[" + row4 + "]错误!不是日期格式!" + "|"; + } + } + string row5 = pds.Rows[i][5].ToString(); + if (!string.IsNullOrEmpty(row4)) + { + try + { + DateTime date = Convert.ToDateTime(row5.Trim()); + } + catch (Exception) + { + result += (i + 3).ToString() + "," + "Test Package FINISH" + "," + "[" + row5 + "]错误!不是日期格式!" + "|"; + } + } + } + if (!string.IsNullOrEmpty(result)) + { + result = result.Substring(0, result.LastIndexOf("|")); + } + errorInfos.Clear(); + if (!string.IsNullOrEmpty(result)) + { + string results = result; + List errorInfoList = results.Split('|').ToList(); + foreach (var item in errorInfoList) + { + string[] errors = item.Split(','); + Model.ErrorInfo errorInfo = new Model.ErrorInfo(); + errorInfo.Row = errors[0]; + errorInfo.Column = errors[1]; + errorInfo.Reason = errors[2]; + errorInfos.Add(errorInfo); + } + if (errorInfos.Count > 0) + { + this.gvErrorInfo.DataSource = errorInfos; + this.gvErrorInfo.DataBind(); + } + } + else + { + ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success); + } + } + + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 导入 + /// + /// 导入 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(hdCheckResult.Text)) + { + if (errorInfos.Count <= 0) + { + string rootPath = Server.MapPath("~/"); + ImportXlsToData2(rootPath + initPath + this.hdFileName.Text); + hdCheckResult.Text = string.Empty; + ShowNotify("导入成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning); + } + } + + #region Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData2(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL2(ds.Tables[0], 9); + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集列数 + /// + private bool AddDatasetToSQL2(DataTable pds, int Cols) + { + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + } + string result = string.Empty; + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + List list = new List(); + for (int i = 1; i < ir; i++) + { + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_Piping.FirstOrDefault(x => x.PIPINGLINENUMBER == pds.Rows[i][0].ToString().Trim() + && x.ProjectId == CurrUser.LoginProjectId); + if (modelOnly == null) + { + Model.Transfer_Piping model = new Model.Transfer_Piping(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.PIPINGLINENUMBER = pds.Rows[i][0].ToString().Trim(); + model.SYSTEM = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.TestPackage = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.TestPackageSTART = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.TestPackageFINISH = t2; + + model.FINALStatus = pds.Rows[i][6].ToString().Trim(); + model.PreTestFINISHED = pds.Rows[i][7].ToString().Trim(); + model.FinalTestFINISHED = pds.Rows[i][8].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.PIPINGLINENUMBER = pds.Rows[i][0].ToString().Trim(); + modelOnly.SYSTEM = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.TestPackage = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.TestPackageSTART = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.TestPackageFINISH = t2; + modelOnly.FINALStatus = pds.Rows[i][6].ToString().Trim(); + modelOnly.PreTestFINISHED = pds.Rows[i][7].ToString().Trim(); + modelOnly.FinalTestFINISHED = pds.Rows[i][8].ToString().Trim(); + Funs.DB.SubmitChanges(); + } + } + if (list.Count > 0) + { + Funs.DB.Transfer_Piping.InsertAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + } + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 下载模板 + /// + /// 下载模板按钮 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + "File\\Excel\\DataIn\\Piping导入模板.xls"; + string filePath = "File\\Excel\\DataIn\\Piping导入模板.xls"; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Transfer/PipingDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/PipingDataIn.aspx.designer.cs new file mode 100644 index 00000000..fdc5b39c --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/PipingDataIn.aspx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.Transfer { + + + public partial class PipingDataIn { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdFileName; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + + /// + /// hdCheckResult 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdCheckResult; + + /// + /// fuAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fuAttachUrl; + + /// + /// gvErrorInfo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvErrorInfo; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + } +} diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx b/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx new file mode 100644 index 00000000..e37b9a0e --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx @@ -0,0 +1,135 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RotatingEquipment.aspx.cs" Inherits="FineUIPro.Web.Transfer.RotatingEquipment" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx.cs b/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx.cs new file mode 100644 index 00000000..806cdd01 --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx.cs @@ -0,0 +1,223 @@ +using BLL; +using BLL.CQMS.Comprehensive; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.Transfer +{ + public partial class RotatingEquipment : PageBase + { + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + BindGrid(); + } + } + + /// + /// 数据绑定 + /// + public void BindGrid() + { + string strSql = @"select * from Transfer_RotatingEquipment C + where C.ProjectId = @ProjectId"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + if (!string.IsNullOrEmpty(this.txtRotatingEquipment.Text.Trim())) + { + strSql += " AND RotatingEquipment like @RotatingEquipment"; + listStr.Add(new SqlParameter("@RotatingEquipment", "%" + this.txtRotatingEquipment.Text.Trim() + "%")); + } + if (!string.IsNullOrEmpty(txtStarTime.Text.Trim())) + { + strSql += " AND TestPackageSTART >= @InspectionDateA"; + listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim()))); + } + if (!string.IsNullOrEmpty(txtEndTime.Text.Trim())) + { + strSql += " AND TestPackageSTART <= @InspectionDateZ"; + listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim()))); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 分页、排序 + /// + /// 分页下拉 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 分页索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 增加 + /// + /// 新增按钮事件 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionEquipmentEdit.aspx", "编辑 - "))); + } + #endregion + + #region 编辑 + /// + /// 右键编辑 + /// + /// + /// + protected void btnMenuModify_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionEquipmentEdit.aspx?InspectionEquipmentId={0}", Grid1.SelectedRowID, "编辑 - "))); + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnMenuModify_Click(sender, e); + } + #endregion + + #region 删除 + /// + /// 右键删除 + /// + /// + /// + protected void btnMenuDel_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var data = BLL.RotatingEquipmentService.GetRotatingEquipmentById(rowID); + if (data != null) + { + BLL.RotatingEquipmentService.DeleteRotatingEquipment(rowID); + } + } + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("RotatingEquipmentDataIn.aspx", "导入 - "))); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.RotatingEquipmentMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnImport.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx.designer.cs new file mode 100644 index 00000000..ca6bd24d --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx.designer.cs @@ -0,0 +1,222 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.Transfer { + + + public partial class RotatingEquipment { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar ToolSearch; + + /// + /// txtRotatingEquipment 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRotatingEquipment; + + /// + /// txtStarTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStarTime; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// txtEndTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndTime; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// g1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupField g1; + + /// + /// g2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupField g2; + + /// + /// g3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupField g3; + + /// + /// g5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupField g5; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } +} diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx new file mode 100644 index 00000000..ccec8b03 --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx @@ -0,0 +1,68 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RotatingEquipmentDataIn.aspx.cs" Inherits="FineUIPro.Web.Transfer.RotatingEquipmentDataIn" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.cs new file mode 100644 index 00000000..bdc66334 --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.cs @@ -0,0 +1,417 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.OleDb; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.Transfer +{ + public partial class RotatingEquipmentDataIn : PageBase + { + #region 定义变量 + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + + /// + /// 错误集合 + /// + public static List errorInfos = new List(); + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.hdCheckResult.Text = string.Empty; + this.hdFileName.Text = string.Empty; + if (errorInfos != null) + { + errorInfos.Clear(); + } + } + } + #endregion + + #region 审核 + /// + /// 审核 + /// + /// + /// + protected void btnAudit_Click(object sender, EventArgs e) + { + try + { + if (this.fuAttachUrl.HasFile == false) + { + ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls") + { + ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning); + return; + } + if (errorInfos != null) + { + errorInfos.Clear(); + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls; + string filePath = initFullPath + this.hdFileName.Text; + this.fuAttachUrl.PostedFile.SaveAs(filePath); + ImportXlsToData(rootPath + initPath + this.hdFileName.Text); + } + catch (Exception ex) + { + ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL(ds.Tables[0], 7); + hdCheckResult.Text = "1"; + } + catch (Exception exc) + { + Response.Write(exc); + //return null; + // return dt; + } + finally + { + } + } + #endregion + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集行数 + /// + private bool AddDatasetToSQL(DataTable pds, int Cols) + { + string result = string.Empty; + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + return false; + } + + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + for (int i = 1; i < ir; i++) + { + string row4 = pds.Rows[i][4].ToString(); + if (!string.IsNullOrEmpty(row4)) + { + try + { + DateTime date = Convert.ToDateTime(row4.Trim()); + } + catch (Exception) + { + result += (i + 3).ToString() + "," + "Test Package START" + "," + "[" + row4 + "]错误!不是日期格式!" + "|"; + } + } + string row5 = pds.Rows[i][5].ToString(); + if (!string.IsNullOrEmpty(row4)) + { + try + { + DateTime date = Convert.ToDateTime(row5.Trim()); + } + catch (Exception) + { + result += (i + 3).ToString() + "," + "Test Package FINISH" + "," + "[" + row5 + "]错误!不是日期格式!" + "|"; + } + } + } + if (!string.IsNullOrEmpty(result)) + { + result = result.Substring(0, result.LastIndexOf("|")); + } + errorInfos.Clear(); + if (!string.IsNullOrEmpty(result)) + { + string results = result; + List errorInfoList = results.Split('|').ToList(); + foreach (var item in errorInfoList) + { + string[] errors = item.Split(','); + Model.ErrorInfo errorInfo = new Model.ErrorInfo(); + errorInfo.Row = errors[0]; + errorInfo.Column = errors[1]; + errorInfo.Reason = errors[2]; + errorInfos.Add(errorInfo); + } + if (errorInfos.Count > 0) + { + this.gvErrorInfo.DataSource = errorInfos; + this.gvErrorInfo.DataBind(); + } + } + else + { + ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success); + } + } + + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 导入 + /// + /// 导入 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(hdCheckResult.Text)) + { + if (errorInfos.Count <= 0) + { + string rootPath = Server.MapPath("~/"); + ImportXlsToData2(rootPath + initPath + this.hdFileName.Text); + hdCheckResult.Text = string.Empty; + ShowNotify("导入成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning); + } + } + + #region Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData2(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL2(ds.Tables[0], 7); + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集列数 + /// + private bool AddDatasetToSQL2(DataTable pds, int Cols) + { + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + } + string result = string.Empty; + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + List list = new List(); + for (int i = 1; i < ir; i++) + { + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_RotatingEquipment.FirstOrDefault(x => x.RotatingEquipment == pds.Rows[i][0].ToString().Trim() + && x.ProjectId == CurrUser.LoginProjectId); + if (modelOnly == null) + { + Model.Transfer_RotatingEquipment model = new Model.Transfer_RotatingEquipment(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.RotatingEquipment = pds.Rows[i][0].ToString().Trim(); + model.SYSTEM = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.TestPackage = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.TestPackageSTART = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.TestPackageFINISH = t2; + + model.MechanicalFINALStatus = pds.Rows[i][6].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.RotatingEquipment = pds.Rows[i][0].ToString().Trim(); + modelOnly.SYSTEM = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.TestPackage = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.TestPackageSTART = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.TestPackageFINISH = t2; + modelOnly.MechanicalFINALStatus = pds.Rows[i][6].ToString().Trim(); + Funs.DB.SubmitChanges(); + } + } + if (list.Count > 0) + { + Funs.DB.Transfer_RotatingEquipment.InsertAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + } + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 下载模板 + /// + /// 下载模板按钮 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + "File\\Excel\\DataIn\\RotatingEquipment导入模板.xls"; + string filePath = "File\\Excel\\DataIn\\RotatingEquipment导入模板.xls"; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.designer.cs new file mode 100644 index 00000000..bb3f6d2f --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.Transfer { + + + public partial class RotatingEquipmentDataIn { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdFileName; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + + /// + /// hdCheckResult 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdCheckResult; + + /// + /// fuAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fuAttachUrl; + + /// + /// gvErrorInfo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvErrorInfo; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + } +} diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx b/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx new file mode 100644 index 00000000..3c49f100 --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx @@ -0,0 +1,135 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaticEquipment.aspx.cs" Inherits="FineUIPro.Web.Transfer.StaticEquipment" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx.cs b/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx.cs new file mode 100644 index 00000000..e774e6bc --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx.cs @@ -0,0 +1,223 @@ +using BLL; +using BLL.CQMS.Comprehensive; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; + +namespace FineUIPro.Web.Transfer +{ + public partial class StaticEquipment : PageBase + { + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + BindGrid(); + } + } + + /// + /// 数据绑定 + /// + public void BindGrid() + { + string strSql = @"select * from Transfer_StaticEquipment C + where C.ProjectId = @ProjectId"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + if (!string.IsNullOrEmpty(this.txtStaticEquipment.Text.Trim())) + { + strSql += " AND StaticEquipment like @StaticEquipment"; + listStr.Add(new SqlParameter("@StaticEquipment", "%" + this.txtStaticEquipment.Text.Trim() + "%")); + } + if (!string.IsNullOrEmpty(txtStarTime.Text.Trim())) + { + strSql += " AND TestPackageSTART >= @InspectionDateA"; + listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim()))); + } + if (!string.IsNullOrEmpty(txtEndTime.Text.Trim())) + { + strSql += " AND TestPackageSTART <= @InspectionDateZ"; + listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim()))); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 分页、排序 + /// + /// 分页下拉 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 分页索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 增加 + /// + /// 新增按钮事件 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionEquipmentEdit.aspx", "编辑 - "))); + } + #endregion + + #region 编辑 + /// + /// 右键编辑 + /// + /// + /// + protected void btnMenuModify_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionEquipmentEdit.aspx?InspectionEquipmentId={0}", Grid1.SelectedRowID, "编辑 - "))); + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnMenuModify_Click(sender, e); + } + #endregion + + #region 删除 + /// + /// 右键删除 + /// + /// + /// + protected void btnMenuDel_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var data = BLL.StaticEquipmentService.GetStaticEquipmentById(rowID); + if (data != null) + { + BLL.StaticEquipmentService.DeleteStaticEquipment(rowID); + } + } + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("StaticEquipmentDataIn.aspx", "导入 - "))); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.StaticEquipmentMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnImport.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx.designer.cs new file mode 100644 index 00000000..e428de06 --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx.designer.cs @@ -0,0 +1,222 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.Transfer { + + + public partial class StaticEquipment { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar ToolSearch; + + /// + /// txtStaticEquipment 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtStaticEquipment; + + /// + /// txtStarTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStarTime; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// txtEndTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndTime; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// g1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupField g1; + + /// + /// g2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupField g2; + + /// + /// g3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupField g3; + + /// + /// g5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupField g5; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } +} diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx new file mode 100644 index 00000000..22fc0d7a --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx @@ -0,0 +1,68 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaticEquipmentDataIn.aspx.cs" Inherits="FineUIPro.Web.Transfer.StaticEquipmentDataIn" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.cs new file mode 100644 index 00000000..f6476672 --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.cs @@ -0,0 +1,417 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.OleDb; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.Transfer +{ + public partial class StaticEquipmentDataIn : PageBase + { + #region 定义变量 + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + + /// + /// 错误集合 + /// + public static List errorInfos = new List(); + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.hdCheckResult.Text = string.Empty; + this.hdFileName.Text = string.Empty; + if (errorInfos != null) + { + errorInfos.Clear(); + } + } + } + #endregion + + #region 审核 + /// + /// 审核 + /// + /// + /// + protected void btnAudit_Click(object sender, EventArgs e) + { + try + { + if (this.fuAttachUrl.HasFile == false) + { + ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls") + { + ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning); + return; + } + if (errorInfos != null) + { + errorInfos.Clear(); + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls; + string filePath = initFullPath + this.hdFileName.Text; + this.fuAttachUrl.PostedFile.SaveAs(filePath); + ImportXlsToData(rootPath + initPath + this.hdFileName.Text); + } + catch (Exception ex) + { + ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL(ds.Tables[0], 7); + hdCheckResult.Text = "1"; + } + catch (Exception exc) + { + Response.Write(exc); + //return null; + // return dt; + } + finally + { + } + } + #endregion + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集行数 + /// + private bool AddDatasetToSQL(DataTable pds, int Cols) + { + string result = string.Empty; + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + return false; + } + + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + for (int i = 1; i < ir; i++) + { + string row4 = pds.Rows[i][4].ToString(); + if (!string.IsNullOrEmpty(row4)) + { + try + { + DateTime date = Convert.ToDateTime(row4.Trim()); + } + catch (Exception) + { + result += (i + 3).ToString() + "," + "Test Package START" + "," + "[" + row4 + "]错误!不是日期格式!" + "|"; + } + } + string row5 = pds.Rows[i][5].ToString(); + if (!string.IsNullOrEmpty(row4)) + { + try + { + DateTime date = Convert.ToDateTime(row5.Trim()); + } + catch (Exception) + { + result += (i + 3).ToString() + "," + "Test Package FINISH" + "," + "[" + row5 + "]错误!不是日期格式!" + "|"; + } + } + } + if (!string.IsNullOrEmpty(result)) + { + result = result.Substring(0, result.LastIndexOf("|")); + } + errorInfos.Clear(); + if (!string.IsNullOrEmpty(result)) + { + string results = result; + List errorInfoList = results.Split('|').ToList(); + foreach (var item in errorInfoList) + { + string[] errors = item.Split(','); + Model.ErrorInfo errorInfo = new Model.ErrorInfo(); + errorInfo.Row = errors[0]; + errorInfo.Column = errors[1]; + errorInfo.Reason = errors[2]; + errorInfos.Add(errorInfo); + } + if (errorInfos.Count > 0) + { + this.gvErrorInfo.DataSource = errorInfos; + this.gvErrorInfo.DataBind(); + } + } + else + { + ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success); + } + } + + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 导入 + /// + /// 导入 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(hdCheckResult.Text)) + { + if (errorInfos.Count <= 0) + { + string rootPath = Server.MapPath("~/"); + ImportXlsToData2(rootPath + initPath + this.hdFileName.Text); + hdCheckResult.Text = string.Empty; + ShowNotify("导入成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning); + } + } + + #region Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData2(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL2(ds.Tables[0], 7); + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集列数 + /// + private bool AddDatasetToSQL2(DataTable pds, int Cols) + { + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + } + string result = string.Empty; + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + List list = new List(); + for (int i = 1; i < ir; i++) + { + //查询第一列,没查到的情况下作导入处理 + var modelOnly = Funs.DB.Transfer_StaticEquipment.FirstOrDefault(x => x.StaticEquipment == pds.Rows[i][0].ToString().Trim() + && x.ProjectId == CurrUser.LoginProjectId); + if (modelOnly == null) + { + Model.Transfer_StaticEquipment model = new Model.Transfer_StaticEquipment(); + model.Id = Guid.NewGuid().ToString(); + model.ProjectId = CurrUser.LoginProjectId; + model.StaticEquipment = pds.Rows[i][0].ToString().Trim(); + model.SYSTEM = pds.Rows[i][1].ToString().Trim(); + model.Subsystem = pds.Rows[i][2].ToString().Trim(); + model.TestPackage = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + model.TestPackageSTART = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + model.TestPackageFINISH = t2; + + model.MechanicalFINALStatus = pds.Rows[i][6].ToString().Trim(); + list.Add(model); + } + else + { + //修改 + modelOnly.StaticEquipment = pds.Rows[i][0].ToString().Trim(); + modelOnly.SYSTEM = pds.Rows[i][1].ToString().Trim(); + modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim(); + modelOnly.TestPackage = pds.Rows[i][3].ToString().Trim(); + DateTime t1, t2; + if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) + modelOnly.TestPackageSTART = t1; + if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) + modelOnly.TestPackageFINISH = t2; + modelOnly.MechanicalFINALStatus = pds.Rows[i][6].ToString().Trim(); + Funs.DB.SubmitChanges(); + } + } + if (list.Count > 0) + { + Funs.DB.Transfer_StaticEquipment.InsertAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + } + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 下载模板 + /// + /// 下载模板按钮 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + "File\\Excel\\DataIn\\StaticEquipment导入模板.xls"; + string filePath = "File\\Excel\\DataIn\\StaticEquipment导入模板.xls"; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.designer.cs new file mode 100644 index 00000000..30d4244f --- /dev/null +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.Transfer { + + + public partial class StaticEquipmentDataIn { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdFileName; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + + /// + /// hdCheckResult 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdCheckResult; + + /// + /// fuAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fuAttachUrl; + + /// + /// gvErrorInfo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvErrorInfo; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + } +} diff --git a/SGGL/FineUIPro.Web/Web.config b/SGGL/FineUIPro.Web/Web.config index f2c2e849..37de607d 100644 --- a/SGGL/FineUIPro.Web/Web.config +++ b/SGGL/FineUIPro.Web/Web.config @@ -76,7 +76,7 @@ - + diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 1c236fe9..0801de76 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -2360,6 +2360,12 @@ namespace Model partial void InsertTransfer_PunchlistFrom(Transfer_PunchlistFrom instance); partial void UpdateTransfer_PunchlistFrom(Transfer_PunchlistFrom instance); partial void DeleteTransfer_PunchlistFrom(Transfer_PunchlistFrom instance); + partial void InsertTransfer_RotatingEquipment(Transfer_RotatingEquipment instance); + partial void UpdateTransfer_RotatingEquipment(Transfer_RotatingEquipment instance); + partial void DeleteTransfer_RotatingEquipment(Transfer_RotatingEquipment instance); + partial void InsertTransfer_StaticEquipment(Transfer_StaticEquipment instance); + partial void UpdateTransfer_StaticEquipment(Transfer_StaticEquipment instance); + partial void DeleteTransfer_StaticEquipment(Transfer_StaticEquipment instance); partial void InsertTransfer_Telecom(Transfer_Telecom instance); partial void UpdateTransfer_Telecom(Transfer_Telecom instance); partial void DeleteTransfer_Telecom(Transfer_Telecom instance); @@ -8774,6 +8780,22 @@ namespace Model } } + public System.Data.Linq.Table Transfer_RotatingEquipment + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table Transfer_StaticEquipment + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Transfer_Telecom { get @@ -370477,6 +370499,514 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Transfer_RotatingEquipment")] + public partial class Transfer_RotatingEquipment : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Id; + + private string _ProjectId; + + private string _RotatingEquipment; + + private string _SYSTEM; + + private string _Subsystem; + + private string _TestPackage; + + private System.Nullable _TestPackageSTART; + + private System.Nullable _TestPackageFINISH; + + private string _MechanicalFINALStatus; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnIdChanging(string value); + partial void OnIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnRotatingEquipmentChanging(string value); + partial void OnRotatingEquipmentChanged(); + partial void OnSYSTEMChanging(string value); + partial void OnSYSTEMChanged(); + partial void OnSubsystemChanging(string value); + partial void OnSubsystemChanged(); + partial void OnTestPackageChanging(string value); + partial void OnTestPackageChanged(); + partial void OnTestPackageSTARTChanging(System.Nullable value); + partial void OnTestPackageSTARTChanged(); + partial void OnTestPackageFINISHChanging(System.Nullable value); + partial void OnTestPackageFINISHChanged(); + partial void OnMechanicalFINALStatusChanging(string value); + partial void OnMechanicalFINALStatusChanged(); + #endregion + + public Transfer_RotatingEquipment() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Id + { + get + { + return this._Id; + } + set + { + if ((this._Id != value)) + { + this.OnIdChanging(value); + this.SendPropertyChanging(); + this._Id = value; + this.SendPropertyChanged("Id"); + this.OnIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this.OnProjectIdChanging(value); + this.SendPropertyChanging(); + this._ProjectId = value; + this.SendPropertyChanged("ProjectId"); + this.OnProjectIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RotatingEquipment", DbType="NVarChar(50)")] + public string RotatingEquipment + { + get + { + return this._RotatingEquipment; + } + set + { + if ((this._RotatingEquipment != value)) + { + this.OnRotatingEquipmentChanging(value); + this.SendPropertyChanging(); + this._RotatingEquipment = value; + this.SendPropertyChanged("RotatingEquipment"); + this.OnRotatingEquipmentChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SYSTEM", DbType="NVarChar(50)")] + public string SYSTEM + { + get + { + return this._SYSTEM; + } + set + { + if ((this._SYSTEM != value)) + { + this.OnSYSTEMChanging(value); + this.SendPropertyChanging(); + this._SYSTEM = value; + this.SendPropertyChanged("SYSTEM"); + this.OnSYSTEMChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Subsystem", DbType="NVarChar(50)")] + public string Subsystem + { + get + { + return this._Subsystem; + } + set + { + if ((this._Subsystem != value)) + { + this.OnSubsystemChanging(value); + this.SendPropertyChanging(); + this._Subsystem = value; + this.SendPropertyChanged("Subsystem"); + this.OnSubsystemChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackage", DbType="NVarChar(50)")] + public string TestPackage + { + get + { + return this._TestPackage; + } + set + { + if ((this._TestPackage != value)) + { + this.OnTestPackageChanging(value); + this.SendPropertyChanging(); + this._TestPackage = value; + this.SendPropertyChanged("TestPackage"); + this.OnTestPackageChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageSTART", DbType="DateTime")] + public System.Nullable TestPackageSTART + { + get + { + return this._TestPackageSTART; + } + set + { + if ((this._TestPackageSTART != value)) + { + this.OnTestPackageSTARTChanging(value); + this.SendPropertyChanging(); + this._TestPackageSTART = value; + this.SendPropertyChanged("TestPackageSTART"); + this.OnTestPackageSTARTChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageFINISH", DbType="DateTime")] + public System.Nullable TestPackageFINISH + { + get + { + return this._TestPackageFINISH; + } + set + { + if ((this._TestPackageFINISH != value)) + { + this.OnTestPackageFINISHChanging(value); + this.SendPropertyChanging(); + this._TestPackageFINISH = value; + this.SendPropertyChanged("TestPackageFINISH"); + this.OnTestPackageFINISHChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MechanicalFINALStatus", DbType="NVarChar(50)")] + public string MechanicalFINALStatus + { + get + { + return this._MechanicalFINALStatus; + } + set + { + if ((this._MechanicalFINALStatus != value)) + { + this.OnMechanicalFINALStatusChanging(value); + this.SendPropertyChanging(); + this._MechanicalFINALStatus = value; + this.SendPropertyChanged("MechanicalFINALStatus"); + this.OnMechanicalFINALStatusChanged(); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Transfer_StaticEquipment")] + public partial class Transfer_StaticEquipment : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Id; + + private string _ProjectId; + + private string _StaticEquipment; + + private string _SYSTEM; + + private string _Subsystem; + + private string _TestPackage; + + private System.Nullable _TestPackageSTART; + + private System.Nullable _TestPackageFINISH; + + private string _MechanicalFINALStatus; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnIdChanging(string value); + partial void OnIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnStaticEquipmentChanging(string value); + partial void OnStaticEquipmentChanged(); + partial void OnSYSTEMChanging(string value); + partial void OnSYSTEMChanged(); + partial void OnSubsystemChanging(string value); + partial void OnSubsystemChanged(); + partial void OnTestPackageChanging(string value); + partial void OnTestPackageChanged(); + partial void OnTestPackageSTARTChanging(System.Nullable value); + partial void OnTestPackageSTARTChanged(); + partial void OnTestPackageFINISHChanging(System.Nullable value); + partial void OnTestPackageFINISHChanged(); + partial void OnMechanicalFINALStatusChanging(string value); + partial void OnMechanicalFINALStatusChanged(); + #endregion + + public Transfer_StaticEquipment() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Id + { + get + { + return this._Id; + } + set + { + if ((this._Id != value)) + { + this.OnIdChanging(value); + this.SendPropertyChanging(); + this._Id = value; + this.SendPropertyChanged("Id"); + this.OnIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this.OnProjectIdChanging(value); + this.SendPropertyChanging(); + this._ProjectId = value; + this.SendPropertyChanged("ProjectId"); + this.OnProjectIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StaticEquipment", DbType="NVarChar(50)")] + public string StaticEquipment + { + get + { + return this._StaticEquipment; + } + set + { + if ((this._StaticEquipment != value)) + { + this.OnStaticEquipmentChanging(value); + this.SendPropertyChanging(); + this._StaticEquipment = value; + this.SendPropertyChanged("StaticEquipment"); + this.OnStaticEquipmentChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SYSTEM", DbType="NVarChar(50)")] + public string SYSTEM + { + get + { + return this._SYSTEM; + } + set + { + if ((this._SYSTEM != value)) + { + this.OnSYSTEMChanging(value); + this.SendPropertyChanging(); + this._SYSTEM = value; + this.SendPropertyChanged("SYSTEM"); + this.OnSYSTEMChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Subsystem", DbType="NVarChar(50)")] + public string Subsystem + { + get + { + return this._Subsystem; + } + set + { + if ((this._Subsystem != value)) + { + this.OnSubsystemChanging(value); + this.SendPropertyChanging(); + this._Subsystem = value; + this.SendPropertyChanged("Subsystem"); + this.OnSubsystemChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackage", DbType="NVarChar(50)")] + public string TestPackage + { + get + { + return this._TestPackage; + } + set + { + if ((this._TestPackage != value)) + { + this.OnTestPackageChanging(value); + this.SendPropertyChanging(); + this._TestPackage = value; + this.SendPropertyChanged("TestPackage"); + this.OnTestPackageChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageSTART", DbType="DateTime")] + public System.Nullable TestPackageSTART + { + get + { + return this._TestPackageSTART; + } + set + { + if ((this._TestPackageSTART != value)) + { + this.OnTestPackageSTARTChanging(value); + this.SendPropertyChanging(); + this._TestPackageSTART = value; + this.SendPropertyChanged("TestPackageSTART"); + this.OnTestPackageSTARTChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageFINISH", DbType="DateTime")] + public System.Nullable TestPackageFINISH + { + get + { + return this._TestPackageFINISH; + } + set + { + if ((this._TestPackageFINISH != value)) + { + this.OnTestPackageFINISHChanging(value); + this.SendPropertyChanging(); + this._TestPackageFINISH = value; + this.SendPropertyChanged("TestPackageFINISH"); + this.OnTestPackageFINISHChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MechanicalFINALStatus", DbType="NVarChar(50)")] + public string MechanicalFINALStatus + { + get + { + return this._MechanicalFINALStatus; + } + set + { + if ((this._MechanicalFINALStatus != value)) + { + this.OnMechanicalFINALStatusChanging(value); + this.SendPropertyChanging(); + this._MechanicalFINALStatus = value; + this.SendPropertyChanged("MechanicalFINALStatus"); + this.OnMechanicalFINALStatusChanged(); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Transfer_Telecom")] public partial class Transfer_Telecom : INotifyPropertyChanging, INotifyPropertyChanged { diff --git a/SGGL/WebAPI/WebAPI.csproj.user b/SGGL/WebAPI/WebAPI.csproj.user index 4edb5e0f..6bc24ada 100644 --- a/SGGL/WebAPI/WebAPI.csproj.user +++ b/SGGL/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU true