2023-11-13
This commit is contained in:
@@ -8,7 +8,7 @@ using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web.UI.DataVisualization.Charting;
|
||||
|
||||
using System.Threading.Tasks;
|
||||
namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
{
|
||||
public partial class WeldReportEdit : PageBase
|
||||
@@ -253,7 +253,8 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
}
|
||||
//dt = this.LINQToDataTable(task);
|
||||
}
|
||||
|
||||
|
||||
task = task.OrderBy(x => x.PipelineCode).ThenBy(x => x.WeldJointNum).ToList();
|
||||
Grid1.RecordCount = task.Count;
|
||||
Grid1.DataSource = task;
|
||||
Grid1.DataBind();
|
||||
@@ -322,33 +323,23 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
return StateName;
|
||||
}
|
||||
#region 焊接日报 提交事件
|
||||
/// <summary>
|
||||
/// 编辑焊接日报
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
// 检查用户权限
|
||||
private bool HasPermission()
|
||||
{
|
||||
return CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId, Const.HJGL_WeldTaskMenuId, Const.BtnSave);
|
||||
}
|
||||
// 获取焊接信息
|
||||
private List<Model.View_HJGL_WeldJoint> GetWeldJointView()
|
||||
{
|
||||
return Funs.DB.View_HJGL_WeldJoint
|
||||
.Where(x => x.WeldingDailyId == WeldingDailyId)
|
||||
.OrderBy(x => x.PipelineCode)
|
||||
.ThenBy(x => x.WeldJointCode)
|
||||
.ToList();
|
||||
}
|
||||
// 创建新的焊接日报
|
||||
private Model.HJGL_WeldingDaily CreateNewWeldingDaily()
|
||||
{
|
||||
if (!CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, this.CurrUser.PersonId,
|
||||
Const.HJGL_WeldTaskMenuId, Const.BtnSave))
|
||||
{
|
||||
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (BLL.WeldingDailyService.IsExistWeldingDailyCode(this.txtWeldingDailyCode.Text,
|
||||
!string.IsNullOrEmpty(this.WeldingDailyId) ? this.WeldingDailyId : "", CurrUser.LoginProjectId))
|
||||
{
|
||||
ShowNotify("日报编号已存在,请重新录入", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(this.txtWeldingDate.Text) ||
|
||||
string.IsNullOrEmpty(this.txtWeldingDailyCode.Text.Trim()))
|
||||
{
|
||||
ShowNotify("日报告号、焊接日期不能为空", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
Model.HJGL_WeldingDaily newWeldingDaily = new Model.HJGL_WeldingDaily
|
||||
{
|
||||
WeldingDailyCode = this.txtWeldingDailyCode.Text.Trim(),
|
||||
@@ -364,14 +355,11 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
{
|
||||
newWeldingDaily.UnitWorkId = this.drpUnitWork.SelectedValue;
|
||||
}
|
||||
|
||||
//List<Model.SpWeldingDailyItem> GetWeldingDailyItem = this.CollectGridJointInfo();
|
||||
string errlog = string.Empty;
|
||||
var weldJointView = (from x in BLL.Funs.DB.View_HJGL_WeldJoint where x.WeldingDailyId == this.WeldingDailyId orderby x.PipelineCode, x.WeldJointCode
|
||||
select x).ToList();
|
||||
|
||||
string eventArg = string.Empty;
|
||||
|
||||
return newWeldingDaily;
|
||||
}
|
||||
//焊工资质判断
|
||||
private void CheckWelderQualification()
|
||||
{
|
||||
#region 焊工资质判断这里取消
|
||||
|
||||
//foreach (var item in GetWeldingDailyItem)
|
||||
@@ -464,7 +452,43 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
//}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑焊接日报
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!HasPermission())
|
||||
{
|
||||
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (BLL.WeldingDailyService.IsExistWeldingDailyCode(this.txtWeldingDailyCode.Text,
|
||||
!string.IsNullOrEmpty(this.WeldingDailyId) ? this.WeldingDailyId : "", CurrUser.LoginProjectId))
|
||||
{
|
||||
ShowNotify("日报编号已存在,请重新录入", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(this.txtWeldingDate.Text) ||
|
||||
string.IsNullOrEmpty(this.txtWeldingDailyCode.Text.Trim()))
|
||||
{
|
||||
ShowNotify("日报告号、焊接日期不能为空", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
// 创建新的焊接日报
|
||||
var newWeldingDaily = CreateNewWeldingDaily();
|
||||
// 获取焊接信息
|
||||
var weldJointView = GetWeldJointView();
|
||||
|
||||
string errlog = string.Empty;
|
||||
string eventArg = string.Empty;
|
||||
// 焊工资质判断
|
||||
// CheckWelderQualification(weldJointView);
|
||||
|
||||
if (eventArg == string.Empty) //焊工焊接的所有焊口资质都符合要求)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.WeldingDailyId))
|
||||
@@ -646,9 +670,11 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
|
||||
|
||||
#endregion
|
||||
|
||||
ChanggeState(); //更新焊口属性
|
||||
|
||||
//更新焊口属性
|
||||
System.Threading.Tasks.Task.Run(() =>
|
||||
{
|
||||
ChanggeState();
|
||||
});
|
||||
|
||||
if (string.IsNullOrEmpty(errlog))
|
||||
{
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
|
||||
Reference in New Issue
Block a user