This commit is contained in:
gaofei
2021-08-13 11:15:59 +08:00
parent 43acc57060
commit d8dff88c39
320 changed files with 37219 additions and 4678 deletions
@@ -36,8 +36,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
GetButtonPower();
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true);
BLL.UnitWorkService.InitUnitWorkDownList(this.drpUnitWorkIds, this.CurrUser.LoginProjectId, false);
BLL.UnitService.InitUnitDownList(this.drpUnitIds, this.CurrUser.LoginProjectId, false);
BLL.UnitService.GetUnit(this.drpUnitIds, this.CurrUser.LoginProjectId, false);
this.DesignDrawingsId = Request.Params["DesignDrawingsId"];
Model.Comprehensive_DesignDrawings designDrawings = BLL.DesignDrawingsService.GetDesignDrawingsById(this.DesignDrawingsId);
if (designDrawings != null)
@@ -58,12 +58,13 @@
<f:RenderField ColumnID="InspectionCode" DataField="InspectionCode" FieldType="String" HeaderText="报验编号" TextAlign="Center"
HeaderTextAlign="Center" Width="150px">
</f:RenderField>
<f:RenderField ColumnID="EquipmentNO" DataField="EquipmentNO" FieldType="String" HeaderText="设备位号" TextAlign="Center"
HeaderTextAlign="Center" Width="150px">
</f:RenderField>
<f:RenderField ColumnID="ProfessionalName" DataField="ProfessionalName" FieldType="String" HeaderText="专业" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="EquipmentOrMatail" DataField="EquipmentOrMatail" FieldType="String" HeaderText="设备/材料" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField ColumnID="InspectionName" DataField="InspectionName" FieldType="String" HeaderText="名称" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
@@ -31,7 +31,7 @@ namespace FineUIPro.Web.Comprehensive
/// </summary>
public void BindGrid()
{
string strSql = @"select InspectionEquipmentId,ProjectId,C.UnitId, U.UnitName,InspectionCode,CN.ProfessionalName,InspectionName,Specifications,
string strSql = @"select InspectionEquipmentId,ProjectId,C.UnitId, U.UnitName,InspectionCode,CN.ProfessionalName,EquipmentOrMatail,InspectionName,Specifications,
Supplier,Counts,SamplingCount,(CASE WHEN SamplingResult=1 THEN '合格' WHEN SamplingResult=0 THEN '不合格' ELSE '' END) AS SamplingResult,
InspectionDate,AttachUrl,Attribute,RemarkCode,UsedPlace,EquipmentNO from Comprehensive_InspectionEquipment C
left join Base_Unit U on C.UnitId=U.UnitId
@@ -187,15 +187,32 @@ namespace FineUIPro.Web.CQMS.Comprehensive
result += (i + 2).ToString() + "," + "报验编号" + "," + "此项为必填项!" + "|";
}
string row3 = pds.Rows[i][3].ToString();
if (!string.IsNullOrEmpty(row3))
string row2 = pds.Rows[i][2].ToString();
if (!string.IsNullOrEmpty(row2))
{
var cn = cns.Where(x => x.ProfessionalName == row3.Trim()).FirstOrDefault();
var cn = cns.Where(x => x.ProfessionalName == row2.Trim()).FirstOrDefault();
if (cn == null)
{
result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row3 + "]不存在!" + "|";
result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row2 + "]不存在!" + "|";
}
}
else
{
result += (i + 2).ToString() + "," + "专业名称" + "," + "此项为必填项!" + "|";
}
string row3 = pds.Rows[i][3].ToString().Trim();
if (!string.IsNullOrEmpty(row3))
{
if (row3 != "设备" && row3 != "材料")
{
result += (i + 2).ToString() + "," + "设备/材料" + "," + "[" + row2 + "]错误!" + "|";
}
}
else
{
result += (i + 2).ToString() + "," + "设备/材料" + "," + "此项为必填项!" + "|";
}
string row9 = pds.Rows[i][9].ToString().Trim();
if (!string.IsNullOrEmpty(row9))
@@ -244,7 +261,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
errorInfos.Clear();
if (!string.IsNullOrEmpty(result))
{
string results = result;
List<string> errorInfoList = results.Split('|').ToList();
foreach (var item in errorInfoList)
@@ -393,31 +410,31 @@ namespace FineUIPro.Web.CQMS.Comprehensive
// ).FirstOrDefault();
//if (oldViewInfo == null)
//{
Model.Comprehensive_InspectionEquipment Ins = new Model.Comprehensive_InspectionEquipment();
Ins.ProjectId = this.CurrUser.LoginProjectId;
Ins.UnitId = unitInfo.UnitId;
Ins.InspectionCode = pds.Rows[i][1].ToString().Trim();
Ins.EquipmentNO = 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;
}
Ins.InspectionName = pds.Rows[i][4].ToString().Trim();
Ins.Specifications = pds.Rows[i][5].ToString().Trim();
Ins.Supplier = pds.Rows[i][6].ToString().Trim();
Ins.Counts = pds.Rows[i][7].ToString().Trim();
Ins.SamplingCount = pds.Rows[i][8].ToString().Trim();
Ins.SamplingResult = pds.Rows[i][9].ToString().Trim() == "合格" ? "1" : "2";
Model.Comprehensive_InspectionEquipment Ins = new Model.Comprehensive_InspectionEquipment();
Ins.ProjectId = this.CurrUser.LoginProjectId;
Ins.UnitId = unitInfo.UnitId;
Ins.InspectionCode = pds.Rows[i][1].ToString().Trim();
if (!string.IsNullOrEmpty(pds.Rows[i][2].ToString().Trim()))
{
Ins.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][2].ToString().Trim()).CNProfessionalId;
}
Ins.EquipmentOrMatail = pds.Rows[i][3].ToString().Trim();
Ins.InspectionName = pds.Rows[i][4].ToString().Trim();
Ins.Specifications = pds.Rows[i][5].ToString().Trim();
Ins.Supplier = pds.Rows[i][6].ToString().Trim();
Ins.Counts = pds.Rows[i][7].ToString().Trim();
Ins.SamplingCount = pds.Rows[i][8].ToString().Trim();
Ins.SamplingResult = pds.Rows[i][9].ToString().Trim() == "合格" ? "1" : "2";
if (!string.IsNullOrEmpty(pds.Rows[i][10].ToString().Trim()))
{
Ins.InspectionDate = Convert.ToDateTime(pds.Rows[i][10].ToString().Trim());
}
Ins.RemarkCode = pds.Rows[i][11].ToString().Trim();
Ins.InspectionEquipmentId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionEquipment));
Ins.CompileMan = this.CurrUser.UserId;
Ins.CompileDate = DateTime.Now.Date;
BLL.InspectionEquipmentService.AddInspectionEquipment(Ins);
if (!string.IsNullOrEmpty(pds.Rows[i][10].ToString().Trim()))
{
Ins.InspectionDate = Convert.ToDateTime(pds.Rows[i][10].ToString().Trim());
}
Ins.RemarkCode = pds.Rows[i][11].ToString().Trim();
Ins.InspectionEquipmentId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionEquipment));
Ins.CompileMan = this.CurrUser.UserId;
Ins.CompileDate = DateTime.Now.Date;
BLL.InspectionEquipmentService.AddInspectionEquipment(Ins);
//}
//else
@@ -431,7 +448,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
result += (i + 2).ToString() + "," + "单位名称" + "," + "[" + row0 + "]不存在!" + "|";
}
}
}
else
{
@@ -21,8 +21,12 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtEquipmentNo" runat="server" Label="设备位号" MaxLength="50" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
<f:DropDownList ID="drpCNProfessionalId" runat="server" Label="专业" LabelAlign="Right" LabelWidth="120px"></f:DropDownList>
<f:DropDownList ID="drpCNProfessionalId" runat="server" Label="专业" LabelAlign="Right" ShowRedStar="true" LabelWidth="120px"></f:DropDownList>
<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>
@@ -37,7 +37,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
BLL.UnitService.InitUnitDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true);
BLL.InspectionEquipmentService.InitAttributeDropDownList(this.drpAttribute, true);
Funs.FineUIPleaseSelect(this.drpEquipmentOrMatail);
this.InspectionEquipmentId = Request.Params["InspectionEquipmentId"];
var inspectionEquipment = BLL.InspectionEquipmentService.GetInspectionEquipmentById(this.InspectionEquipmentId);
if (inspectionEquipment != null)
@@ -53,6 +53,10 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
this.drpCNProfessionalId.SelectedValue = inspectionEquipment.CNProfessionalId;
}
if (!string.IsNullOrEmpty(inspectionEquipment.EquipmentOrMatail))
{
this.drpEquipmentOrMatail.SelectedValue = inspectionEquipment.EquipmentOrMatail;
}
this.txtInspectionName.Text = inspectionEquipment.InspectionName;
this.txtSpecifications.Text = inspectionEquipment.Specifications;
this.txtSupplier.Text = inspectionEquipment.Supplier;
@@ -74,7 +78,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
}
this.txtInspectionDate.Text = inspectionEquipment.InspectionDate.HasValue ? string.Format("{0:yyyy-MM-dd}", inspectionEquipment.InspectionDate) : "";
this.txtRemarkCode.Text = inspectionEquipment.RemarkCode;
this.txtEquipmentNo.Text = inspectionEquipment.EquipmentNO;
this.txtUsedPlace.Text = inspectionEquipment.UsedPlace;
}
else
@@ -98,6 +101,16 @@ namespace FineUIPro.Web.CQMS.Comprehensive
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
return;
}
if (this.drpCNProfessionalId.SelectedValue == BLL.Const._Null)
{
Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning);
return;
}
if (this.drpEquipmentOrMatail.SelectedValue == BLL.Const._Null)
{
Alert.ShowInTop("请选择设备/材料!", MessageBoxIcon.Warning);
return;
}
Model.Comprehensive_InspectionEquipment newInspectionEquipment = new Model.Comprehensive_InspectionEquipment();
newInspectionEquipment.ProjectId = this.CurrUser.LoginProjectId;
newInspectionEquipment.UnitId = this.drpUnitId.SelectedValue;
@@ -109,7 +122,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
newInspectionEquipment.InspectionName = this.txtInspectionName.Text.Trim();
newInspectionEquipment.Specifications = this.txtSpecifications.Text.Trim();
newInspectionEquipment.Supplier = this.txtSupplier.Text.Trim();
newInspectionEquipment.EquipmentNO = this.txtEquipmentNo.Text.Trim();
newInspectionEquipment.EquipmentOrMatail = this.drpEquipmentOrMatail.SelectedValue;
newInspectionEquipment.RemarkCode = this.txtRemarkCode.Text.Trim();
newInspectionEquipment.Counts = this.txtCounts.Text.Trim();
newInspectionEquipment.SamplingCount = this.txtSamplingCount.Text.Trim();
@@ -57,15 +57,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionCode;
/// <summary>
/// txtEquipmentNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentNo;
/// <summary>
/// drpCNProfessionalId 控件。
/// </summary>
@@ -75,6 +66,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
/// </remarks>
protected global::FineUIPro.DropDownList drpCNProfessionalId;
/// <summary>
/// drpEquipmentOrMatail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpEquipmentOrMatail;
/// <summary>
/// txtInspectionName 控件。
/// </summary>
@@ -96,7 +96,7 @@
<PageItems>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true">
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged1" AutoPostBack="true">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
@@ -292,7 +292,7 @@ namespace FineUIPro.Web.Comprehensive
{
lbfAction1.Enabled = true;
}
else
else
{
lbfAction1.Enabled = false;
}
@@ -329,5 +329,11 @@ namespace FineUIPro.Web.Comprehensive
Response.End();
}
#endregion
protected void ddlPageSize_SelectedIndexChanged1(object sender, EventArgs e)
{
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
BindGrid();
}
}
}