20240429 修改综合管理导入导出
This commit is contained in:
@@ -239,7 +239,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initTemplatePath = Const.ConTechnologyDisclosureTempUrl;
|
||||
string initTemplatePath = Const.ConTechnologyDisclosureTemUrl;
|
||||
string uploadfilepath = string.Empty;
|
||||
string newUrl = string.Empty;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
@@ -259,10 +259,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
lists = lists.Where(x => x.DisclosureCode.Contains(this.txtCode.Text.Trim()));
|
||||
}
|
||||
lists = lists.OrderBy(x => x.UnitId);
|
||||
lists = lists.OrderBy(x => x.RemarkCode);
|
||||
if (lists != null)
|
||||
{
|
||||
newUrl = uploadfilepath.Replace("施工技术交底管理模板.xls", "施工技术交底管理.xls");
|
||||
string projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
|
||||
newUrl = uploadfilepath.Replace("施工技术交底管理导入模板", "施工技术交底管理("+projectName+DateTime.Now.ToString("yyyyMMdd")+")");
|
||||
File.Copy(uploadfilepath, newUrl);
|
||||
// 第一步:读取文件流
|
||||
NPOI.SS.UserModel.IWorkbook workbook;
|
||||
@@ -297,7 +298,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||
NPOI.SS.UserModel.ICell cell;
|
||||
int i = 1;
|
||||
int i = 2;
|
||||
foreach (var item in lists)
|
||||
{
|
||||
// 第二步:创建新数据行
|
||||
@@ -350,6 +351,10 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
cell = row.CreateCell(7);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.AttendMan);//参加人员
|
||||
|
||||
cell = row.CreateCell(8);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||
i++;
|
||||
}
|
||||
// 第三步:写入文件流
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString();
|
||||
if (string.IsNullOrEmpty(row0))
|
||||
@@ -246,6 +246,17 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
int t = Convert.ToInt32(row8);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row8 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
@@ -395,13 +406,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_ConTechnologyDisclosure oldViewInfo = new Model.Comprehensive_ConTechnologyDisclosure();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
string row3 = pds.Rows[i][3].ToString().Trim();
|
||||
var cn = cns.Where(y => y.ProfessionalName == row0).FirstOrDefault();
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == pds.Rows[i][8].ToString().Trim()
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode ==Funs.GetNewInt( pds.Rows[i][8].ToString().Trim())
|
||||
).FirstOrDefault();
|
||||
if (oldViewInfo == null)
|
||||
{
|
||||
@@ -419,7 +430,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
des.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][6].ToString().Trim());
|
||||
}
|
||||
des.AttendMan = pds.Rows[i][7].ToString().Trim();
|
||||
des.RemarkCode = pds.Rows[i][8].ToString().Trim();
|
||||
des.RemarkCode =Funs.GetNewInt( pds.Rows[i][8].ToString().Trim());
|
||||
des.CompileMan = this.CurrUser.UserId;
|
||||
des.CompileDate = DateTime.Now;
|
||||
BLL.ConTechnologyDisclosureService.AddConTechnologyDisclosure(des);
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpUnitWorkIds" runat="server" Label="单位工程名称" EnableCheckBoxSelect="true" EnableMultiSelect="true" LabelWidth="130px" AutoSelectFirstItem="false" LabelAlign="Right"></f:DropDownList>
|
||||
<f:NumberBox ID="txtRemarkCode" runat="server" Label="标志编号" LabelAlign="Right" LabelWidth="130px" Required="true" ShowRedStar="true" NoDecimal="true" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
this.drpUnitWorkIds.SelectedValueArray = con.UnitWorkId.Split(',');
|
||||
}
|
||||
this.txtAttendMan.Text = con.AttendMan;
|
||||
this.txtRemarkCode.Text = con.RemarkCode.HasValue ? con.RemarkCode.ToString() : "";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -91,6 +92,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
Alert.ShowInTop("请选择交底负责单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var q = Funs.DB.Comprehensive_ConTechnologyDisclosure.FirstOrDefault(x => x.RemarkCode == Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.ConTechnologyDisclosureId != this.ConTechnologyDisclosureId || (this.ConTechnologyDisclosureId == null && x.ConTechnologyDisclosureId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
Model.Comprehensive_ConTechnologyDisclosure newCon = new Model.Comprehensive_ConTechnologyDisclosure();
|
||||
newCon.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newCon.CNProfessionalId = this.drpCNProfessionalId.SelectedValue;
|
||||
@@ -112,6 +121,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
newCon.UnitWorkId = ids;
|
||||
newCon.AttendMan = this.txtAttendMan.Text.Trim();
|
||||
newCon.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||
|
||||
if (string.IsNullOrEmpty(this.ConTechnologyDisclosureId))
|
||||
{
|
||||
|
||||
+9
@@ -102,6 +102,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnitWorkIds;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemarkCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtAttendMan 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="资料收发文登记记录" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="DataReceivingDocId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="DataReceivingDocId" AllowSorting="true" SortField="FileCode"
|
||||
ClicksToEdit="2" DataIDField="DataReceivingDocId" AllowSorting="true" SortField="RemarkCode"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
||||
|
||||
@@ -54,7 +54,8 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
doc.CompileMan,
|
||||
doc.CompileDate,
|
||||
doc.Status,
|
||||
cnp.ProfessionalName "
|
||||
cnp.ProfessionalName,
|
||||
doc.RemarkCode "
|
||||
+ @" FROM Comprehensive_DataReceivingDoc AS doc"
|
||||
+ @" LEFT JOIN Base_CNProfessional AS cnp ON cnp.CNProfessionalId = doc.CNProfessionalId"
|
||||
+ @" WHERE doc.ProjectId = @ProjectId";
|
||||
@@ -514,7 +515,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
cell = row.CreateCell(19);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.RemarkCode);//标志编号
|
||||
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
for (int i = 2; i < ir; i++)
|
||||
{
|
||||
@@ -276,7 +276,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
result += (i + 2).ToString() + "," + "上报日期" + "," + "格式错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string row10 = pds.Rows[i][10].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row10))
|
||||
{
|
||||
@@ -355,7 +355,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
string row18 = pds.Rows[i][18].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row18))
|
||||
{
|
||||
{
|
||||
if (row18 != "是" && row18 != "否")
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "是否存档" + "," + "[" + row18 + "]错误!" + "|";
|
||||
@@ -367,6 +367,17 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
int c = Convert.ToInt32(row19);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row19 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
@@ -517,7 +528,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
var cn = cns.Where(y => y.ProfessionalName == pds.Rows[i][4].ToString().Trim()).FirstOrDefault();
|
||||
var unit = units.Where(y => y.UnitName == pds.Rows[i][5].ToString().Trim()).FirstOrDefault();
|
||||
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == pds.Rows[i][19].ToString().Trim()
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == Funs.GetNewInt(pds.Rows[i][19].ToString().Trim())
|
||||
).FirstOrDefault();
|
||||
if (oldViewInfo == null)
|
||||
{
|
||||
@@ -569,7 +580,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
des.IsOnFile = false;
|
||||
}
|
||||
}
|
||||
des.RemarkCode = pds.Rows[i][19].ToString().Trim();
|
||||
des.RemarkCode = Funs.GetNewInt(pds.Rows[i][19].ToString().Trim());
|
||||
des.CompileMan = this.CurrUser.UserId;
|
||||
des.CompileDate = DateTime.Now;
|
||||
BLL.DataReceivingDocService.AddDataReceivingDoc(des);
|
||||
|
||||
@@ -117,7 +117,8 @@
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtRemarkCode" runat="server" Label="标志编号" Required="true" ShowRedStar="true" LabelAlign="Right" LabelWidth="130px"></f:TextBox>
|
||||
<%--<f:TextBox ID="txtRemarkCode" runat="server" Label="标志编号" Required="true" ShowRedStar="true" LabelAlign="Right" LabelWidth="130px"></f:TextBox>--%>
|
||||
<f:NumberBox ID="txtRemarkCode" runat="server" Label="标志编号" Required="true" ShowRedStar="true" LabelAlign="Right" LabelWidth="130px" NoDecimal="true" NoNegative="true"></f:NumberBox>
|
||||
<f:Label ID="Label1" runat="server"></f:Label>
|
||||
<f:Label ID="Label3" runat="server"></f:Label>
|
||||
</Items>
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
this.rblIsOnFile.SelectedValue = "false";
|
||||
}
|
||||
}
|
||||
this.txtRemarkCode.Text = dataReceivingDoc.RemarkCode;
|
||||
this.txtRemarkCode.Text = dataReceivingDoc.RemarkCode.HasValue ? dataReceivingDoc.RemarkCode.ToString() : "";
|
||||
|
||||
//var currApprove = DataReceivingDocApproveService.GetCurrentApprove(dataReceivingDoc.DataReceivingDocId);
|
||||
//if (currApprove != null)
|
||||
@@ -212,7 +212,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var q = Funs.DB.Comprehensive_DataReceivingDoc.FirstOrDefault(x => x.RemarkCode == this.txtRemarkCode.Text.Trim() && (x.DataReceivingDocId != this.DataReceivingDocId || (this.DataReceivingDocId == null && x.DataReceivingDocId != null)));
|
||||
var q = Funs.DB.Comprehensive_DataReceivingDoc.FirstOrDefault(x => x.RemarkCode ==Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.DataReceivingDocId != this.DataReceivingDocId || (this.DataReceivingDocId == null && x.DataReceivingDocId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
||||
@@ -274,7 +274,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
dataReceivingDoc.IsOnFile = Convert.ToBoolean(this.rblIsOnFile.SelectedValue);
|
||||
}
|
||||
dataReceivingDoc.RemarkCode = this.txtRemarkCode.Text.Trim();
|
||||
dataReceivingDoc.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||
//if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue))
|
||||
//{
|
||||
// dataReceivingDoc.AuditMan = drpAudit.SelectedValue;
|
||||
|
||||
+1
-1
@@ -271,7 +271,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemarkCode;
|
||||
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="设备材料报验" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="InspectionEquipmentId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="InspectionEquipmentId" AllowSorting="true" SortField="InspectionCode"
|
||||
ClicksToEdit="2" DataIDField="InspectionEquipmentId" AllowSorting="true" SortField="RemarkCode"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
||||
|
||||
@@ -282,7 +282,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initTemplatePath = Const.InspectionEquipmentTempUrl;
|
||||
string initTemplatePath = Const.InspectionEquipmentDataInUrl;
|
||||
string uploadfilepath = string.Empty;
|
||||
string newUrl = string.Empty;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
@@ -306,10 +306,11 @@ namespace FineUIPro.Web.Comprehensive
|
||||
{
|
||||
lists = lists.Where(x => x.InspectionDate <= Funs.GetNewDateTime(txtEndTime.Text.Trim()));
|
||||
}
|
||||
lists = lists.OrderBy(x => x.UnitId);
|
||||
lists = lists.OrderBy(x => x.RemarkCode);
|
||||
if (lists != null)
|
||||
{
|
||||
newUrl = uploadfilepath.Replace("设备材料报验模板.xls", "设备材料报验.xls");
|
||||
var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
|
||||
newUrl = uploadfilepath.Replace("设备材料报验导入模板", "设备材料报验(" + projectName + "" + DateTime.Now.ToString("yyyyMMdd") + ")");
|
||||
File.Copy(uploadfilepath, newUrl);
|
||||
// 第一步:读取文件流
|
||||
NPOI.SS.UserModel.IWorkbook workbook;
|
||||
@@ -344,7 +345,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||
NPOI.SS.UserModel.ICell cell;
|
||||
int i = 1;
|
||||
int i = 2;
|
||||
foreach (var item in lists)
|
||||
{
|
||||
// 第二步:创建新数据行
|
||||
@@ -360,10 +361,6 @@ namespace FineUIPro.Web.Comprehensive
|
||||
|
||||
cell = row.CreateCell(2);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.EquipmentNO);//设备位号
|
||||
|
||||
cell = row.CreateCell(3);
|
||||
cell.CellStyle = cellStyle;
|
||||
var cnp = BLL.CNProfessionalService.GetCNProfessional(item.CNProfessionalId);
|
||||
if (cnp != null)
|
||||
{
|
||||
@@ -374,6 +371,10 @@ namespace FineUIPro.Web.Comprehensive
|
||||
cell.SetCellValue(string.Empty);//专业
|
||||
}
|
||||
|
||||
cell = row.CreateCell(3);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.EquipmentNO);//设备位号
|
||||
|
||||
cell = row.CreateCell(4);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.InspectionName);//名称
|
||||
@@ -422,6 +423,10 @@ namespace FineUIPro.Web.Comprehensive
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.UsedPlace);//拟使用部位
|
||||
|
||||
cell = row.CreateCell(13);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||
|
||||
i++;
|
||||
}
|
||||
// 第三步:写入文件流
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL(ds.Tables[0], 13);
|
||||
AddDatasetToSQL(ds.Tables[0], 14);
|
||||
hdCheckResult.Text = "1";
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -173,7 +173,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_InspectionEquipment oldViewInfo = new Model.Comprehensive_InspectionEquipment();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
@@ -223,21 +223,23 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
}
|
||||
|
||||
string row12 = pds.Rows[i][12].ToString();
|
||||
if (string.IsNullOrEmpty(row12))
|
||||
string row13 = pds.Rows[i][13].ToString();
|
||||
if (string.IsNullOrEmpty(row13))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标识编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// var view = oldViewInfos.FirstOrDefault(x => x.RemarkCode == row12);
|
||||
// if (view != null)
|
||||
// {
|
||||
// result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row12 + "]已存在!" + "|";
|
||||
// }
|
||||
//}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
int t = Convert.ToInt32(row13);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row13 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "报验单位" + "," + "[" + row0 + "]不存在!" + "|";
|
||||
@@ -349,7 +351,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL2(ds.Tables[0], 13);
|
||||
AddDatasetToSQL2(ds.Tables[0], 14);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -388,7 +390,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_InspectionEquipment oldViewInfo = new Model.Comprehensive_InspectionEquipment();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
@@ -396,7 +398,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
if (unitInfo != null && !string.IsNullOrEmpty(row0))
|
||||
{
|
||||
oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
|
||||
&& x.RemarkCode == pds.Rows[i][12].ToString().Trim()
|
||||
&& x.RemarkCode ==Funs.GetNewInt(pds.Rows[i][13].ToString().Trim())
|
||||
).FirstOrDefault();
|
||||
if (oldViewInfo == null)//新增
|
||||
{
|
||||
@@ -421,11 +423,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
Ins.InspectionDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
|
||||
}
|
||||
Ins.RemarkCode = pds.Rows[i][12].ToString().Trim();
|
||||
Ins.UsedPlace = pds.Rows[i][12].ToString().Trim();
|
||||
Ins.RemarkCode =Funs.GetNewInt(pds.Rows[i][13].ToString().Trim());
|
||||
Ins.InspectionEquipmentId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionEquipment));
|
||||
Ins.CompileMan = this.CurrUser.UserId;
|
||||
Ins.CompileDate = DateTime.Now.Date;
|
||||
Ins.Status = BLL.Const.Comprehensive_Complete;
|
||||
Ins.Status = BLL.Const.Comprehensive_Compile;
|
||||
BLL.InspectionEquipmentService.AddInspectionEquipment(Ins);
|
||||
|
||||
}
|
||||
@@ -451,10 +454,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
oldViewInfo.InspectionDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
|
||||
}
|
||||
oldViewInfo.RemarkCode = pds.Rows[i][12].ToString().Trim();
|
||||
oldViewInfo.UsedPlace= pds.Rows[i][12].ToString().Trim();
|
||||
oldViewInfo.RemarkCode =Funs.GetNewInt(pds.Rows[i][13].ToString().Trim());
|
||||
oldViewInfo.CompileMan = this.CurrUser.UserId;
|
||||
oldViewInfo.CompileDate = DateTime.Now.Date;
|
||||
oldViewInfo.Status = BLL.Const.Comprehensive_Complete;
|
||||
oldViewInfo.Status = BLL.Const.Comprehensive_Compile;
|
||||
BLL.InspectionEquipmentService.UpdateInspectionEquipment(oldViewInfo);
|
||||
//result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位报验编号已存在!" + "|";
|
||||
}
|
||||
@@ -476,7 +480,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
#region 下载模板
|
||||
/// <summary>
|
||||
/// 下载模板按钮
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtRemarkCode" runat="server" Label="标识编号" MaxLength="50" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
|
||||
<f:NumberBox ID="txtRemarkCode" runat="server" Label="标识编号" LabelAlign="Right" LabelWidth="120px" Required="true" ShowRedStar="true" NoDecimal="true" NoNegative="true"></f:NumberBox>
|
||||
<f:TextBox ID="txtUsedPlace" runat="server" Label="拟使用部位" MaxLength="100" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
this.drpSamplingResult.SelectedValue = inspectionEquipment.SamplingResult;
|
||||
}
|
||||
this.txtInspectionDate.Text = inspectionEquipment.InspectionDate.HasValue ? string.Format("{0:yyyy-MM-dd}", inspectionEquipment.InspectionDate) : "";
|
||||
this.txtRemarkCode.Text = inspectionEquipment.RemarkCode;
|
||||
this.txtRemarkCode.Text = inspectionEquipment.RemarkCode.HasValue ? inspectionEquipment.RemarkCode.ToString() : "";
|
||||
this.txtEquipmentNo.Text = inspectionEquipment.EquipmentNO;
|
||||
this.txtUsedPlace.Text = inspectionEquipment.UsedPlace;
|
||||
var currApprove = InspectionEquipmentApproveService.GetCurrentApprove(inspectionEquipment.InspectionEquipmentId);
|
||||
@@ -243,6 +243,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var q = Funs.DB.Comprehensive_InspectionEquipment.FirstOrDefault(x => x.RemarkCode ==Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.InspectionEquipmentId != this.InspectionEquipmentId || (this.InspectionEquipmentId == null && x.InspectionEquipmentId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
Model.Comprehensive_InspectionEquipment newInspectionEquipment = new Model.Comprehensive_InspectionEquipment();
|
||||
newInspectionEquipment.ProjectId = this.CurrUser.LoginProjectId;
|
||||
@@ -256,7 +262,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
newInspectionEquipment.Specifications = this.txtSpecifications.Text.Trim();
|
||||
newInspectionEquipment.Supplier = this.txtSupplier.Text.Trim();
|
||||
newInspectionEquipment.EquipmentNO = this.txtEquipmentNo.Text.Trim();
|
||||
newInspectionEquipment.RemarkCode = this.txtRemarkCode.Text.Trim();
|
||||
newInspectionEquipment.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||
newInspectionEquipment.Counts = this.txtCounts.Text.Trim();
|
||||
newInspectionEquipment.Unit = this.txtUnit.Text.Trim();
|
||||
newInspectionEquipment.SamplingCount = this.txtSamplingCount.Text.Trim();
|
||||
@@ -324,6 +330,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
return;
|
||||
}
|
||||
|
||||
var q = Funs.DB.Comprehensive_InspectionEquipment.FirstOrDefault(x => x.RemarkCode ==Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.InspectionEquipmentId != this.InspectionEquipmentId || (this.InspectionEquipmentId == null && x.InspectionEquipmentId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
Model.Comprehensive_InspectionEquipment newInspectionEquipment = new Model.Comprehensive_InspectionEquipment();
|
||||
newInspectionEquipment.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newInspectionEquipment.UnitId = this.drpUnitId.SelectedValue;
|
||||
@@ -336,7 +348,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
newInspectionEquipment.Specifications = this.txtSpecifications.Text.Trim();
|
||||
newInspectionEquipment.Supplier = this.txtSupplier.Text.Trim();
|
||||
newInspectionEquipment.EquipmentNO = this.txtEquipmentNo.Text.Trim();
|
||||
newInspectionEquipment.RemarkCode = this.txtRemarkCode.Text.Trim();
|
||||
newInspectionEquipment.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||
newInspectionEquipment.Counts = this.txtCounts.Text.Trim();
|
||||
newInspectionEquipment.Unit = this.txtUnit.Text.Trim();
|
||||
newInspectionEquipment.SamplingCount = this.txtSamplingCount.Text.Trim();
|
||||
|
||||
+37
-39
@@ -7,13 +7,11 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
|
||||
|
||||
public partial class InspectionEquipmentEdit
|
||||
{
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||
|
||||
|
||||
public partial class InspectionEquipmentEdit {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
@@ -22,7 +20,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
@@ -31,7 +29,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
@@ -40,7 +38,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpUnitId 控件。
|
||||
/// </summary>
|
||||
@@ -49,7 +47,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnitId;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtInspectionCode 控件。
|
||||
/// </summary>
|
||||
@@ -58,7 +56,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtInspectionCode;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtEquipmentNo 控件。
|
||||
/// </summary>
|
||||
@@ -67,7 +65,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentNo;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpCNProfessionalId 控件。
|
||||
/// </summary>
|
||||
@@ -76,7 +74,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCNProfessionalId;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtInspectionName 控件。
|
||||
/// </summary>
|
||||
@@ -85,7 +83,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtInspectionName;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtSpecifications 控件。
|
||||
/// </summary>
|
||||
@@ -94,7 +92,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSpecifications;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpEquipmentOrMatail 控件。
|
||||
/// </summary>
|
||||
@@ -103,7 +101,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpEquipmentOrMatail;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtSupplier 控件。
|
||||
/// </summary>
|
||||
@@ -112,7 +110,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSupplier;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtCounts 控件。
|
||||
/// </summary>
|
||||
@@ -121,7 +119,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtCounts;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtUnit 控件。
|
||||
/// </summary>
|
||||
@@ -130,7 +128,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtUnit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtSamplingCount 控件。
|
||||
/// </summary>
|
||||
@@ -139,7 +137,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtSamplingCount;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpSamplingResult 控件。
|
||||
/// </summary>
|
||||
@@ -148,7 +146,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpSamplingResult;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpAttribute 控件。
|
||||
/// </summary>
|
||||
@@ -157,7 +155,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpAttribute;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtInspectionDate 控件。
|
||||
/// </summary>
|
||||
@@ -166,7 +164,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtInspectionDate;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtRemarkCode 控件。
|
||||
/// </summary>
|
||||
@@ -174,8 +172,8 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemarkCode;
|
||||
|
||||
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtUsedPlace 控件。
|
||||
/// </summary>
|
||||
@@ -184,7 +182,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtUsedPlace;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
@@ -193,7 +191,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
@@ -202,7 +200,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnAttach 控件。
|
||||
/// </summary>
|
||||
@@ -211,7 +209,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAttach;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpAudit 控件。
|
||||
/// </summary>
|
||||
@@ -220,7 +218,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpAudit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// agree 控件。
|
||||
/// </summary>
|
||||
@@ -229,7 +227,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FormRow agree;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// rblIsAgree 控件。
|
||||
/// </summary>
|
||||
@@ -238,7 +236,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rblIsAgree;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// options 控件。
|
||||
/// </summary>
|
||||
@@ -247,7 +245,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FormRow options;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtidea 控件。
|
||||
/// </summary>
|
||||
@@ -256,7 +254,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtidea;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
@@ -265,7 +263,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// hdAttachUrl 控件。
|
||||
/// </summary>
|
||||
@@ -274,7 +272,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdAttachUrl;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
@@ -283,7 +281,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
@@ -292,7 +290,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSubmit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initTemplatePath = Const.InspectionMachineTempUrl;
|
||||
string initTemplatePath = Const.InspectionMachineDataInUrl;
|
||||
string uploadfilepath = string.Empty;
|
||||
string newUrl = string.Empty;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
@@ -325,10 +325,11 @@ namespace FineUIPro.Web.Comprehensive
|
||||
{
|
||||
lists = lists.Where(x => x.InspectionType == this.sdrpType.SelectedValue);
|
||||
}
|
||||
lists = lists.OrderBy(x => x.UnitId);
|
||||
lists = lists.OrderBy(x => x.RemarkCode);
|
||||
if (lists != null)
|
||||
{
|
||||
newUrl = uploadfilepath.Replace("机具报验模板.xls", "机具报验.xls");
|
||||
string projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
|
||||
newUrl = uploadfilepath.Replace("机具报验导入模板", "机具报验("+ projectName+DateTime.Now.ToString("yyyyMMdd")+ ")");
|
||||
File.Copy(uploadfilepath, newUrl);
|
||||
// 第一步:读取文件流
|
||||
NPOI.SS.UserModel.IWorkbook workbook;
|
||||
@@ -363,7 +364,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||
NPOI.SS.UserModel.ICell cell;
|
||||
int i = 1;
|
||||
int i = 2;
|
||||
foreach (var item in lists)
|
||||
{
|
||||
// 第二步:创建新数据行
|
||||
@@ -449,8 +450,28 @@ namespace FineUIPro.Web.Comprehensive
|
||||
|
||||
cell = row.CreateCell(12);
|
||||
cell.CellStyle = cellStyle;
|
||||
string isK = string.Empty;
|
||||
if (item.IsCheckOK.HasValue)//校验合格
|
||||
{
|
||||
if (item.IsCheckOK == true)
|
||||
{
|
||||
isK = "是";
|
||||
}
|
||||
else if (item.IsCheckOK == false)
|
||||
{
|
||||
isK = "否";
|
||||
}
|
||||
}
|
||||
cell.SetCellValue(isK);
|
||||
|
||||
cell = row.CreateCell(13);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.LeaveDate.HasValue ? string.Format("{0:yyyy-MM-dd}", item.LeaveDate) : "");//离场时间
|
||||
|
||||
cell = row.CreateCell(14);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||
|
||||
i++;
|
||||
}
|
||||
// 第三步:写入文件流
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL(ds.Tables[0], 14);
|
||||
AddDatasetToSQL(ds.Tables[0], 15);
|
||||
hdCheckResult.Text = "1";
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -173,7 +173,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_InspectionMachine oldViewInfo = new Model.Comprehensive_InspectionMachine();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
@@ -269,20 +269,39 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
string row12 = pds.Rows[i][12].ToString();
|
||||
if (!string.IsNullOrEmpty(row12))
|
||||
{
|
||||
try
|
||||
if (row12 != "是" && row12 != "否")
|
||||
{
|
||||
DateTime leaveDate = Convert.ToDateTime(row12);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "离场时间" + "," + "[" + row12 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "校验合格" + "," + "[" + row12 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
string row13 = pds.Rows[i][13].ToString();
|
||||
if (string.IsNullOrEmpty(row13))
|
||||
if (!string.IsNullOrEmpty(row13))
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime leaveDate = Convert.ToDateTime(row13);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "离场时间" + "," + "[" + row13 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
string row14 = pds.Rows[i][14].ToString();
|
||||
if (string.IsNullOrEmpty(row14))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
int t = Convert.ToInt32(row14);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row14 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -393,7 +412,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL2(ds.Tables[0], 14);
|
||||
AddDatasetToSQL2(ds.Tables[0], 15);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -432,7 +451,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
var unitInfo = units.Where(y => y.UnitName == row0).FirstOrDefault();
|
||||
@@ -440,7 +459,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
Model.Comprehensive_InspectionMachine oldViewInfo = new Model.Comprehensive_InspectionMachine();
|
||||
oldViewInfo = oldViewInfos.FirstOrDefault(x => x.UnitId == unitInfo.UnitId
|
||||
&& x.RemarkCode == pds.Rows[i][13].ToString().Trim());
|
||||
&& x.RemarkCode ==Funs.GetNewInt(pds.Rows[i][13].ToString().Trim()));
|
||||
if (oldViewInfo==null)
|
||||
{
|
||||
Model.Comprehensive_InspectionMachine Ins = new Model.Comprehensive_InspectionMachine();
|
||||
@@ -482,11 +501,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
Ins.UnitsCount = Convert.ToInt32(pds.Rows[i][11].ToString().Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
|
||||
Ins.IsCheckOK = pds.Rows[i][12].ToString().Trim() == "是" ? true : false;
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][13].ToString().Trim()))
|
||||
{
|
||||
Ins.LeaveDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
|
||||
Ins.LeaveDate = Convert.ToDateTime(pds.Rows[i][13].ToString().Trim());
|
||||
}
|
||||
Ins.RemarkCode = pds.Rows[i][13].ToString().Trim();
|
||||
Ins.RemarkCode =Funs.GetNewInt(pds.Rows[i][14].ToString().Trim());
|
||||
Ins.InspectionMachineId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionMachine));
|
||||
Ins.CompileMan = this.CurrUser.UserId;
|
||||
Ins.CompileDate = DateTime.Now.Date;
|
||||
@@ -533,11 +553,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
oldViewInfo.UnitsCount = Convert.ToInt32(pds.Rows[i][11].ToString().Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
|
||||
oldViewInfo.IsCheckOK = pds.Rows[i][12].ToString().Trim() == "是" ? true : false;
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][13].ToString().Trim()))
|
||||
{
|
||||
oldViewInfo.LeaveDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
|
||||
oldViewInfo.LeaveDate = Convert.ToDateTime(pds.Rows[i][13].ToString().Trim());
|
||||
}
|
||||
oldViewInfo.RemarkCode = pds.Rows[i][13].ToString().Trim();
|
||||
oldViewInfo.RemarkCode = Funs.GetNewInt(pds.Rows[i][14].ToString().Trim());
|
||||
|
||||
oldViewInfo.CompileMan = this.CurrUser.UserId;
|
||||
oldViewInfo.CompileDate = DateTime.Now.Date;
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:NumberBox ID="txtRemarkCode" runat="server" Label="标志编号" LabelAlign="Right" Required="true" ShowRedStar="true" NoDecimal="true" NoNegative="true" LabelWidth="110px"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow MarginTop="10px">
|
||||
|
||||
@@ -93,6 +93,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
drpAudit.SelectedValue = inspectionMachine.AuditMan;
|
||||
}
|
||||
this.txtRemarkCode.Text = inspectionMachine.RemarkCode.HasValue ? inspectionMachine.RemarkCode.ToString() : "";
|
||||
var currApprove = InspectionMachineApproveService.GetCurrentApprove(inspectionMachine.InspectionMachineId);
|
||||
if (currApprove != null)
|
||||
{ //重新编制 编制人 可以 显示 提交 保存按钮
|
||||
@@ -150,7 +151,8 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
this.txtSpecificationModel.Readonly = true;
|
||||
this.txtTestCycle.Readonly = true;
|
||||
this.txtUnitsCount.Readonly = true;
|
||||
this.drpAudit.Readonly = true;
|
||||
this.drpAudit.Readonly = true;
|
||||
this.txtRemarkCode.Readonly = true;
|
||||
//this.btnAttach.Enabled = false;
|
||||
|
||||
}
|
||||
@@ -191,6 +193,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var q = Funs.DB.Comprehensive_InspectionMachine.FirstOrDefault(x => x.RemarkCode == Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.InspectionMachineId != this.InspectionMachineId || (this.InspectionMachineId == null && x.InspectionMachineId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
Model.Comprehensive_InspectionMachine inspectionMachone = new Model.Comprehensive_InspectionMachine();
|
||||
inspectionMachone.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
@@ -213,6 +221,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
inspectionMachone.IsCheckOK = this.rblIsCheckOK.SelectedValue == "true" ? true : false;
|
||||
inspectionMachone.LeaveDate = Funs.GetNewDateTime(this.txtLeaveDate.Text);
|
||||
inspectionMachone.UnitsCount = Funs.GetNewInt(this.txtUnitsCount.Text.Trim());
|
||||
inspectionMachone.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue))
|
||||
{
|
||||
inspectionMachone.AuditMan = drpAudit.SelectedValue;
|
||||
@@ -259,6 +268,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var q = Funs.DB.Comprehensive_InspectionMachine.FirstOrDefault(x => x.RemarkCode == Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.InspectionMachineId != this.InspectionMachineId || (this.InspectionMachineId == null && x.InspectionMachineId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
Model.Comprehensive_InspectionMachine inspectionMachone = new Model.Comprehensive_InspectionMachine();
|
||||
inspectionMachone.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
|
||||
@@ -192,6 +192,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAttach;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemarkCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||
|
||||
/// <summary>
|
||||
/// drpAudit 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -372,7 +372,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initTemplatePath = Const.InspectionPersonTempUrl;
|
||||
string initTemplatePath = Const.InspectionPersonDataInUrl;
|
||||
string uploadfilepath = string.Empty;
|
||||
string newUrl = string.Empty;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
@@ -392,10 +392,11 @@ namespace FineUIPro.Web.Comprehensive
|
||||
{
|
||||
lists = lists.Where(x => x.PersonName.Contains(this.stxtPersonName.Text.Trim()));
|
||||
}
|
||||
lists = lists.OrderBy(x => x.UnitId);
|
||||
lists = lists.OrderBy(x => x.RemarkCode);
|
||||
if (lists != null)
|
||||
{
|
||||
newUrl = uploadfilepath.Replace("人员报验模板.xls", "人员报验.xls");
|
||||
string projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
|
||||
newUrl = uploadfilepath.Replace("人员报验导入模板", "人员报验(" + projectName + DateTime.Now.ToString("yyyyMMdd") + ")");
|
||||
File.Copy(uploadfilepath, newUrl);
|
||||
// 第一步:读取文件流
|
||||
NPOI.SS.UserModel.IWorkbook workbook;
|
||||
@@ -430,7 +431,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||
NPOI.SS.UserModel.ICell cell;
|
||||
int i = 1;
|
||||
int i = 2;
|
||||
foreach (var item in lists)
|
||||
{
|
||||
// 第二步:创建新数据行
|
||||
@@ -446,6 +447,10 @@ namespace FineUIPro.Web.Comprehensive
|
||||
|
||||
cell = row.CreateCell(2);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.PersonName);//姓名
|
||||
|
||||
cell = row.CreateCell(3);
|
||||
cell.CellStyle = cellStyle;
|
||||
string proName = string.Empty;
|
||||
var cnp = BLL.CNProfessionalService.GetCNProfessional(item.CNProfessionalId);
|
||||
if (cnp != null)
|
||||
@@ -454,7 +459,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
}
|
||||
cell.SetCellValue(proName);//专业
|
||||
|
||||
cell = row.CreateCell(3);
|
||||
cell = row.CreateCell(4);
|
||||
cell.CellStyle = cellStyle;
|
||||
string unitWork = string.Empty;
|
||||
if (!string.IsNullOrEmpty(item.UnitWorkId))
|
||||
@@ -463,23 +468,19 @@ namespace FineUIPro.Web.Comprehensive
|
||||
}
|
||||
cell.SetCellValue(unitWork);//单位工程名称
|
||||
|
||||
cell = row.CreateCell(4);
|
||||
cell = row.CreateCell(5);
|
||||
cell.CellStyle = cellStyle;
|
||||
string postName = string.Empty;
|
||||
if (!string.IsNullOrEmpty(item.PostId))
|
||||
{
|
||||
var post = BLL.PostService.GetPostById(item.PostId);
|
||||
if (post!=null)
|
||||
if (post != null)
|
||||
{
|
||||
postName = post.PostName;
|
||||
}
|
||||
}
|
||||
cell.SetCellValue(postName);//工种
|
||||
|
||||
cell = row.CreateCell(5);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.PersonName);//姓名
|
||||
|
||||
cell = row.CreateCell(6);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.CertificateNumber);//证书编号
|
||||
@@ -498,8 +499,42 @@ namespace FineUIPro.Web.Comprehensive
|
||||
|
||||
cell = row.CreateCell(10);
|
||||
cell.CellStyle = cellStyle;
|
||||
string isO = string.Empty;
|
||||
if (item.IsOnSite == true)//是否在场
|
||||
{
|
||||
isO = "是";
|
||||
}
|
||||
else
|
||||
{
|
||||
isO = "否";
|
||||
}
|
||||
cell.SetCellValue(isO);
|
||||
|
||||
cell = row.CreateCell(11);
|
||||
cell.CellStyle = cellStyle;
|
||||
string isT = string.Empty;
|
||||
if (item.IsTrain == true)//是否培训
|
||||
{
|
||||
isT = "是";
|
||||
}
|
||||
else
|
||||
{
|
||||
isT = "否";
|
||||
}
|
||||
cell.SetCellValue(isT);
|
||||
|
||||
cell = row.CreateCell(12);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.DepartureTime.HasValue ? string.Format("{0:yyyy-MM-dd}", item.DepartureTime) : "");//离场时间
|
||||
|
||||
cell = row.CreateCell(13);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.Remark);//备注
|
||||
|
||||
cell = row.CreateCell(14);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||
|
||||
i++;
|
||||
}
|
||||
// 第三步:写入文件流
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL(ds.Tables[0], 13);
|
||||
AddDatasetToSQL(ds.Tables[0], 15);
|
||||
hdCheckResult.Text = "1";
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -172,28 +172,21 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
select x;
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
var posts = from x in Funs.DB.Base_Post select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_InspectionPerson oldViewInfo = new Model.Comprehensive_InspectionPerson();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
var unitInfo = units.Where(y => y.UnitName == row0).FirstOrDefault();
|
||||
if (unitInfo != null && !string.IsNullOrEmpty(row0))
|
||||
{
|
||||
/*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)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位人员报验编号已存在!" + "|";
|
||||
}*/
|
||||
string row1 = pds.Rows[i][1].ToString();
|
||||
if (string.IsNullOrEmpty(row1))
|
||||
{
|
||||
@@ -219,23 +212,24 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
string row4 = pds.Rows[i][4].ToString();
|
||||
if (!string.IsNullOrEmpty(row4))
|
||||
{
|
||||
var post = posts.Where(x => x.PostName == row4.Trim()).FirstOrDefault();
|
||||
if (post == null)
|
||||
string[] reunit = row4.Split(',');
|
||||
foreach (string unitWork in reunit)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "工种" + "," + "[" + row4 + "]不存在!" + "|";
|
||||
var u = unitWorks.Where(x => x.UnitWorkName == unitWork.Trim()).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "单位工程名称" + "," + "[" + unitWork.Trim() + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string row7 = pds.Rows[i][7].ToString();
|
||||
if (!string.IsNullOrEmpty(row7))
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
try
|
||||
var post = posts.Where(x => x.PostName == row5.Trim()).FirstOrDefault();
|
||||
if (post == null)
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row7.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "有效期" + "," + "[" + row7 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "工种" + "," + "[" + row5 + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,36 +242,69 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "批准时间" + "," + "[" + row8 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "有效期" + "," + "[" + row8 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row9 = pds.Rows[i][9].ToString().Trim();
|
||||
string row9 = pds.Rows[i][9].ToString();
|
||||
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());
|
||||
DateTime date = Convert.ToDateTime(row9.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "离场时间" + "," + "[" + row10 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "批准时间" + "," + "[" + row9 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row10 = pds.Rows[i][10].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row10))
|
||||
{
|
||||
if (row10 != "是" && row10 != "否")
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "是否在场" + "," + "[" + row10 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row11 = pds.Rows[i][11].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row11))
|
||||
{
|
||||
if (row11 != "是" && row11 != "否")
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "培训" + "," + "[" + row11 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row12 = pds.Rows[i][12].ToString();
|
||||
if (string.IsNullOrEmpty(row12))
|
||||
if (!string.IsNullOrEmpty(row12))
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row12.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "离场时间" + "," + "[" + row12 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
string row14 = pds.Rows[i][14].ToString();
|
||||
if (string.IsNullOrEmpty(row14))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
int t = Convert.ToInt32(row14);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row14 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -388,7 +415,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL2(ds.Tables[0], 13);
|
||||
AddDatasetToSQL2(ds.Tables[0], 15);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -426,9 +453,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
select x;
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
var posts = from x in Funs.DB.Base_Post select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_InspectionPerson oldViewInfo = new Model.Comprehensive_InspectionPerson();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
@@ -436,7 +469,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
if (unitInfo != null && !string.IsNullOrEmpty(row0))
|
||||
{
|
||||
oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
|
||||
&& x.RemarkCode == pds.Rows[i][12].ToString().Trim()
|
||||
&& x.RemarkCode == Funs.GetNewInt(pds.Rows[i][14].ToString().Trim())
|
||||
).FirstOrDefault();
|
||||
if (oldViewInfo == null)
|
||||
{
|
||||
@@ -450,37 +483,37 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
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.PostId = Funs.DB.Base_Post.First(e => e.PostName == pds.Rows[i][4].ToString().Trim()).PostId;
|
||||
Ins.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][4].ToString().Trim());
|
||||
}
|
||||
|
||||
Ins.CertificateNumber = pds.Rows[i][5].ToString().Trim();
|
||||
Ins.QualifiedProjectCode = pds.Rows[i][6].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][7].ToString().Trim()))
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][5].ToString().Trim()))
|
||||
{
|
||||
Ins.ValidityDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());
|
||||
Ins.PostId = Funs.DB.Base_Post.First(e => e.PostName == pds.Rows[i][5].ToString().Trim()).PostId;
|
||||
}
|
||||
|
||||
Ins.CertificateNumber = pds.Rows[i][6].ToString().Trim();
|
||||
Ins.QualifiedProjectCode = pds.Rows[i][7].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][8].ToString().Trim()))
|
||||
{
|
||||
Ins.ApprovalTime = Convert.ToDateTime(pds.Rows[i][8].ToString().Trim());
|
||||
Ins.ValidityDate = Convert.ToDateTime(pds.Rows[i][8].ToString().Trim());
|
||||
}
|
||||
Ins.IsOnSite = pds.Rows[i][9].ToString().Trim() == "是" ? true : false;
|
||||
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][10].ToString().Trim()))
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
|
||||
{
|
||||
Ins.DepartureTime = Convert.ToDateTime(pds.Rows[i][10].ToString().Trim());
|
||||
Ins.ApprovalTime = Convert.ToDateTime(pds.Rows[i][9].ToString().Trim());
|
||||
}
|
||||
Ins.Remark = pds.Rows[i][11].ToString().Trim();
|
||||
Ins.RemarkCode = pds.Rows[i][12].ToString().Trim();
|
||||
Ins.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
|
||||
Ins.IsTrain= pds.Rows[i][11].ToString().Trim() == "是" ? true : false;
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
|
||||
{
|
||||
Ins.DepartureTime = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
|
||||
}
|
||||
Ins.Remark = pds.Rows[i][13].ToString().Trim();
|
||||
Ins.RemarkCode =Funs.GetNewInt(pds.Rows[i][14].ToString().Trim());
|
||||
|
||||
Ins.InspectionPersonId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionPerson));
|
||||
Ins.CompileMan = this.CurrUser.UserId;
|
||||
Ins.CompileDate = DateTime.Now.Date;
|
||||
Ins.Status = BLL.Const.Comprehensive_Compile;
|
||||
Ins.IsTrain = true;
|
||||
BLL.InspectionPersonService.AddInspectionPerson(Ins);
|
||||
if (pds.Rows[i][4].ToString().Trim() == "焊工")
|
||||
{
|
||||
@@ -510,36 +543,37 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
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.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][4].ToString().Trim());
|
||||
}
|
||||
|
||||
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()))
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][5].ToString().Trim()))
|
||||
{
|
||||
oldViewInfo.ValidityDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());
|
||||
oldViewInfo.PostId = Funs.DB.Base_Post.First(e => e.PostName == pds.Rows[i][5].ToString().Trim()).PostId;
|
||||
}
|
||||
|
||||
oldViewInfo.CertificateNumber = pds.Rows[i][6].ToString().Trim();
|
||||
oldViewInfo.QualifiedProjectCode = 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.ValidityDate = 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()))
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
|
||||
{
|
||||
oldViewInfo.DepartureTime = Convert.ToDateTime(pds.Rows[i][10].ToString().Trim());
|
||||
oldViewInfo.ApprovalTime = Convert.ToDateTime(pds.Rows[i][9].ToString().Trim());
|
||||
}
|
||||
oldViewInfo.Remark = pds.Rows[i][11].ToString().Trim();
|
||||
oldViewInfo.RemarkCode= pds.Rows[i][12].ToString().Trim();
|
||||
oldViewInfo.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
|
||||
oldViewInfo.IsTrain = pds.Rows[i][11].ToString().Trim() == "是" ? true : false;
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
|
||||
{
|
||||
oldViewInfo.DepartureTime = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
|
||||
}
|
||||
oldViewInfo.Remark = pds.Rows[i][13].ToString().Trim();
|
||||
oldViewInfo.RemarkCode = Funs.GetNewInt(pds.Rows[i][14].ToString().Trim());
|
||||
|
||||
oldViewInfo.InspectionPersonId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionPerson));
|
||||
oldViewInfo.CompileMan = this.CurrUser.UserId;
|
||||
oldViewInfo.CompileDate = DateTime.Now.Date;
|
||||
oldViewInfo.Status = BLL.Const.Comprehensive_Compile;
|
||||
oldViewInfo.IsTrain = true;
|
||||
BLL.InspectionPersonService.UpdateInspectionPerson(oldViewInfo);
|
||||
if (pds.Rows[i][4].ToString().Trim() == "焊工")
|
||||
{
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<f:RadioItem Text="是" Value="true" Selected="true" />
|
||||
<f:RadioItem Text="否" Value="false" />
|
||||
</f:RadioButtonList>
|
||||
<f:TextBox ID="txtRemark" runat="server" Label="备注" MaxLength="150" LabelWidth="150px" LabelAlign="Right"></f:TextBox>
|
||||
<f:NumberBox ID="txtRemarkCode" runat="server" Label="标志编号" LabelAlign="Right" LabelWidth="150px" Required="true" ShowRedStar="true" NoDecimal="true" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
@@ -86,6 +86,7 @@
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:TextBox ID="txtRemark" runat="server" Label="备注" MaxLength="150" LabelWidth="150px" LabelAlign="Right"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
this.drpUnitWorkIds.SelectedValueArray = inspectionPerson.UnitWorkId.Split(',');
|
||||
}
|
||||
this.txtRemark.Text = inspectionPerson.Remark;
|
||||
this.txtRemarkCode.Text = inspectionPerson.RemarkCode.HasValue ? inspectionPerson.RemarkCode.ToString() : "";
|
||||
|
||||
|
||||
var currApprove = InspectionPersonApproveService.GetCurrentApprove(inspectionPerson.InspectionPersonId);
|
||||
@@ -172,7 +173,8 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
this.txtValidityDate.Readonly = true;
|
||||
this.drpPostId.Readonly = true;
|
||||
this.drpAudit.Readonly = true;
|
||||
this.drpUnitWorkIds.Readonly = true;
|
||||
this.drpUnitWorkIds.Readonly = true;
|
||||
this.txtRemarkCode.Readonly = true;
|
||||
//this.btnAttach.Enabled = false;
|
||||
|
||||
}
|
||||
@@ -223,6 +225,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
return;
|
||||
}
|
||||
}
|
||||
var q = Funs.DB.Comprehensive_InspectionPerson.FirstOrDefault(x => x.RemarkCode == Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.InspectionPersonId != this.InspectionPersonId || (this.InspectionPersonId == null && x.InspectionPersonId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
// 焊工部分
|
||||
Model.BS_Welder welder = new Model.BS_Welder();
|
||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
@@ -307,6 +315,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
inspectionPerson.DepartureTime = Convert.ToDateTime(this.txtDepartureTime.Text.ToString());
|
||||
}
|
||||
inspectionPerson.Remark = this.txtRemark.Text.Trim();
|
||||
inspectionPerson.RemarkCode =Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||
string ids = string.Empty;
|
||||
var lists = this.drpUnitWorkIds.SelectedValueArray;
|
||||
foreach (var item in lists)
|
||||
@@ -401,6 +410,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
return;
|
||||
}
|
||||
}
|
||||
var q = Funs.DB.Comprehensive_InspectionPerson.FirstOrDefault(x => x.RemarkCode ==Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.InspectionPersonId != this.InspectionPersonId || (this.InspectionPersonId == null && x.InspectionPersonId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
// 焊工部分
|
||||
Model.BS_Welder welder = new Model.BS_Welder();
|
||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
@@ -486,6 +501,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
inspectionPerson.DepartureTime = Convert.ToDateTime(this.txtDepartureTime.Text.ToString());
|
||||
}
|
||||
inspectionPerson.Remark = this.txtRemark.Text.Trim();
|
||||
inspectionPerson.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||
string ids = string.Empty;
|
||||
var lists = this.drpUnitWorkIds.SelectedValueArray;
|
||||
foreach (var item in lists)
|
||||
|
||||
+11
-2
@@ -166,13 +166,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||
protected global::FineUIPro.RadioButtonList rblIsTrain;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
/// txtRemarkCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemark;
|
||||
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
@@ -201,6 +201,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAttach;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemark;
|
||||
|
||||
/// <summary>
|
||||
/// drpAudit 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initTemplatePath = Const.TrainingRecordsTempUrl;
|
||||
string initTemplatePath = Const.CQMS_TrainingRecordsTemplateUrl;
|
||||
string uploadfilepath = string.Empty;
|
||||
string newUrl = string.Empty;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
@@ -228,9 +228,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
lists = lists.Where(x => x.TrainingContents.Contains(this.txtTrainingContents.Text.Trim()));
|
||||
}
|
||||
lists = lists.OrderBy(x => x.RemarkCode);
|
||||
if (lists != null)
|
||||
{
|
||||
newUrl = uploadfilepath.Replace("培训记录模板.xls", "培训记录.xls");
|
||||
string projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
|
||||
newUrl = uploadfilepath.Replace("培训记录导入模板", "培训记录(" + projectName + DateTime.Now.ToString("yyyyMMdd") + ")");
|
||||
File.Copy(uploadfilepath, newUrl);
|
||||
// 第一步:读取文件流
|
||||
NPOI.SS.UserModel.IWorkbook workbook;
|
||||
@@ -265,7 +267,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||
NPOI.SS.UserModel.ICell cell;
|
||||
int i = 1;
|
||||
int i = 2;
|
||||
foreach (var item in lists)
|
||||
{
|
||||
// 第二步:创建新数据行
|
||||
@@ -304,6 +306,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
cell = row.CreateCell(6);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.Remark);//备注
|
||||
|
||||
cell = row.CreateCell(7);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||
|
||||
i++;
|
||||
}
|
||||
// 第三步:写入文件流
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString();
|
||||
if (string.IsNullOrEmpty(row0))
|
||||
@@ -217,6 +217,17 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
int t = Convert.ToInt32(row7);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row7 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
@@ -356,13 +367,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_TrainingRecords oldViewInfo = new Model.Comprehensive_TrainingRecords();
|
||||
|
||||
string row1 = pds.Rows[i][1].ToString().Trim();
|
||||
var cn = cns.Where(y => y.ProfessionalName == row1).FirstOrDefault();
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == pds.Rows[i][7].ToString().Trim()
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == Funs.GetNewInt(pds.Rows[i][7].ToString().Trim())
|
||||
).FirstOrDefault();
|
||||
if (oldViewInfo == null)
|
||||
{
|
||||
@@ -379,7 +390,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
des.KeynoteSpeaker = pds.Rows[i][5].ToString().Trim();
|
||||
des.Remark = pds.Rows[i][6].ToString().Trim();
|
||||
des.RemarkCode = pds.Rows[i][7].ToString().Trim();
|
||||
des.RemarkCode = Funs.GetNewInt(pds.Rows[i][7].ToString().Trim());
|
||||
BLL.TrainingRecordsService.AddTrainingRecords(des);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
<f:TextBox ID="txtKeynoteSpeaker" runat="server" Label="主讲人" MaxLength="50" LabelAlign="Right" LabelWidth="130px"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtRemarkCode" runat="server" Label="标志编号" Required="true" ShowRedStar="true" LabelAlign="Right" LabelWidth="130px" NoDecimal="true" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtRemark" runat="server" Label="备注" MaxLength="50" LabelAlign="Right" LabelWidth="130px"></f:TextArea>
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
this.txtHours.Text = trainingRecords.Hours.HasValue ? trainingRecords.Hours.ToString() : "";
|
||||
this.txtKeynoteSpeaker.Text = trainingRecords.KeynoteSpeaker;
|
||||
this.txtRemark.Text = trainingRecords.Remark;
|
||||
this.txtRemarkCode.Text = trainingRecords.RemarkCode.HasValue ? trainingRecords.RemarkCode.ToString() : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,6 +69,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var q = Funs.DB.Comprehensive_TrainingRecords.FirstOrDefault(x => x.RemarkCode == Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.TrainingRecordsId != this.TrainingRecordsId || (this.TrainingRecordsId == null && x.TrainingRecordsId != null)));
|
||||
if (q != 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();
|
||||
@@ -76,6 +83,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
trainingRecords.Hours = Funs.GetNewDecimal(this.txtHours.Text.Trim());
|
||||
trainingRecords.KeynoteSpeaker = this.txtKeynoteSpeaker.Text.Trim();
|
||||
trainingRecords.Remark = this.txtRemark.Text.Trim();
|
||||
trainingRecords.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(this.TrainingRecordsId))
|
||||
{
|
||||
trainingRecords.TrainingRecordsId = this.TrainingRecordsId;
|
||||
|
||||
@@ -93,6 +93,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtKeynoteSpeaker;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemarkCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user