2023-10-12

This commit is contained in:
2023-10-12 19:33:22 +08:00
parent 7d87e48818
commit d1c7977da2
24 changed files with 688 additions and 237 deletions
@@ -41,10 +41,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
BLL.UnitService.GetUnit(this.drpUnitIds, this.CurrUser.LoginProjectId, false);
LoadAuditSelect();
this.agree.Hidden = true;
this.options.Hidden = true;
this.btnSave.Hidden = true;
this.btnSubmit.Hidden = true;
this.options.Hidden = true;
this.DesignChangeOrderId = Request.Params["DesignChangeOrderId"];
Model.Comprehensive_DesignChangeOrder designChangeOrder = BLL.DesignChangeOrderService.GetDesignChangeOrderById(this.DesignChangeOrderId);
if (designChangeOrder != null)
@@ -112,10 +109,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
}
}
}
else
{
@@ -228,14 +228,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
result += (i + 2).ToString() + "," + "标识编号" + "," + "此项为必填项!" + "|";
}
else
{
var view = oldViewInfos.FirstOrDefault(x => x.RemarkCode == row12);
if (view != null)
{
result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row12 + "]已存在!" + "|";
}
}
//else
//{
// var view = oldViewInfos.FirstOrDefault(x => x.RemarkCode == row12);
// if (view != null)
// {
// result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row12 + "]已存在!" + "|";
// }
//}
}
else
@@ -398,7 +398,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
&& x.RemarkCode == pds.Rows[i][12].ToString().Trim()
).FirstOrDefault();
if (oldViewInfo == null)
if (oldViewInfo == null)//新增
{
Model.Comprehensive_InspectionEquipment Ins = new Model.Comprehensive_InspectionEquipment();
Ins.ProjectId = this.CurrUser.LoginProjectId;
@@ -428,9 +428,33 @@ namespace FineUIPro.Web.CQMS.Comprehensive
BLL.InspectionEquipmentService.AddInspectionEquipment(Ins);
}
else
else //修改
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位报验编号已存在!" + "|";
oldViewInfo.ProjectId = this.CurrUser.LoginProjectId;
oldViewInfo.UnitId = unitInfo.UnitId;
oldViewInfo.InspectionCode = pds.Rows[i][1].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][2].ToString().Trim()))
{
oldViewInfo.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][2].ToString().Trim()).CNProfessionalId;
}
oldViewInfo.EquipmentNO = pds.Rows[i][3].ToString().Trim();
oldViewInfo.InspectionName = pds.Rows[i][4].ToString().Trim();
oldViewInfo.Specifications = pds.Rows[i][5].ToString().Trim();
oldViewInfo.Supplier = pds.Rows[i][6].ToString().Trim();
oldViewInfo.Counts = pds.Rows[i][7].ToString().Trim();
oldViewInfo.Unit = pds.Rows[i][8].ToString().Trim();
oldViewInfo.SamplingCount = pds.Rows[i][9].ToString().Trim();
oldViewInfo.SamplingResult = pds.Rows[i][10].ToString().Trim() == "合格" ? "1" : "2";
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
{
oldViewInfo.InspectionDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
}
oldViewInfo.RemarkCode = pds.Rows[i][12].ToString().Trim();
oldViewInfo.CompileMan = this.CurrUser.UserId;
oldViewInfo.CompileDate = DateTime.Now.Date;
BLL.InspectionEquipmentService.UpdateInspectionEquipment(oldViewInfo);
//result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位报验编号已存在!" + "|";
}
}
@@ -25,16 +25,20 @@
<f:DropDownList ID="drpCNProfessionalId" runat="server" Label="专业" LabelAlign="Right" LabelWidth="120px"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<f:FormRow ColumnWidths="50% 25% 25%">
<Items>
<f:TextBox ID="txtInspectionName" runat="server" Label="名称" MaxLength="300" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
<f:TextBox ID="txtSpecifications" runat="server" Label="规格" MaxLength="300" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
<f:TextBox ID="txtSpecifications" runat="server" Label="规格" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
<f:DropDownList ID="drpEquipmentOrMatail" runat="server" Label="设备/材料" LabelAlign="Right" ShowRedStar="true" LabelWidth="120px">
<f:ListItem Value="设备" Text="设备" />
<f:ListItem Value="材料" Text="材料" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="50% 30% 20%">
<f:FormRow ColumnWidths="50% 25% 25%">
<Items>
<f:TextBox ID="txtSupplier" runat="server" Label="供货厂商" MaxLength="300" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
<f:NumberBox ID="txtCounts" Label="本次数量" runat="server" NoDecimal="false" DecimalPrecision="3" NoNegative="true" LabelAlign="Right" LabelWidth="120px">
<f:NumberBox ID="txtCounts" Label="本次数量" runat="server" NoDecimal="false" DecimalPrecision="3" NoNegative="true" LabelAlign="Right" LabelWidth="120px">
</f:NumberBox>
<f:TextBox ID="txtUnit" runat="server" Label="单位" MaxLength="50" LabelAlign="Right" LabelWidth="70px"></f:TextBox>
</Items>
@@ -64,6 +64,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
this.txtCounts.Text = Convert.ToString(inspectionEquipment.Counts);
}
this.txtUnit.Text = inspectionEquipment.Unit;
if (!string.IsNullOrEmpty(inspectionEquipment.EquipmentOrMatail))
{
this.drpEquipmentOrMatail.SelectedValue = inspectionEquipment.EquipmentOrMatail;
}
if (inspectionEquipment.SamplingCount != null)
{
this.txtSamplingCount.Text = Convert.ToString(inspectionEquipment.SamplingCount);
@@ -256,7 +261,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
newInspectionEquipment.Unit = this.txtUnit.Text.Trim();
newInspectionEquipment.SamplingCount = this.txtSamplingCount.Text.Trim();
newInspectionEquipment.UsedPlace = this.txtUsedPlace.Text.Trim();
newInspectionEquipment.EquipmentOrMatail = drpEquipmentOrMatail.SelectedValue;
if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue))
{
newInspectionEquipment.AuditMan = drpAudit.SelectedValue;
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.Comprehensive {
public partial class InspectionEquipmentEdit {
namespace FineUIPro.Web.CQMS.Comprehensive
{
public partial class InspectionEquipmentEdit
{
/// <summary>
/// form1 控件。
/// </summary>
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// drpUnitId 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnitId;
/// <summary>
/// txtInspectionCode 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionCode;
/// <summary>
/// txtEquipmentNo 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentNo;
/// <summary>
/// drpCNProfessionalId 控件。
/// </summary>
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCNProfessionalId;
/// <summary>
/// txtInspectionName 控件。
/// </summary>
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionName;
/// <summary>
/// txtSpecifications 控件。
/// </summary>
@@ -92,7 +94,16 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSpecifications;
/// <summary>
/// drpEquipmentOrMatail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpEquipmentOrMatail;
/// <summary>
/// txtSupplier 控件。
/// </summary>
@@ -101,7 +112,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSupplier;
/// <summary>
/// txtCounts 控件。
/// </summary>
@@ -110,7 +121,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtCounts;
/// <summary>
/// txtUnit 控件。
/// </summary>
@@ -119,7 +130,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUnit;
/// <summary>
/// txtSamplingCount 控件。
/// </summary>
@@ -128,7 +139,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtSamplingCount;
/// <summary>
/// drpSamplingResult 控件。
/// </summary>
@@ -137,7 +148,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpSamplingResult;
/// <summary>
/// drpAttribute 控件。
/// </summary>
@@ -146,7 +157,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpAttribute;
/// <summary>
/// txtInspectionDate 控件。
/// </summary>
@@ -155,7 +166,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtInspectionDate;
/// <summary>
/// txtRemarkCode 控件。
/// </summary>
@@ -164,7 +175,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemarkCode;
/// <summary>
/// txtUsedPlace 控件。
/// </summary>
@@ -173,7 +184,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUsedPlace;
/// <summary>
/// Panel2 控件。
/// </summary>
@@ -182,7 +193,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel2;
/// <summary>
/// Label1 控件。
/// </summary>
@@ -191,7 +202,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// btnAttach 控件。
/// </summary>
@@ -200,7 +211,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttach;
/// <summary>
/// drpAudit 控件。
/// </summary>
@@ -209,7 +220,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpAudit;
/// <summary>
/// agree 控件。
/// </summary>
@@ -218,7 +229,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow agree;
/// <summary>
/// rblIsAgree 控件。
/// </summary>
@@ -227,7 +238,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rblIsAgree;
/// <summary>
/// options 控件。
/// </summary>
@@ -236,7 +247,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FormRow options;
/// <summary>
/// txtidea 控件。
/// </summary>
@@ -245,7 +256,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtidea;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -254,7 +265,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdAttachUrl 控件。
/// </summary>
@@ -263,7 +274,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdAttachUrl;
/// <summary>
/// btnSave 控件。
/// </summary>
@@ -272,7 +283,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnSubmit 控件。
/// </summary>
@@ -281,7 +292,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSubmit;
/// <summary>
/// WindowAtt 控件。
/// </summary>
@@ -431,59 +431,115 @@ namespace FineUIPro.Web.CQMS.Comprehensive
for (int i = 0; i < ir; i++)
{
Model.Comprehensive_InspectionMachine oldViewInfo = new Model.Comprehensive_InspectionMachine();
string row0 = pds.Rows[i][0].ToString().Trim();
var unitInfo = units.Where(y => y.UnitName == row0).FirstOrDefault();
if (unitInfo != null && !string.IsNullOrEmpty(row0))
{
Model.Comprehensive_InspectionMachine Ins = new Model.Comprehensive_InspectionMachine();
Ins.ProjectId = this.CurrUser.LoginProjectId;
Ins.UnitId = unitInfo.UnitId;
Ins.InspectionMachineCode = pds.Rows[i][1].ToString().Trim();
Ins.InspectionMachineName = pds.Rows[i][2].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
Model.Comprehensive_InspectionMachine oldViewInfo = new Model.Comprehensive_InspectionMachine();
oldViewInfo = oldViewInfos.FirstOrDefault(x => x.UnitId == unitInfo.UnitId
&& x.InspectionMachineCode == pds.Rows[i][1].ToString().Trim());
if (oldViewInfo==null)
{
Ins.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][3].ToString().Trim()).CNProfessionalId;
}
Model.Comprehensive_InspectionMachine Ins = new Model.Comprehensive_InspectionMachine();
Ins.ProjectId = this.CurrUser.LoginProjectId;
Ins.UnitId = unitInfo.UnitId;
Ins.InspectionMachineCode = pds.Rows[i][1].ToString().Trim();
Ins.InspectionMachineName = pds.Rows[i][2].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
{
Ins.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][3].ToString().Trim()).CNProfessionalId;
}
if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim()))
{
Ins.InspectionType = pds.Rows[i][4].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim()))
{
Ins.InspectionType = pds.Rows[i][4].ToString().Trim();
}
else
{
Ins.InspectionType = "施工";
}
Ins.SpecificationModel = pds.Rows[i][5].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim()))
{
Ins.NextTestDate = Convert.ToDateTime(pds.Rows[i][6].ToString().Trim());
}
Ins.TestCycle = pds.Rows[i][7].ToString().Trim();
Ins.IsOnSite = pds.Rows[i][8].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
{
Ins.InspectionDate = Convert.ToDateTime(pds.Rows[i][9].ToString().Trim());
}
Ins.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
{
Ins.UnitsCount = Convert.ToInt32(pds.Rows[i][11].ToString().Trim());
}
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
{
Ins.LeaveDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
}
Ins.InspectionMachineId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionMachine));
Ins.CompileMan = this.CurrUser.UserId;
Ins.CompileDate = DateTime.Now.Date;
BLL.InspectionMachineService.AddInspectionMachine(Ins);
}
else
{
Ins.InspectionType = "施工";
oldViewInfo.ProjectId = this.CurrUser.LoginProjectId;
oldViewInfo.UnitId = unitInfo.UnitId;
oldViewInfo.InspectionMachineCode = pds.Rows[i][1].ToString().Trim();
oldViewInfo.InspectionMachineName = pds.Rows[i][2].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
{
oldViewInfo.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][3].ToString().Trim()).CNProfessionalId;
}
if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim()))
{
oldViewInfo.InspectionType = pds.Rows[i][4].ToString().Trim();
}
else
{
oldViewInfo.InspectionType = "施工";
}
oldViewInfo.SpecificationModel = pds.Rows[i][5].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim()))
{
oldViewInfo.NextTestDate = Convert.ToDateTime(pds.Rows[i][6].ToString().Trim());
}
oldViewInfo.TestCycle = pds.Rows[i][7].ToString().Trim();
oldViewInfo.IsOnSite = pds.Rows[i][8].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
{
oldViewInfo.InspectionDate = Convert.ToDateTime(pds.Rows[i][9].ToString().Trim());
}
oldViewInfo.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
{
oldViewInfo.UnitsCount = Convert.ToInt32(pds.Rows[i][11].ToString().Trim());
}
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
{
oldViewInfo.LeaveDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
}
oldViewInfo.CompileMan = this.CurrUser.UserId;
oldViewInfo.CompileDate = DateTime.Now.Date;
BLL.InspectionMachineService.UpdateInspectionMachine(oldViewInfo);
}
Ins.SpecificationModel = pds.Rows[i][5].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim()))
{
Ins.NextTestDate = Convert.ToDateTime(pds.Rows[i][6].ToString().Trim());
}
Ins.TestCycle = pds.Rows[i][7].ToString().Trim();
Ins.IsOnSite = pds.Rows[i][8].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
{
Ins.InspectionDate = Convert.ToDateTime(pds.Rows[i][9].ToString().Trim());
}
Ins.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
{
Ins.UnitsCount = Convert.ToInt32(pds.Rows[i][11].ToString().Trim());
}
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
{
Ins.LeaveDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
}
Ins.InspectionMachineId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionMachine));
Ins.CompileMan = this.CurrUser.UserId;
Ins.CompileDate = DateTime.Now.Date;
BLL.InspectionMachineService.AddInspectionMachine(Ins);
}
else
@@ -181,97 +181,100 @@ namespace FineUIPro.Web.CQMS.Comprehensive
var unitInfo = units.Where(y => y.UnitName == row0).FirstOrDefault();
if (unitInfo != null && !string.IsNullOrEmpty(row0))
{
oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
/*oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
&& x.PersonName == pds.Rows[i][2].ToString().Trim()
&& x.InspectionPersonCode == pds.Rows[i][1].ToString().Trim()
).FirstOrDefault();
if (oldViewInfo == null)
{
string row1 = pds.Rows[i][1].ToString();
if (string.IsNullOrEmpty(row1))
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "此项为必填项!" + "|";
}
string row2 = pds.Rows[i][2].ToString();
if (string.IsNullOrEmpty(row2))
{
result += (i + 2).ToString() + "," + "姓名" + "," + "此项为必填项!" + "|";
}
string row3 = pds.Rows[i][3].ToString();
if (!string.IsNullOrEmpty(row3))
{
var cn = cns.Where(x => x.ProfessionalName == row3.Trim()).FirstOrDefault();
if (cn == null)
{
result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row3 + "]不存在!" + "|";
}
}
string row4 = pds.Rows[i][4].ToString();
if (!string.IsNullOrEmpty(row4))
{
var post = posts.Where(x => x.PostName == row4.Trim()).FirstOrDefault();
if (post == null)
{
result += (i + 2).ToString() + "," + "工种" + "," + "[" + row4 + "]不存在!" + "|";
}
}
string row7 = pds.Rows[i][7].ToString();
if (!string.IsNullOrEmpty(row7))
{
try
{
DateTime date = Convert.ToDateTime(row7.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "有效期" + "," + "[" + row7 + "]错误!" + "|";
}
}
string row8 = pds.Rows[i][8].ToString();
if (!string.IsNullOrEmpty(row8))
{
try
{
DateTime date = Convert.ToDateTime(row8.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "批准时间" + "," + "[" + row8 + "]错误!" + "|";
}
}
string row9 = pds.Rows[i][9].ToString().Trim();
if (!string.IsNullOrEmpty(row9))
{
if (row9 != "是" && row9 != "否")
{
result += (i + 2).ToString() + "," + "是否在场" + "," + "[" + row9 + "]错误!" + "|";
}
}
string row10 = pds.Rows[i][10].ToString();
if (!string.IsNullOrEmpty(row10))
{
try
{
DateTime date = Convert.ToDateTime(row10.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "离场时间" + "," + "[" + row10 + "]错误!" + "|";
}
}
}
else
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位人员报验编号已存在!" + "|";
}*/
string row1 = pds.Rows[i][1].ToString();
if (string.IsNullOrEmpty(row1))
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "此项为必填项!" + "|";
}
string row2 = pds.Rows[i][2].ToString();
if (string.IsNullOrEmpty(row2))
{
result += (i + 2).ToString() + "," + "姓名" + "," + "此项为必填项!" + "|";
}
string row3 = pds.Rows[i][3].ToString();
if (!string.IsNullOrEmpty(row3))
{
var cn = cns.Where(x => x.ProfessionalName == row3.Trim()).FirstOrDefault();
if (cn == null)
{
result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row3 + "]不存在!" + "|";
}
}
string row4 = pds.Rows[i][4].ToString();
if (!string.IsNullOrEmpty(row4))
{
var post = posts.Where(x => x.PostName == row4.Trim()).FirstOrDefault();
if (post == null)
{
result += (i + 2).ToString() + "," + "工种" + "," + "[" + row4 + "]不存在!" + "|";
}
}
string row7 = pds.Rows[i][7].ToString();
if (!string.IsNullOrEmpty(row7))
{
try
{
DateTime date = Convert.ToDateTime(row7.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "有效期" + "," + "[" + row7 + "]错误!" + "|";
}
}
string row8 = pds.Rows[i][8].ToString();
if (!string.IsNullOrEmpty(row8))
{
try
{
DateTime date = Convert.ToDateTime(row8.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "批准时间" + "," + "[" + row8 + "]错误!" + "|";
}
}
string row9 = pds.Rows[i][9].ToString().Trim();
if (!string.IsNullOrEmpty(row9))
{
if (row9 != "是" && row9 != "否")
{
result += (i + 2).ToString() + "," + "是否在场" + "," + "[" + row9 + "]错误!" + "|";
}
}
string row10 = pds.Rows[i][10].ToString();
if (!string.IsNullOrEmpty(row10))
{
try
{
DateTime date = Convert.ToDateTime(row10.Trim());
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "离场时间" + "," + "[" + row10 + "]错误!" + "|";
}
}
}
else
@@ -496,7 +499,83 @@ namespace FineUIPro.Web.CQMS.Comprehensive
}
else
{
result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位人员报验编号已存在!" + "|";
oldViewInfo.ProjectId = this.CurrUser.LoginProjectId;
oldViewInfo.UnitId = unitInfo.UnitId;
oldViewInfo.InspectionPersonCode = pds.Rows[i][1].ToString().Trim();
oldViewInfo.PersonName = pds.Rows[i][2].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
{
oldViewInfo.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][3].ToString().Trim()).CNProfessionalId;
}
if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim()))
{
oldViewInfo.PostId = Funs.DB.Base_Post.First(e => e.PostName == pds.Rows[i][4].ToString().Trim()).PostId;
}
oldViewInfo.CertificateNumber = pds.Rows[i][5].ToString().Trim();
oldViewInfo.QualifiedProjectCode = pds.Rows[i][6].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][7].ToString().Trim()))
{
oldViewInfo.ValidityDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());
}
if (!string.IsNullOrEmpty(pds.Rows[i][8].ToString().Trim()))
{
oldViewInfo.ApprovalTime = Convert.ToDateTime(pds.Rows[i][8].ToString().Trim());
}
oldViewInfo.IsOnSite = pds.Rows[i][9].ToString().Trim() == "是" ? true : false;
if (!string.IsNullOrEmpty(pds.Rows[i][10].ToString().Trim()))
{
oldViewInfo.DepartureTime = Convert.ToDateTime(pds.Rows[i][10].ToString().Trim());
}
oldViewInfo.Remark = pds.Rows[i][11].ToString().Trim();
oldViewInfo.CompileMan = this.CurrUser.UserId;
oldViewInfo.CompileDate = DateTime.Now.Date;
oldViewInfo.IsTrain = true;
BLL.InspectionPersonService.UpdateInspectionPerson(oldViewInfo);
if (pds.Rows[i][4].ToString().Trim() == "焊工")
{
var welder = PersonManageService.GetBSWelderByProjectIdUnitIdAndWED_Code(CurrUser.LoginProjectId, oldViewInfo.UnitId, pds.Rows[i][1].ToString().Trim());
if (welder==null)
{
welder = new Model.BS_Welder();
welder.WED_Unit = oldViewInfo.UnitId;
welder.WED_Name = oldViewInfo.PersonName;
welder.WED_Code = pds.Rows[i][1].ToString().Trim();
welder.LimitDate = oldViewInfo.ValidityDate;
welder.LeaveDate = oldViewInfo.DepartureTime; // Convert.ToDateTime(this.txtDepartureTime.Text.ToString());
welder.PostDate = oldViewInfo.ApprovalTime;// Convert.ToDateTime(this.txtApprovalTime.Text.ToString());
welder.WED_WorkCode = oldViewInfo.CertificateNumber;// this.txtCertificateNumber.Text.Trim();
welder.WED_Class = oldViewInfo.QualifiedProjectCode;// this.txtQualifiedProjectCode.Text.Trim();
welder.WED_IfOnGuard = oldViewInfo.IsOnSite;
welder.WED_Remark = oldViewInfo.Remark;
welder.ProjectId = this.CurrUser.LoginProjectId;
// 焊工部分
BLL.PersonManageService.AddBSWelder(welder);
}
else
{
welder.WED_Unit = oldViewInfo.UnitId;
welder.WED_Name = oldViewInfo.PersonName;
welder.WED_Code = pds.Rows[i][1].ToString().Trim();
welder.LimitDate = oldViewInfo.ValidityDate;
welder.LeaveDate = oldViewInfo.DepartureTime; // Convert.ToDateTime(this.txtDepartureTime.Text.ToString());
welder.PostDate = oldViewInfo.ApprovalTime;// Convert.ToDateTime(this.txtApprovalTime.Text.ToString());
welder.WED_WorkCode = oldViewInfo.CertificateNumber;// this.txtCertificateNumber.Text.Trim();
welder.WED_Class = oldViewInfo.QualifiedProjectCode;// this.txtQualifiedProjectCode.Text.Trim();
welder.WED_IfOnGuard = oldViewInfo.IsOnSite;
welder.WED_Remark = oldViewInfo.Remark;
welder.ProjectId = this.CurrUser.LoginProjectId;
// 焊工部分
BLL.PersonManageService.UpdateBSWelder(welder);
}
}
//result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位人员报验编号已存在!" + "|";
}
}
else
@@ -43,8 +43,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
this.agree.Hidden = true;
this.options.Hidden = true;
this.btnSave.Hidden = true;
this.btnSubmit.Hidden = true;
this.NCRManagementId = Request.Params["NCRManagementId"];
Model.Comprehensive_NCRManagement nCRManagement = BLL.NCRManagementService.GetNCRManagementById(this.NCRManagementId);
if (nCRManagement != null)