diff --git a/SGGL/BLL/CQMS/Comprehensive/TrainingRecordsService.cs b/SGGL/BLL/CQMS/Comprehensive/TrainingRecordsService.cs index f9f008b1..5131de34 100644 --- a/SGGL/BLL/CQMS/Comprehensive/TrainingRecordsService.cs +++ b/SGGL/BLL/CQMS/Comprehensive/TrainingRecordsService.cs @@ -21,6 +21,17 @@ namespace BLL return Funs.DB.Comprehensive_TrainingRecords.FirstOrDefault(e => e.TrainingRecordsId == trainingRecordsId); } + /// + /// 根据培训内容、专业获取培训记录 + /// + /// + /// + /// + public static Model.Comprehensive_TrainingRecords GetTrainingRecordsByName(string trainingContents, string cNProfessionalId) + { + return Funs.DB.Comprehensive_TrainingRecords.FirstOrDefault(e => e.TrainingContents == trainingContents && e.CNProfessionalId == cNProfessionalId); + } + /// /// 添加培训记录 /// diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 6d133b12..ff6456f1 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3245,6 +3245,11 @@ namespace BLL /// 资料收发文登记记录导入模板原始虚拟路径 /// public const string CQMS_DataReceivingDocTempUrl = "File\\Excel\\DataIn\\资料收发文登记记录导入模板.xlsx"; + + /// + /// 培训记录导入模板原始虚拟路径 + /// + public const string CQMS_TrainingRecordsTemplateUrl= "File\\Excel\\DataIn\\培训记录导入模板.xlsx"; #endregion #region 绩效考核模板文件路径 @@ -3844,6 +3849,11 @@ namespace BLL /// public const string DesignDrawingsMenuId = "d8de4143-b680-44cf-9a78-acd3d49a8d00"; + /// + /// 培训记录 + /// + public const string TrainingRecordsMenuId = "CFD19410-DF80-494A-A2DD-D23A03438742"; + /// /// 图纸会审管理 /// diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx index 660d8410..4b7d336d 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx @@ -4,13 +4,106 @@ - + 培训记录
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.cs index ffd327a9..27eeb729 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.cs @@ -1,5 +1,8 @@ -using System; +using BLL; +using System; using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; @@ -7,11 +10,237 @@ using System.Web.UI.WebControls; namespace FineUIPro.Web.CQMS.Comprehensive { - public partial class TrainingRecords : System.Web.UI.Page + public partial class TrainingRecords : PageBase { + #region 加载 + /// + /// 加载页面 + /// + /// + /// protected void Page_Load(object sender, EventArgs e) { - + if (!IsPostBack) + { + GetButtonPower(); + BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true); + BindGrid(); + } } + + /// + /// 数据绑定 + /// + public void BindGrid() + { + string strSql = @"SELECT C.TrainingRecordsId, + C.ProjectId, + C.TrainingContents, + C.CNProfessionalId, + C.TrainingObject, + C.TrainingAddress, + C.Hours, + C.KeynoteSpeaker, + C.Remark, + CN.ProfessionalName" + + @" FROM Comprehensive_TrainingRecords C " + + @" LEFT JOIN Base_CNProfessional CN ON C.CNProfessionalId=CN.CNProfessionalId" + + @" WHERE C.ProjectId = @ProjectId"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + if (drpCNProfessionalId.SelectedValue != BLL.Const._Null) + { + strSql += " AND C.CNProfessionalId=@CNProfessionalId"; + listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessionalId.SelectedValue)); + } + if (!string.IsNullOrEmpty(this.txtTrainingContents.Text.Trim())) + { + strSql += " AND C.TrainingContents LIKE @TrainingContents"; + listStr.Add(new SqlParameter("@TrainingContents", "%" + this.txtTrainingContents.Text.Trim() + "%")); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 分页、排序 + /// + /// 分页下拉 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + #endregion + + #region 新增 + /// + /// 新增按钮事件 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainingRecordsEdit.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("TrainingRecordsEdit.aspx?id={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 trainingRecords = BLL.TrainingRecordsService.GetTrainingRecordsById(rowID); + if (trainingRecords != null) + { + BLL.TrainingRecordsService.DeleteTrainingRecordsById(rowID); + } + } + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("TrainingRecordsDataIn.aspx", "导入 - "))); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == BLL.Const._Null) + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.TrainingRecordsMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuModify.Hidden = false; + this.Grid1.EnableRowDoubleClickEvent = true; + } + else + { + this.Grid1.EnableRowDoubleClickEvent = false; + } + 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/CQMS/Comprehensive/TrainingRecords.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.designer.cs index ea703d60..52402bab 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.designer.cs @@ -20,5 +20,158 @@ namespace FineUIPro.Web.CQMS.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 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; + + /// + /// drpCNProfessionalId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCNProfessionalId; + + /// + /// txtTrainingContents 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTrainingContents; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; } } diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx new file mode 100644 index 00000000..b83bf5de --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx @@ -0,0 +1,167 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainingRecordsDataIn.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.TrainingRecordsDataIn" %> + + + + + + + 导入培训记录 + + + + +
+ + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.cs new file mode 100644 index 00000000..eb107868 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.cs @@ -0,0 +1,521 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Threading; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class TrainingRecordsDataIn : PageBase + { + #region 定义项 + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + /// + /// 错误集合 + /// + public static string errorInfos = string.Empty; + + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (percent == null) + { + percent = new Dictionary(); + } + this.id.Text = this.CurrUser.UserId; + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + else if (GetRequestEventArgument() == "reloadGrid") + { + BindGrid(); + } + } + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT TempId,ProjectId,UserId,Time,RowNo,ToopValue,Value1,Value2,Value3,Value4,Value5,Value6,Value7,Value8,Value9,Value10" + + @" ,Value11,Value12,Value13,Value14,Value15,Value16,Value17,Value18,Value19,Value20,Value21,Value22,Value23,Value24,Value25,Value26,Value27,Value28,Value29,Value30" + + @" ,Value31,Value32,Value33,Value34,Value35,Value36,Value37,Value38,Value39,Value40,Value41,Value42,Value43,Value44,Value45,Value46,Value47,Value48,Value49,Value50,ToopValue,Type" + + @" FROM Sys_DataInTemp " + + @" WHERE ProjectId=@ProjectId AND UserId=@UserId AND Type=@Type"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@UserId", this.CurrUser.UserId)); + listStr.Add(new SqlParameter("@Type", "TrainingRecords"));//培训记录 + 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(); + + var dataInTempAll = from x in Funs.DB.Sys_DataInTemp + where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "TrainingRecords" + select x; + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var dataInTemp = dataInTempAll.FirstOrDefault(x => x.TempId == Grid1.Rows[i].DataKeys[0].ToString()); + if (dataInTemp != null) + { + if (!string.IsNullOrEmpty(dataInTemp.ToopValue)) + { + Grid1.Rows[i].RowCssClass = "red"; + } + } + } + var errData = from x in dataInTempAll where x.ToopValue != null select x; + this.lbDataCout.Text = errData.Count().ToString(); + } + #endregion + + #region 双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.TrainingRecordsMenuId, Const.BtnSave)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainingRecordsDataInEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 导入信息 维护 + /// + /// 导入信息编辑 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.TrainingRecordsMenuId, BLL.Const.BtnSave)) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainingRecordsDataInEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + /// + /// 删除按钮 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.TrainingRecordsMenuId, Const.BtnSave)) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + BLL.Sys_DataTempService.DeleteDataInTempByDataInTempID(rowID); + } + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.BindGrid(); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 分页 排序 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 删除所有数据事件 + /// + /// 删除所有数据事件 + /// + /// + /// + protected void btnAllDelete_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.TrainingRecordsMenuId, Const.BtnSave)) + { + //先删除临时表中 该人员以前导入的数据 + BLL.Sys_DataTempService.DeleteDataInTempByProjectIdUserId(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "TrainingRecords"); + this.BindGrid(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.lbDataCout.Text = string.Empty; + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 下载模板 + /// + /// 下载模板 + /// + /// + /// + protected void imgbtnUpload_Click(object sender, EventArgs e) + { + this.TemplateUpload(BLL.Const.CQMS_TrainingRecordsTemplateUrl); + } + + protected void TemplateUpload(string initTemplatePath) + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + initTemplatePath; + string filePath = Const.CQMS_TrainingRecordsTemplateUrl; + 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(); + } + + /// + /// 导入说明 + /// + /// + /// + //protected void lkAchievements_Click(object sender, EventArgs e) + //{ + // this.TemplateUpload(Const.CQMS_DataReceivingDocTempUrl); + //} + #endregion + + #region 进度条 + public static Dictionary percent { get; set; } + public static Dictionary url { get; set; } + + [System.Web.Services.WebMethod] + public static int getPercent(string id) + { + return percent[id]; + } + #endregion + + #region 文件上传 + /// + /// 文件上传 + /// + /// + /// + protected void imgbtnImport_Click(object sender, EventArgs e) + { + try + { + if (this.FileExcel.HasFile == false) + { + ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.FileExcel.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls" && IsXls != ".xlsx") + { + ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning); + return; + } + 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.FileExcel.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + string fileName = rootPath + initPath + this.hdfileName.Text; + //读取Excel + DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out errorInfos, true); + //验证Excel读取是否有误 + if (!string.IsNullOrEmpty(errorInfos)) + { + ShowNotify(errorInfos, MessageBoxIcon.Warning); + return; + } + + if (ds.Tables.Count > 0) + { + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + Sys_DataInTemp newDataInTemp = new Sys_DataInTemp(); + newDataInTemp.TempId = SQLHelper.GetNewID(typeof(Model.Sys_DataInTemp)); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = "TrainingRecords"; + newDataInTemp.RowNo = i + 2; + newDataInTemp.Value1 = ds.Tables[0].Rows[i]["培训内容"].ToString().Trim(); + newDataInTemp.Value2 = ds.Tables[0].Rows[i]["专业"].ToString().Trim(); + newDataInTemp.Value3 = ds.Tables[0].Rows[i]["培训对象"].ToString().Trim(); + newDataInTemp.Value4 = ds.Tables[0].Rows[i]["培训地点"].ToString().Trim(); + newDataInTemp.Value5 = ds.Tables[0].Rows[i]["课时(小时)"].ToString().Trim(); + newDataInTemp.Value6 = ds.Tables[0].Rows[i]["主讲人"].ToString().Trim(); + newDataInTemp.Value7 = ds.Tables[0].Rows[i]["备注"].ToString().Trim(); + + BLL.Sys_DataTempService.AddDataInTemp(newDataInTemp); + } + this.BindGrid(); + ShowNotify("数据已导入临时表!", MessageBoxIcon.Success); + } + else + { + ShowNotify("无数据!", MessageBoxIcon.Warning); + return; + } + } + catch (Exception ex) + { + Alert.ShowInTop("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + #endregion + + #region 保存审核事件 + /// + /// 保存审核事件 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + Thread t = new Thread(new ThreadStart(() => { btnSaveMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId); })); + t.Start(); + if (percent.ContainsKey(this.CurrUser.UserId)) + { + percent[CurrUser.UserId] = 0; + } + else + { + percent.Add(CurrUser.UserId, 0); + } + PageContext.RegisterStartupScript("printX()"); + } + protected void btnRefresh_Click(object sender, EventArgs e) + { + this.BindGrid(); + } + + protected void btnSaveMethod(string LoginProjectId, string UserId) + { + var cNProfessionals = from x in Funs.DB.Base_CNProfessional select x;//专业 + + var dataInTemp = from x in Funs.DB.Sys_DataInTemp + where x.ProjectId == LoginProjectId && x.UserId == UserId && x.Type == "TrainingRecords" + select x; + int okCount = 0; + int i = 0; + int ir = dataInTemp.Count(); + string erreMessage = ""; + foreach (var tempData in dataInTemp) + { + if (tempData != null) + { + i++; + percent[UserId] = (int)(100 * i / ir); + string errInfo = string.Empty; + var isExitValue = Funs.DB.Comprehensive_TrainingRecords.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.TrainingContents == tempData.Value1 + && x.CNProfessionalId == tempData.Value2); + if (isExitValue == null || this.ckUpdate.Checked) + { + Model.Comprehensive_TrainingRecords newData = new Model.Comprehensive_TrainingRecords(); + if (!string.IsNullOrEmpty(tempData.Value1.Trim())) + { + newData.TrainingContents = tempData.Value1.Trim(); + } + else + { + errInfo += "培训内容为必填项;"; + } + + if (!string.IsNullOrEmpty(tempData.Value2.Trim())) + { + var professional = cNProfessionals.FirstOrDefault(e => e.ProfessionalName == tempData.Value2.Trim()); + if (professional != null) + { + newData.CNProfessionalId = professional.CNProfessionalId; + } + else + { + errInfo += "专业不存在;"; + } + } + else + { + errInfo += "专业为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value3.Trim())) + { + newData.TrainingObject = tempData.Value3.Trim(); + } + else + { + errInfo += "培训对象为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value4.Trim())) + { + newData.TrainingAddress = tempData.Value4.Trim(); + } + else + { + errInfo += "培训地点为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value5.Trim())) + { + try + { + newData.Hours = Funs.GetNewDecimal(tempData.Value5.Trim()); + } + catch (Exception) + { + errInfo += "课时(小时)格式错误;"; + } + } + if (!string.IsNullOrEmpty(tempData.Value6.Trim())) + { + newData.KeynoteSpeaker = tempData.Value6.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value7.Trim())) + { + newData.Remark = tempData.Value7.Trim(); + } + if (string.IsNullOrEmpty(errInfo)) ////所有信息正确的话 这插入管线焊口 + { + newData.ProjectId = this.CurrUser.LoginProjectId; + + var data = BLL.TrainingRecordsService.GetTrainingRecordsByName(newData.TrainingContents, newData.CNProfessionalId); + if (data == null) + { + newData.TrainingRecordsId = SQLHelper.GetNewID(typeof(Model.Comprehensive_TrainingRecords)); + BLL.TrainingRecordsService.AddTrainingRecords(newData); + } + else + { + newData.TrainingRecordsId = data.TrainingRecordsId; + BLL.TrainingRecordsService.UpdateTrainingRecords(newData); + } + + BLL.Sys_DataTempService.DeleteDataInTempByDataInTempID(tempData.TempId); + okCount++; + } + } + else + { + errInfo = "该条记录已存在于培训记录表中。"; + } + + if (!string.IsNullOrEmpty(errInfo)) + { + tempData.ToopValue = errInfo; + BLL.Sys_DataTempService.UpdateDataInTemp(tempData); + erreMessage += errInfo + ";"; + } + } + } + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("培训记录导入模板" + filename, System.Text.Encoding.UTF8) + ".xlsx"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.designer.cs new file mode 100644 index 00000000..e30ff7cd --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.designer.cs @@ -0,0 +1,267 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive { + + + public partial class TrainingRecordsDataIn { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// id 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField id; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdfileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdfileName; + + /// + /// FileExcel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload FileExcel; + + /// + /// imgbtnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnImport; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// ckUpdate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox ckUpdate; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnRefresh 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRefresh; + + /// + /// btnAllDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAllDelete; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// imgbtnUpload 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnUpload; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// lbDataCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDataCout; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// ContentPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel3; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + + /// + /// ScriptManager2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.ScriptManager ScriptManager2; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInEdit.aspx new file mode 100644 index 00000000..544fd18f --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInEdit.aspx @@ -0,0 +1,66 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainingRecordsDataInEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.TrainingRecordsDataInEdit" %> + + + + + + + 编辑培训记录导入 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInEdit.aspx.cs new file mode 100644 index 00000000..bcbfbac4 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInEdit.aspx.cs @@ -0,0 +1,175 @@ +using BLL; +using System; +using System.Linq; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class TrainingRecordsDataInEdit : PageBase + { + #region 定义项 + /// + /// 临时表主键 + /// + public string TempId + { + get + { + return (string)ViewState["TempId"]; + } + set + { + ViewState["TempId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.TempId = Request.Params["TempId"]; + this.txtValue1.Focus(); + var dataInTemp = BLL.Sys_DataTempService.GetDataInTempByTempId(this.TempId); + if (dataInTemp != null) + { + this.txtValue1.Text = dataInTemp.Value1; + this.txtValue2.Text = dataInTemp.Value2; + this.txtValue3.Text = dataInTemp.Value3; + this.txtValue4.Text = dataInTemp.Value4; + this.txtValue5.Text = dataInTemp.Value5; + this.txtValue6.Text = dataInTemp.Value6; + this.txtValue7.Text = dataInTemp.Value7; + + this.lbErrCout.Text = dataInTemp.ToopValue; + } + } + } + #endregion + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + var dataInTemp = BLL.Sys_DataTempService.GetDataInTempByTempId(this.TempId); + if (this.ckAll.Checked) + { + var allDataInTemp = from x in Funs.DB.Sys_DataInTemp where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId select x; + if (dataInTemp.Value1 != this.txtValue1.Text.Trim()) + { + var tempValue1 = allDataInTemp.Where(x => x.Value1 == dataInTemp.Value1 || (x.Value1 == null && dataInTemp.Value1 == null)); + if (tempValue1 != null) + { + foreach (var item in tempValue1) + { + item.Value1 = this.txtValue1.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value2 != this.txtValue2.Text.Trim()) + { + var tempValue2 = allDataInTemp.Where(x => x.Value2 == dataInTemp.Value2 || (x.Value2 == null && dataInTemp.Value2 == null)); + if (tempValue2 != null) + { + foreach (var item in tempValue2) + { + item.Value2 = this.txtValue2.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value3 != this.txtValue3.Text.Trim()) + { + var tempValue3 = allDataInTemp.Where(x => x.Value3 == dataInTemp.Value3 || (x.Value3 == null && dataInTemp.Value3 == null)); + if (tempValue3 != null) + { + foreach (var item in tempValue3) + { + item.Value3 = this.txtValue3.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value5 != this.txtValue5.Text.Trim()) + { + var tempValue5 = allDataInTemp.Where(x => x.Value5 == dataInTemp.Value5 || (x.Value5 == null && dataInTemp.Value5 == null)); + if (tempValue5 != null) + { + foreach (var item in tempValue5) + { + item.Value5 = this.txtValue5.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value6 != this.txtValue6.Text.Trim()) + { + var tempValue6 = allDataInTemp.Where(x => x.Value6 == dataInTemp.Value6 || (x.Value6 == null && dataInTemp.Value6 == null)); + if (tempValue6 != null) + { + foreach (var item in tempValue6) + { + item.Value6 = this.txtValue6.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value7 != this.txtValue7.Text.Trim()) + { + var tempValue7 = allDataInTemp.Where(x => x.Value7 == dataInTemp.Value7 || (x.Value7 == null && dataInTemp.Value7 == null)); + if (tempValue7 != null) + { + foreach (var item in tempValue7) + { + item.Value7 = this.txtValue7.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + var toopValue = allDataInTemp.Where(x => x.ToopValue == dataInTemp.ToopValue); + if (toopValue != null) + { + foreach (var item in toopValue) + { + item.ToopValue = null; + Funs.DB.SubmitChanges(); + } + } + } + else + { + Model.Sys_DataInTemp newDataInTemp = new Model.Sys_DataInTemp(); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = dataInTemp.Type; + newDataInTemp.Value1 = this.txtValue1.Text.Trim(); + newDataInTemp.Value2 = this.txtValue2.Text.Trim(); + newDataInTemp.Value3 = this.txtValue3.Text.Trim(); + newDataInTemp.Value4 = this.txtValue4.Text.Trim(); + newDataInTemp.Value5 = this.txtValue5.Text.Trim(); + newDataInTemp.Value6 = this.txtValue6.Text.Trim(); + newDataInTemp.Value7 = this.txtValue7.Text.Trim(); + if (!string.IsNullOrEmpty(this.TempId)) + { + newDataInTemp.TempId = this.TempId; + newDataInTemp.ToopValue = null; + BLL.Sys_DataTempService.UpdateDataInTemp(newDataInTemp); + } + } + ShowNotify("信息修改完成!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInEdit.aspx.designer.cs new file mode 100644 index 00000000..61b04fe6 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInEdit.aspx.designer.cs @@ -0,0 +1,150 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive { + + + public partial class TrainingRecordsDataInEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// txtValue1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue1; + + /// + /// txtValue2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue2; + + /// + /// txtValue3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue3; + + /// + /// txtValue4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue4; + + /// + /// txtValue5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue5; + + /// + /// txtValue6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue6; + + /// + /// txtValue7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue7; + + /// + /// ckAll 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox ckAll; + + /// + /// lbErrCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea lbErrCout; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsEdit.aspx new file mode 100644 index 00000000..8218aa47 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsEdit.aspx @@ -0,0 +1,62 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainingRecordsEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.TrainingRecordsEdit" %> + + + + + + + 编辑培训记录 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsEdit.aspx.cs new file mode 100644 index 00000000..ca55ca85 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsEdit.aspx.cs @@ -0,0 +1,118 @@ +using BLL; +using System; +using System.Linq; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class TrainingRecordsEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string TrainingRecordsId + { + get + { + return (string)ViewState["TrainingRecordsId"]; + } + set + { + ViewState["TrainingRecordsId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true); + this.TrainingRecordsId = Request.Params["id"]; + Model.Comprehensive_TrainingRecords trainingRecords = BLL.TrainingRecordsService.GetTrainingRecordsById(this.TrainingRecordsId); + if (trainingRecords != null) + { + this.TrainingRecordsId = trainingRecords.TrainingRecordsId; + this.txtTrainingContents.Text = trainingRecords.TrainingContents; + if (!string.IsNullOrEmpty(trainingRecords.CNProfessionalId)) + { + this.drpCNProfessionalId.SelectedValue = trainingRecords.CNProfessionalId; + } + this.txtTrainingObject.Text = trainingRecords.TrainingObject; + this.txtTrainingAddress.Text = trainingRecords.TrainingAddress; + this.txtHours.Text = trainingRecords.Hours.HasValue ? trainingRecords.Hours.ToString() : ""; + this.txtKeynoteSpeaker.Text = trainingRecords.KeynoteSpeaker; + this.txtRemark.Text = trainingRecords.Remark; + } + } + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (drpCNProfessionalId.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning); + return; + } + Model.Comprehensive_TrainingRecords trainingRecords = new Model.Comprehensive_TrainingRecords(); + trainingRecords.CNProfessionalId = this.drpCNProfessionalId.SelectedValue; + trainingRecords.TrainingContents = this.txtTrainingContents.Text.Trim(); + trainingRecords.TrainingObject = this.txtTrainingObject.Text.Trim(); + trainingRecords.TrainingAddress = this.txtTrainingAddress.Text.Trim(); + trainingRecords.Hours = Funs.GetNewDecimal(this.txtHours.Text.Trim()); + trainingRecords.KeynoteSpeaker = this.txtKeynoteSpeaker.Text.Trim(); + trainingRecords.Remark = this.txtRemark.Text.Trim(); + if (!string.IsNullOrEmpty(this.TrainingRecordsId)) + { + trainingRecords.TrainingRecordsId = this.TrainingRecordsId; + BLL.TrainingRecordsService.UpdateTrainingRecords(trainingRecords); + } + else + { + trainingRecords.TrainingRecordsId = SQLHelper.GetNewID(typeof(Model.Comprehensive_TrainingRecords)); + trainingRecords.ProjectId = this.CurrUser.LoginProjectId; + BLL.TrainingRecordsService.AddTrainingRecords(trainingRecords); + } + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.TrainingRecordsMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsEdit.aspx.designer.cs new file mode 100644 index 00000000..0ea812a2 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsEdit.aspx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive { + + + public partial class TrainingRecordsEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtTrainingContents 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTrainingContents; + + /// + /// drpCNProfessionalId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCNProfessionalId; + + /// + /// txtTrainingObject 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTrainingObject; + + /// + /// txtTrainingAddress 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTrainingAddress; + + /// + /// txtHours 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtHours; + + /// + /// txtKeynoteSpeaker 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtKeynoteSpeaker; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/培训记录导入模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/培训记录导入模板.xlsx new file mode 100644 index 00000000..ed68bb54 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/培训记录导入模板.xlsx differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index dba04c82..ebc933f7 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -480,6 +480,9 @@ + + + @@ -7729,6 +7732,27 @@ TrainingRecords.aspx + + TrainingRecordsDataIn.aspx + ASPXCodeBehind + + + TrainingRecordsDataIn.aspx + + + TrainingRecordsDataInEdit.aspx + ASPXCodeBehind + + + TrainingRecordsDataInEdit.aspx + + + TrainingRecordsEdit.aspx + ASPXCodeBehind + + + TrainingRecordsEdit.aspx + ConstructionStandardList.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml index 1ebd1ff1..d66d477e 100644 --- a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml +++ b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml @@ -19,6 +19,7 @@ + diff --git a/SGGL/FineUIPro.Web/common/Menu_Personal.xml b/SGGL/FineUIPro.Web/common/Menu_Personal.xml index a9d07855..2854ffd9 100644 --- a/SGGL/FineUIPro.Web/common/Menu_Personal.xml +++ b/SGGL/FineUIPro.Web/common/Menu_Personal.xml @@ -6,7 +6,4 @@ - - - \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_TestRun.xml b/SGGL/FineUIPro.Web/common/Menu_TestRun.xml index 68f5e44c..b1a26ee1 100644 --- a/SGGL/FineUIPro.Web/common/Menu_TestRun.xml +++ b/SGGL/FineUIPro.Web/common/Menu_TestRun.xml @@ -46,12 +46,12 @@ - - - - + + + + @@ -69,11 +69,9 @@ - - @@ -121,8 +119,7 @@ - - + diff --git a/SGGL/FineUIPro.Web/common/Menu_Transfer.xml b/SGGL/FineUIPro.Web/common/Menu_Transfer.xml index 4d3b9e97..91d9fd84 100644 --- a/SGGL/FineUIPro.Web/common/Menu_Transfer.xml +++ b/SGGL/FineUIPro.Web/common/Menu_Transfer.xml @@ -1,21 +1,3 @@  - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index 69859890..ed44c8fe 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -83,8 +83,4 @@ - - - - \ No newline at end of file