diff --git a/HJGL_DS/FineUIPro.Web/Global.asax.cs b/HJGL_DS/FineUIPro.Web/Global.asax.cs index da3d6f2..aca0746 100644 --- a/HJGL_DS/FineUIPro.Web/Global.asax.cs +++ b/HJGL_DS/FineUIPro.Web/Global.asax.cs @@ -11,6 +11,9 @@ using System.Threading; using System.Web; using BLL; + using System.Data; + using System.Data.SqlClient; + using System.Collections.Generic; public class Global : System.Web.HttpApplication { @@ -464,6 +467,88 @@ BLL.HJGL_WelderQualifiedProjectService.UpdateWelderQualifiedProject(updateQue); } } + + bool b = false; + string orderTime = string.Empty; + if (intHour == 8) + { + orderTime = "7:00 - 8:00"; + } + else if (intHour == 9) + { + orderTime = "8:00 - 9:00"; + } + else if (intHour == 10) + { + orderTime = "9:00 - 10:00"; + } + else if (intHour == 11) + { + orderTime = "10:00 - 11:00"; + } + else if (intHour == 12) + { + orderTime = "11:00 - 12:00"; + } + else if (intHour == 13) + { + orderTime = "12:00 - 13:00"; + } + else if (intHour == 14) + { + orderTime = "13:00 - 14:00"; + } + else if (intHour == 15) + { + orderTime = "14:00 - 15:00"; + } + else if (intHour == 16) + { + orderTime = "15:00 - 16:00"; + } + else if (intHour == 17) + { + orderTime = "16:00 - 17:00"; + } + else if (intHour == 18) + { + orderTime = "17:00 - 18:00"; + } + else if (intHour == 19) + { + orderTime = "18:00 - 19:00"; + } + else if (intHour == 20) + { + orderTime = "19:00 - 20:00"; + } + else if (intHour == 21) + { + orderTime = "20:00 - 21:00"; + } + if (!string.IsNullOrEmpty(orderTime)) + { + b = true; + } + if (b) + { + string lastPlan = @"SELECT p.UsingPlanId FROM dbo.Weld_UsingPlan p + WHERE p.OrderDate listStr = new List(); + listStr.Add(new SqlParameter("@OrderTime", orderTime)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable dt = SQLHelper.GetDataTableRunText(lastPlan, parameter); + if (dt.Rows.Count > 0) + { + for (int i = 0; i < dt.Rows.Count; i++) + { + string usingPlanId = dt.Rows[i]["UsingPlanId"].ToString(); + BLL.UsingPlanService.UpdateIsCancel(usingPlanId, "超时未领用"); + } + } + } } protected void Session_Start(object sender, EventArgs e) diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlan.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlan.aspx index 75afd5b..966bfce 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlan.aspx +++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlan.aspx @@ -129,10 +129,13 @@ - - + + 0) - { - for (int i = 0; i < dt.Rows.Count; i++) - { - string usingPlanId = dt.Rows[i]["UsingPlanId"].ToString(); - BLL.UsingPlanService.UpdateIsCancel(usingPlanId, "超时未领用"); - } - } + //string lastPlan = @"SELECT p.UsingPlanId FROM dbo.Weld_UsingPlan p + // WHERE p.OrderDate 0) + //{ + // for (int i = 0; i < dt.Rows.Count; i++) + // { + // string usingPlanId = dt.Rows[i]["UsingPlanId"].ToString(); + // BLL.UsingPlanService.UpdateIsCancel(usingPlanId, "超时未领用"); + // } + //} // 绑定表格 BindGrid(); @@ -56,7 +56,7 @@ namespace FineUIPro.Web.WeldMat.UsingPlan string projectIds = BLL.Project_UserService.GetStrProjectIds(this.CurrUser.UserId); string strSql = @"SELECT UsingPlan.UsingPlanId, UsingPlan.WeldId, UsingPlan.ProjectId, UsingPlan.UsePosition,TeamGroupId,UsingPlan.STE_Name, unit.UnitName AS UsingUnit,UsingPlan.Amount, UsingPlan.UsingManOne, UsingPlan.InPutDate, - UsingPlan.OrderDate,UsingPlan.OrderTime, UsingPlan.CancelDate,UsingPlan.IsNeedConfirm, + CONVERT(varchar(100), UsingPlan.OrderDate, 23)+' '+UsingPlan.OrderTime as OrderTime, UsingPlan.CancelDate,UsingPlan.IsNeedConfirm, (CASE UsingPlan.IsSteelStru WHEN 1 THEN '是' WHEN 0 THEN '否' ELSE '' END) AS IsSteelStru, (CASE UsingPlan.IsSubmit WHEN 1 THEN '是' WHEN 0 THEN '否' ELSE '' END) AS IsSubmit, (CASE UsingPlan.IsCancel WHEN 1 THEN '是' WHEN 0 THEN '否' ELSE '' END) AS IsCancel, @@ -335,6 +335,12 @@ namespace FineUIPro.Web.WeldMat.UsingPlan var usedMat = BLL.UsingMatService.GetUsingMatByPlanId(id); if (usedMat == null) { + Model.Weld_UsingPlan usingPlan = BLL.UsingPlanService.GetUsingPlanById(id); + if (usingPlan != null && usingPlan.IsCancel == true) + { + Alert.ShowInTop("记录已作废,不能修改!", MessageBoxIcon.Warning); + return; + } PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("UsingPlanEdit.aspx?UsingPlanId={0}", id, "编辑 - "))); } else diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx index bb0ec87..a56700c 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx +++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx @@ -61,6 +61,12 @@ + + + + diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx.cs b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx.cs index 73c5d13..64deb1b 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingSentMat/UsingtMatSelect.aspx.cs @@ -37,6 +37,7 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat string strSql = @"SELECT UsingMat.UsingMatId, UsingMat.ProjectId, UsingMat.UsePosition, UsingMat.WeldId,UsingMat.UsingPlanId,ISNULL(UsingMat.Amount,0) AS Amount, ISNULL(UsingMat.TwoAmount,0) AS TwoAmount,UsingMat.UsingMan, UsingMat.UsingDate, + CONVERT(varchar(100), UsingPlan.OrderDate, 23)+' '+UsingPlan.OrderTime as OrderTime, (CASE WHEN stockIn.Warrantybook IS NOT NULL THEN stockIn.Warrantybook ELSE UsingMat.Warrantybook END) AS Warrantybook,UsingPlan.STE_Name, UsingMat.Number,Project.ProjectCode,Project.ProjectName,WeldInfo.WeldCode, @@ -340,7 +341,7 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat BindGrid(); foreach (GridColumn column in grid.Columns) { - if (column.ColumnIndex < 18) + if (column.ColumnIndex < 20) { sb.AppendFormat("{0}", column.HeaderText); } @@ -352,7 +353,7 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat sb.Append(""); foreach (GridColumn column in grid.Columns) { - if (column.ColumnIndex < 18) + if (column.ColumnIndex < 20) { string html = row.Values[column.ColumnIndex].ToString(); if (column.ColumnID == "tfNumber")