20240429 修改综合管理导入导出
This commit is contained in:
parent
fc56b1f6c2
commit
a3e123957d
|
@ -0,0 +1,48 @@
|
||||||
|
alter table Comprehensive_DataReceivingDoc alter column RemarkCode int
|
||||||
|
go
|
||||||
|
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='¸Ö½îHRB400E'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='Y200430832'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='ÒÑÈ¡ÑùËͼì'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='Y1109024'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='GB8624-2014'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='CV'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='GB/T5574-2008'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='J1009194'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='B201031625'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='GB50264-2013'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='QC202108241813'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='GB8624-2016'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='Q355'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='A537CL2'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='EQ001'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='GB/T3880-2012'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='SS2022-00150'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='F1112193'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='AFJ2207444'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='A02212507RPS1'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='¸Ö½îHPB300'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='A537CL2/A516 Cr 60/Q370/Q345'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='J1012004'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='A537 CL2/Q370/Q345'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='SANS298-2007'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='SS2022-00006'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='jc/70-2002'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='AFJ22070445'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='GB8624-2015'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='8900002955433'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='GB8624-2013'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='Q370/Q345'
|
||||||
|
update Comprehensive_InspectionEquipment set RemarkCode = null where RemarkCode ='Y1201023'
|
||||||
|
go
|
||||||
|
|
||||||
|
alter table Comprehensive_InspectionEquipment alter column RemarkCode int
|
||||||
|
go
|
||||||
|
alter table Comprehensive_InspectionPerson alter column RemarkCode int
|
||||||
|
go
|
||||||
|
alter table Comprehensive_InspectionMachine alter column RemarkCode int
|
||||||
|
go
|
||||||
|
alter table Comprehensive_TrainingRecords alter column RemarkCode int
|
||||||
|
go
|
||||||
|
alter table Comprehensive_ConTechnologyDisclosure alter column RemarkCode int
|
||||||
|
go
|
|
@ -64,6 +64,7 @@ namespace BLL
|
||||||
newCon.DisclosureDate = con.DisclosureDate;
|
newCon.DisclosureDate = con.DisclosureDate;
|
||||||
newCon.UnitWorkId = con.UnitWorkId;
|
newCon.UnitWorkId = con.UnitWorkId;
|
||||||
newCon.AttendMan = con.AttendMan;
|
newCon.AttendMan = con.AttendMan;
|
||||||
|
newCon.RemarkCode = con.RemarkCode;
|
||||||
Funs.DB.SubmitChanges();
|
Funs.DB.SubmitChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@ namespace BLL
|
||||||
newTraining.Hours = trainingRecords.Hours;
|
newTraining.Hours = trainingRecords.Hours;
|
||||||
newTraining.KeynoteSpeaker = trainingRecords.KeynoteSpeaker;
|
newTraining.KeynoteSpeaker = trainingRecords.KeynoteSpeaker;
|
||||||
newTraining.Remark = trainingRecords.Remark;
|
newTraining.Remark = trainingRecords.Remark;
|
||||||
|
newTraining.RemarkCode = trainingRecords.RemarkCode;
|
||||||
Funs.DB.SubmitChanges();
|
Funs.DB.SubmitChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3306,31 +3306,6 @@ namespace BLL
|
||||||
/// 质量专项检查模板文件原始虚拟路径
|
/// 质量专项检查模板文件原始虚拟路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string JointCheckTempUrl = "File\\Excel\\CQMS\\质量专项检查模版.xls";
|
public const string JointCheckTempUrl = "File\\Excel\\CQMS\\质量专项检查模版.xls";
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 设备材料报验模板文件原始虚拟路径
|
|
||||||
/// </summary>
|
|
||||||
public const string InspectionEquipmentTempUrl = "File\\Excel\\CQMS\\设备材料报验模板.xls";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 人员报验模板文件原始虚拟路径
|
|
||||||
/// </summary>
|
|
||||||
public const string InspectionPersonTempUrl = "File\\Excel\\CQMS\\人员报验模板.xls";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 机具报验模板文件原始虚拟路径
|
|
||||||
/// </summary>
|
|
||||||
public const string InspectionMachineTempUrl = "File\\Excel\\CQMS\\机具报验模板.xls";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 培训记录模板文件原始虚拟路径
|
|
||||||
/// </summary>
|
|
||||||
public const string TrainingRecordsTempUrl = "File\\Excel\\CQMS\\培训记录模板.xls";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 施工技术交底模板文件原始虚拟路径
|
|
||||||
/// </summary>
|
|
||||||
public const string ConTechnologyDisclosureTempUrl = "File\\Excel\\CQMS\\施工技术交底管理模板.xls";
|
|
||||||
#endregion
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -239,7 +239,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
protected void btnOut_Click(object sender, EventArgs e)
|
protected void btnOut_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string rootPath = Server.MapPath("~/");
|
string rootPath = Server.MapPath("~/");
|
||||||
string initTemplatePath = Const.ConTechnologyDisclosureTempUrl;
|
string initTemplatePath = Const.ConTechnologyDisclosureTemUrl;
|
||||||
string uploadfilepath = string.Empty;
|
string uploadfilepath = string.Empty;
|
||||||
string newUrl = string.Empty;
|
string newUrl = string.Empty;
|
||||||
uploadfilepath = rootPath + initTemplatePath;
|
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.Where(x => x.DisclosureCode.Contains(this.txtCode.Text.Trim()));
|
||||||
}
|
}
|
||||||
lists = lists.OrderBy(x => x.UnitId);
|
lists = lists.OrderBy(x => x.RemarkCode);
|
||||||
if (lists != null)
|
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);
|
File.Copy(uploadfilepath, newUrl);
|
||||||
// 第一步:读取文件流
|
// 第一步:读取文件流
|
||||||
NPOI.SS.UserModel.IWorkbook workbook;
|
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.ISheet sheet = workbook.GetSheetAt(0);
|
||||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||||
NPOI.SS.UserModel.ICell cell;
|
NPOI.SS.UserModel.ICell cell;
|
||||||
int i = 1;
|
int i = 2;
|
||||||
foreach (var item in lists)
|
foreach (var item in lists)
|
||||||
{
|
{
|
||||||
// 第二步:创建新数据行
|
// 第二步:创建新数据行
|
||||||
|
@ -350,6 +351,10 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
cell = row.CreateCell(7);
|
cell = row.CreateCell(7);
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
cell.SetCellValue(item.AttendMan);//参加人员
|
cell.SetCellValue(item.AttendMan);//参加人员
|
||||||
|
|
||||||
|
cell = row.CreateCell(8);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// 第三步:写入文件流
|
// 第三步:写入文件流
|
||||||
|
|
|
@ -178,7 +178,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
&& x.SuperUnitWork == null
|
&& x.SuperUnitWork == null
|
||||||
select x;
|
select x;
|
||||||
|
|
||||||
for (int i = 0; i < ir; i++)
|
for (int i = 1; i < ir; i++)
|
||||||
{
|
{
|
||||||
string row0 = pds.Rows[i][0].ToString();
|
string row0 = pds.Rows[i][0].ToString();
|
||||||
if (string.IsNullOrEmpty(row0))
|
if (string.IsNullOrEmpty(row0))
|
||||||
|
@ -246,6 +246,17 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
{
|
{
|
||||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int t = Convert.ToInt32(row8);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row8 + "]错误!" + "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(result))
|
if (!string.IsNullOrEmpty(result))
|
||||||
{
|
{
|
||||||
|
@ -395,13 +406,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
&& x.SuperUnitWork == null
|
&& x.SuperUnitWork == null
|
||||||
select x;
|
select x;
|
||||||
|
|
||||||
for (int i = 0; i < ir; i++)
|
for (int i = 1; i < ir; i++)
|
||||||
{
|
{
|
||||||
Model.Comprehensive_ConTechnologyDisclosure oldViewInfo = new Model.Comprehensive_ConTechnologyDisclosure();
|
Model.Comprehensive_ConTechnologyDisclosure oldViewInfo = new Model.Comprehensive_ConTechnologyDisclosure();
|
||||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||||
string row3 = pds.Rows[i][3].ToString().Trim();
|
string row3 = pds.Rows[i][3].ToString().Trim();
|
||||||
var cn = cns.Where(y => y.ProfessionalName == row0).FirstOrDefault();
|
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();
|
).FirstOrDefault();
|
||||||
if (oldViewInfo == null)
|
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.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][6].ToString().Trim());
|
||||||
}
|
}
|
||||||
des.AttendMan = pds.Rows[i][7].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.CompileMan = this.CurrUser.UserId;
|
||||||
des.CompileDate = DateTime.Now;
|
des.CompileDate = DateTime.Now;
|
||||||
BLL.ConTechnologyDisclosureService.AddConTechnologyDisclosure(des);
|
BLL.ConTechnologyDisclosureService.AddConTechnologyDisclosure(des);
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
<f:FormRow>
|
<f:FormRow>
|
||||||
<Items>
|
<Items>
|
||||||
<f:DropDownList ID="drpUnitWorkIds" runat="server" Label="单位工程名称" EnableCheckBoxSelect="true" EnableMultiSelect="true" LabelWidth="130px" AutoSelectFirstItem="false" LabelAlign="Right"></f:DropDownList>
|
<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>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
<f:FormRow>
|
<f:FormRow>
|
||||||
|
|
|
@ -64,6 +64,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
this.drpUnitWorkIds.SelectedValueArray = con.UnitWorkId.Split(',');
|
this.drpUnitWorkIds.SelectedValueArray = con.UnitWorkId.Split(',');
|
||||||
}
|
}
|
||||||
this.txtAttendMan.Text = con.AttendMan;
|
this.txtAttendMan.Text = con.AttendMan;
|
||||||
|
this.txtRemarkCode.Text = con.RemarkCode.HasValue ? con.RemarkCode.ToString() : "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -91,6 +92,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
Alert.ShowInTop("请选择交底负责单位!", MessageBoxIcon.Warning);
|
Alert.ShowInTop("请选择交底负责单位!", MessageBoxIcon.Warning);
|
||||||
return;
|
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();
|
Model.Comprehensive_ConTechnologyDisclosure newCon = new Model.Comprehensive_ConTechnologyDisclosure();
|
||||||
newCon.ProjectId = this.CurrUser.LoginProjectId;
|
newCon.ProjectId = this.CurrUser.LoginProjectId;
|
||||||
newCon.CNProfessionalId = this.drpCNProfessionalId.SelectedValue;
|
newCon.CNProfessionalId = this.drpCNProfessionalId.SelectedValue;
|
||||||
|
@ -112,6 +121,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
}
|
}
|
||||||
newCon.UnitWorkId = ids;
|
newCon.UnitWorkId = ids;
|
||||||
newCon.AttendMan = this.txtAttendMan.Text.Trim();
|
newCon.AttendMan = this.txtAttendMan.Text.Trim();
|
||||||
|
newCon.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(this.ConTechnologyDisclosureId))
|
if (string.IsNullOrEmpty(this.ConTechnologyDisclosureId))
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,6 +102,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.DropDownList drpUnitWorkIds;
|
protected global::FineUIPro.DropDownList drpUnitWorkIds;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtRemarkCode 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtAttendMan 控件。
|
/// txtAttendMan 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<Items>
|
<Items>
|
||||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="资料收发文登记记录" EnableCollapse="true"
|
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="资料收发文登记记录" EnableCollapse="true"
|
||||||
runat="server" BoxFlex="1" DataKeyNames="DataReceivingDocId" AllowCellEditing="true" EnableColumnLines="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"
|
SortDirection="DESC" OnSort="Grid1_Sort"
|
||||||
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
||||||
|
|
|
@ -54,7 +54,8 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
doc.CompileMan,
|
doc.CompileMan,
|
||||||
doc.CompileDate,
|
doc.CompileDate,
|
||||||
doc.Status,
|
doc.Status,
|
||||||
cnp.ProfessionalName "
|
cnp.ProfessionalName,
|
||||||
|
doc.RemarkCode "
|
||||||
+ @" FROM Comprehensive_DataReceivingDoc AS doc"
|
+ @" FROM Comprehensive_DataReceivingDoc AS doc"
|
||||||
+ @" LEFT JOIN Base_CNProfessional AS cnp ON cnp.CNProfessionalId = doc.CNProfessionalId"
|
+ @" LEFT JOIN Base_CNProfessional AS cnp ON cnp.CNProfessionalId = doc.CNProfessionalId"
|
||||||
+ @" WHERE doc.ProjectId = @ProjectId";
|
+ @" WHERE doc.ProjectId = @ProjectId";
|
||||||
|
@ -514,7 +515,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
|
|
||||||
cell = row.CreateCell(19);
|
cell = row.CreateCell(19);
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
cell.SetCellValue(item.RemarkCode);//标志编号
|
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -367,6 +367,17 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
{
|
{
|
||||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int c = Convert.ToInt32(row19);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row19 + "]错误!" + "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(result))
|
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 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();
|
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();
|
).FirstOrDefault();
|
||||||
if (oldViewInfo == null)
|
if (oldViewInfo == null)
|
||||||
{
|
{
|
||||||
|
@ -569,7 +580,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
des.IsOnFile = false;
|
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.CompileMan = this.CurrUser.UserId;
|
||||||
des.CompileDate = DateTime.Now;
|
des.CompileDate = DateTime.Now;
|
||||||
BLL.DataReceivingDocService.AddDataReceivingDoc(des);
|
BLL.DataReceivingDocService.AddDataReceivingDoc(des);
|
||||||
|
|
|
@ -117,7 +117,8 @@
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
<f:FormRow>
|
<f:FormRow>
|
||||||
<Items>
|
<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="Label1" runat="server"></f:Label>
|
||||||
<f:Label ID="Label3" runat="server"></f:Label>
|
<f:Label ID="Label3" runat="server"></f:Label>
|
||||||
</Items>
|
</Items>
|
||||||
|
|
|
@ -153,7 +153,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
this.rblIsOnFile.SelectedValue = "false";
|
this.rblIsOnFile.SelectedValue = "false";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.txtRemarkCode.Text = dataReceivingDoc.RemarkCode;
|
this.txtRemarkCode.Text = dataReceivingDoc.RemarkCode.HasValue ? dataReceivingDoc.RemarkCode.ToString() : "";
|
||||||
|
|
||||||
//var currApprove = DataReceivingDocApproveService.GetCurrentApprove(dataReceivingDoc.DataReceivingDocId);
|
//var currApprove = DataReceivingDocApproveService.GetCurrentApprove(dataReceivingDoc.DataReceivingDocId);
|
||||||
//if (currApprove != null)
|
//if (currApprove != null)
|
||||||
|
@ -212,7 +212,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning);
|
Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning);
|
||||||
return;
|
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)
|
if (q != null)
|
||||||
{
|
{
|
||||||
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning);
|
||||||
|
@ -274,7 +274,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
{
|
{
|
||||||
dataReceivingDoc.IsOnFile = Convert.ToBoolean(this.rblIsOnFile.SelectedValue);
|
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))
|
//if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue))
|
||||||
//{
|
//{
|
||||||
// dataReceivingDoc.AuditMan = drpAudit.SelectedValue;
|
// dataReceivingDoc.AuditMan = drpAudit.SelectedValue;
|
||||||
|
|
|
@ -271,7 +271,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtRemarkCode;
|
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Label1 控件。
|
/// Label1 控件。
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<Items>
|
<Items>
|
||||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="设备材料报验" EnableCollapse="true"
|
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="设备材料报验" EnableCollapse="true"
|
||||||
runat="server" BoxFlex="1" DataKeyNames="InspectionEquipmentId" AllowCellEditing="true" EnableColumnLines="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"
|
SortDirection="DESC" OnSort="Grid1_Sort"
|
||||||
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
||||||
|
|
|
@ -282,7 +282,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
protected void btnOut_Click(object sender, EventArgs e)
|
protected void btnOut_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string rootPath = Server.MapPath("~/");
|
string rootPath = Server.MapPath("~/");
|
||||||
string initTemplatePath = Const.InspectionEquipmentTempUrl;
|
string initTemplatePath = Const.InspectionEquipmentDataInUrl;
|
||||||
string uploadfilepath = string.Empty;
|
string uploadfilepath = string.Empty;
|
||||||
string newUrl = string.Empty;
|
string newUrl = string.Empty;
|
||||||
uploadfilepath = rootPath + initTemplatePath;
|
uploadfilepath = rootPath + initTemplatePath;
|
||||||
|
@ -306,10 +306,11 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
{
|
{
|
||||||
lists = lists.Where(x => x.InspectionDate <= Funs.GetNewDateTime(txtEndTime.Text.Trim()));
|
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)
|
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);
|
File.Copy(uploadfilepath, newUrl);
|
||||||
// 第一步:读取文件流
|
// 第一步:读取文件流
|
||||||
NPOI.SS.UserModel.IWorkbook workbook;
|
NPOI.SS.UserModel.IWorkbook workbook;
|
||||||
|
@ -344,7 +345,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||||
NPOI.SS.UserModel.ICell cell;
|
NPOI.SS.UserModel.ICell cell;
|
||||||
int i = 1;
|
int i = 2;
|
||||||
foreach (var item in lists)
|
foreach (var item in lists)
|
||||||
{
|
{
|
||||||
// 第二步:创建新数据行
|
// 第二步:创建新数据行
|
||||||
|
@ -360,10 +361,6 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
|
|
||||||
cell = row.CreateCell(2);
|
cell = row.CreateCell(2);
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
cell.SetCellValue(item.EquipmentNO);//设备位号
|
|
||||||
|
|
||||||
cell = row.CreateCell(3);
|
|
||||||
cell.CellStyle = cellStyle;
|
|
||||||
var cnp = BLL.CNProfessionalService.GetCNProfessional(item.CNProfessionalId);
|
var cnp = BLL.CNProfessionalService.GetCNProfessional(item.CNProfessionalId);
|
||||||
if (cnp != null)
|
if (cnp != null)
|
||||||
{
|
{
|
||||||
|
@ -374,6 +371,10 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
cell.SetCellValue(string.Empty);//专业
|
cell.SetCellValue(string.Empty);//专业
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cell = row.CreateCell(3);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(item.EquipmentNO);//设备位号
|
||||||
|
|
||||||
cell = row.CreateCell(4);
|
cell = row.CreateCell(4);
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
cell.SetCellValue(item.InspectionName);//名称
|
cell.SetCellValue(item.InspectionName);//名称
|
||||||
|
@ -422,6 +423,10 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
cell.SetCellValue(item.UsedPlace);//拟使用部位
|
cell.SetCellValue(item.UsedPlace);//拟使用部位
|
||||||
|
|
||||||
|
cell = row.CreateCell(13);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// 第三步:写入文件流
|
// 第三步:写入文件流
|
||||||
|
|
|
@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
oleDBConn.Close();
|
oleDBConn.Close();
|
||||||
oleDBConn.Dispose();
|
oleDBConn.Dispose();
|
||||||
|
|
||||||
AddDatasetToSQL(ds.Tables[0], 13);
|
AddDatasetToSQL(ds.Tables[0], 14);
|
||||||
hdCheckResult.Text = "1";
|
hdCheckResult.Text = "1";
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
|
@ -173,7 +173,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
|
|
||||||
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 = 0; i < ir; i++)
|
for (int i = 1; i < ir; i++)
|
||||||
{
|
{
|
||||||
Model.Comprehensive_InspectionEquipment oldViewInfo = new Model.Comprehensive_InspectionEquipment();
|
Model.Comprehensive_InspectionEquipment oldViewInfo = new Model.Comprehensive_InspectionEquipment();
|
||||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||||
|
@ -223,21 +223,23 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string row12 = pds.Rows[i][12].ToString();
|
string row13 = pds.Rows[i][13].ToString();
|
||||||
if (string.IsNullOrEmpty(row12))
|
if (string.IsNullOrEmpty(row13))
|
||||||
{
|
{
|
||||||
result += (i + 2).ToString() + "," + "标识编号" + "," + "此项为必填项!" + "|";
|
result += (i + 2).ToString() + "," + "标识编号" + "," + "此项为必填项!" + "|";
|
||||||
}
|
}
|
||||||
//else
|
else
|
||||||
//{
|
{
|
||||||
// var view = oldViewInfos.FirstOrDefault(x => x.RemarkCode == row12);
|
try
|
||||||
// if (view != null)
|
{
|
||||||
// {
|
int t = Convert.ToInt32(row13);
|
||||||
// result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row12 + "]已存在!" + "|";
|
}
|
||||||
// }
|
catch (Exception)
|
||||||
//}
|
{
|
||||||
|
result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row13 + "]错误!" + "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result += (i + 2).ToString() + "," + "报验单位" + "," + "[" + row0 + "]不存在!" + "|";
|
result += (i + 2).ToString() + "," + "报验单位" + "," + "[" + row0 + "]不存在!" + "|";
|
||||||
|
@ -349,7 +351,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
oleDBConn.Close();
|
oleDBConn.Close();
|
||||||
oleDBConn.Dispose();
|
oleDBConn.Dispose();
|
||||||
|
|
||||||
AddDatasetToSQL2(ds.Tables[0], 13);
|
AddDatasetToSQL2(ds.Tables[0], 14);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -388,7 +390,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
|
|
||||||
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 = 0; i < ir; i++)
|
for (int i = 1; i < ir; i++)
|
||||||
{
|
{
|
||||||
Model.Comprehensive_InspectionEquipment oldViewInfo = new Model.Comprehensive_InspectionEquipment();
|
Model.Comprehensive_InspectionEquipment oldViewInfo = new Model.Comprehensive_InspectionEquipment();
|
||||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||||
|
@ -396,7 +398,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
if (unitInfo != null && !string.IsNullOrEmpty(row0))
|
if (unitInfo != null && !string.IsNullOrEmpty(row0))
|
||||||
{
|
{
|
||||||
oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
|
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();
|
).FirstOrDefault();
|
||||||
if (oldViewInfo == null)//新增
|
if (oldViewInfo == null)//新增
|
||||||
{
|
{
|
||||||
|
@ -421,11 +423,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
{
|
{
|
||||||
Ins.InspectionDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
|
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.InspectionEquipmentId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionEquipment));
|
||||||
Ins.CompileMan = this.CurrUser.UserId;
|
Ins.CompileMan = this.CurrUser.UserId;
|
||||||
Ins.CompileDate = DateTime.Now.Date;
|
Ins.CompileDate = DateTime.Now.Date;
|
||||||
Ins.Status = BLL.Const.Comprehensive_Complete;
|
Ins.Status = BLL.Const.Comprehensive_Compile;
|
||||||
BLL.InspectionEquipmentService.AddInspectionEquipment(Ins);
|
BLL.InspectionEquipmentService.AddInspectionEquipment(Ins);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -451,10 +454,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
{
|
{
|
||||||
oldViewInfo.InspectionDate = Convert.ToDateTime(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.UsedPlace= pds.Rows[i][12].ToString().Trim();
|
||||||
|
oldViewInfo.RemarkCode =Funs.GetNewInt(pds.Rows[i][13].ToString().Trim());
|
||||||
oldViewInfo.CompileMan = this.CurrUser.UserId;
|
oldViewInfo.CompileMan = this.CurrUser.UserId;
|
||||||
oldViewInfo.CompileDate = DateTime.Now.Date;
|
oldViewInfo.CompileDate = DateTime.Now.Date;
|
||||||
oldViewInfo.Status = BLL.Const.Comprehensive_Complete;
|
oldViewInfo.Status = BLL.Const.Comprehensive_Compile;
|
||||||
BLL.InspectionEquipmentService.UpdateInspectionEquipment(oldViewInfo);
|
BLL.InspectionEquipmentService.UpdateInspectionEquipment(oldViewInfo);
|
||||||
//result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位报验编号已存在!" + "|";
|
//result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位报验编号已存在!" + "|";
|
||||||
}
|
}
|
||||||
|
@ -476,7 +480,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
#endregion
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 下载模板
|
#region 下载模板
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 下载模板按钮
|
/// 下载模板按钮
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
<f:FormRow>
|
<f:FormRow>
|
||||||
<Items>
|
<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>
|
<f:TextBox ID="txtUsedPlace" runat="server" Label="拟使用部位" MaxLength="100" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
|
||||||
</Items>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
this.drpSamplingResult.SelectedValue = inspectionEquipment.SamplingResult;
|
this.drpSamplingResult.SelectedValue = inspectionEquipment.SamplingResult;
|
||||||
}
|
}
|
||||||
this.txtInspectionDate.Text = inspectionEquipment.InspectionDate.HasValue ? string.Format("{0:yyyy-MM-dd}", inspectionEquipment.InspectionDate) : "";
|
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.txtEquipmentNo.Text = inspectionEquipment.EquipmentNO;
|
||||||
this.txtUsedPlace.Text = inspectionEquipment.UsedPlace;
|
this.txtUsedPlace.Text = inspectionEquipment.UsedPlace;
|
||||||
var currApprove = InspectionEquipmentApproveService.GetCurrentApprove(inspectionEquipment.InspectionEquipmentId);
|
var currApprove = InspectionEquipmentApproveService.GetCurrentApprove(inspectionEquipment.InspectionEquipmentId);
|
||||||
|
@ -243,6 +243,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
|
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
|
||||||
return;
|
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();
|
Model.Comprehensive_InspectionEquipment newInspectionEquipment = new Model.Comprehensive_InspectionEquipment();
|
||||||
newInspectionEquipment.ProjectId = this.CurrUser.LoginProjectId;
|
newInspectionEquipment.ProjectId = this.CurrUser.LoginProjectId;
|
||||||
|
@ -256,7 +262,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
newInspectionEquipment.Specifications = this.txtSpecifications.Text.Trim();
|
newInspectionEquipment.Specifications = this.txtSpecifications.Text.Trim();
|
||||||
newInspectionEquipment.Supplier = this.txtSupplier.Text.Trim();
|
newInspectionEquipment.Supplier = this.txtSupplier.Text.Trim();
|
||||||
newInspectionEquipment.EquipmentNO = this.txtEquipmentNo.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.Counts = this.txtCounts.Text.Trim();
|
||||||
newInspectionEquipment.Unit = this.txtUnit.Text.Trim();
|
newInspectionEquipment.Unit = this.txtUnit.Text.Trim();
|
||||||
newInspectionEquipment.SamplingCount = this.txtSamplingCount.Text.Trim();
|
newInspectionEquipment.SamplingCount = this.txtSamplingCount.Text.Trim();
|
||||||
|
@ -324,6 +330,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
return;
|
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();
|
Model.Comprehensive_InspectionEquipment newInspectionEquipment = new Model.Comprehensive_InspectionEquipment();
|
||||||
newInspectionEquipment.ProjectId = this.CurrUser.LoginProjectId;
|
newInspectionEquipment.ProjectId = this.CurrUser.LoginProjectId;
|
||||||
newInspectionEquipment.UnitId = this.drpUnitId.SelectedValue;
|
newInspectionEquipment.UnitId = this.drpUnitId.SelectedValue;
|
||||||
|
@ -336,7 +348,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
newInspectionEquipment.Specifications = this.txtSpecifications.Text.Trim();
|
newInspectionEquipment.Specifications = this.txtSpecifications.Text.Trim();
|
||||||
newInspectionEquipment.Supplier = this.txtSupplier.Text.Trim();
|
newInspectionEquipment.Supplier = this.txtSupplier.Text.Trim();
|
||||||
newInspectionEquipment.EquipmentNO = this.txtEquipmentNo.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.Counts = this.txtCounts.Text.Trim();
|
||||||
newInspectionEquipment.Unit = this.txtUnit.Text.Trim();
|
newInspectionEquipment.Unit = this.txtUnit.Text.Trim();
|
||||||
newInspectionEquipment.SamplingCount = this.txtSamplingCount.Text.Trim();
|
newInspectionEquipment.SamplingCount = this.txtSamplingCount.Text.Trim();
|
||||||
|
|
|
@ -7,12 +7,10 @@
|
||||||
// </自动生成>
|
// </自动生成>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace FineUIPro.Web.CQMS.Comprehensive
|
namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public partial class InspectionEquipmentEdit
|
public partial class InspectionEquipmentEdit {
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// form1 控件。
|
/// form1 控件。
|
||||||
|
@ -174,7 +172,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtRemarkCode;
|
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtUsedPlace 控件。
|
/// txtUsedPlace 控件。
|
||||||
|
|
|
@ -305,7 +305,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
protected void btnOut_Click(object sender, EventArgs e)
|
protected void btnOut_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string rootPath = Server.MapPath("~/");
|
string rootPath = Server.MapPath("~/");
|
||||||
string initTemplatePath = Const.InspectionMachineTempUrl;
|
string initTemplatePath = Const.InspectionMachineDataInUrl;
|
||||||
string uploadfilepath = string.Empty;
|
string uploadfilepath = string.Empty;
|
||||||
string newUrl = string.Empty;
|
string newUrl = string.Empty;
|
||||||
uploadfilepath = rootPath + initTemplatePath;
|
uploadfilepath = rootPath + initTemplatePath;
|
||||||
|
@ -325,10 +325,11 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
{
|
{
|
||||||
lists = lists.Where(x => x.InspectionType == this.sdrpType.SelectedValue);
|
lists = lists.Where(x => x.InspectionType == this.sdrpType.SelectedValue);
|
||||||
}
|
}
|
||||||
lists = lists.OrderBy(x => x.UnitId);
|
lists = lists.OrderBy(x => x.RemarkCode);
|
||||||
if (lists != null)
|
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);
|
File.Copy(uploadfilepath, newUrl);
|
||||||
// 第一步:读取文件流
|
// 第一步:读取文件流
|
||||||
NPOI.SS.UserModel.IWorkbook workbook;
|
NPOI.SS.UserModel.IWorkbook workbook;
|
||||||
|
@ -363,7 +364,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||||
NPOI.SS.UserModel.ICell cell;
|
NPOI.SS.UserModel.ICell cell;
|
||||||
int i = 1;
|
int i = 2;
|
||||||
foreach (var item in lists)
|
foreach (var item in lists)
|
||||||
{
|
{
|
||||||
// 第二步:创建新数据行
|
// 第二步:创建新数据行
|
||||||
|
@ -449,8 +450,28 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
|
|
||||||
cell = row.CreateCell(12);
|
cell = row.CreateCell(12);
|
||||||
cell.CellStyle = cellStyle;
|
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.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++;
|
i++;
|
||||||
}
|
}
|
||||||
// 第三步:写入文件流
|
// 第三步:写入文件流
|
||||||
|
|
|
@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
oleDBConn.Close();
|
oleDBConn.Close();
|
||||||
oleDBConn.Dispose();
|
oleDBConn.Dispose();
|
||||||
|
|
||||||
AddDatasetToSQL(ds.Tables[0], 14);
|
AddDatasetToSQL(ds.Tables[0], 15);
|
||||||
hdCheckResult.Text = "1";
|
hdCheckResult.Text = "1";
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
|
@ -173,7 +173,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
|
|
||||||
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 = 0; i < ir; i++)
|
for (int i = 1; i < ir; i++)
|
||||||
{
|
{
|
||||||
Model.Comprehensive_InspectionMachine oldViewInfo = new Model.Comprehensive_InspectionMachine();
|
Model.Comprehensive_InspectionMachine oldViewInfo = new Model.Comprehensive_InspectionMachine();
|
||||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||||
|
@ -269,20 +269,39 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
string row12 = pds.Rows[i][12].ToString();
|
string row12 = pds.Rows[i][12].ToString();
|
||||||
if (!string.IsNullOrEmpty(row12))
|
if (!string.IsNullOrEmpty(row12))
|
||||||
{
|
{
|
||||||
try
|
if (row12 != "是" && row12 != "否")
|
||||||
{
|
{
|
||||||
DateTime leaveDate = Convert.ToDateTime(row12);
|
result += (i + 2).ToString() + "," + "校验合格" + "," + "[" + row12 + "]错误!" + "|";
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
result += (i + 2).ToString() + "," + "离场时间" + "," + "[" + row12 + "]错误!" + "|";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string row13 = pds.Rows[i][13].ToString();
|
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() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int t = Convert.ToInt32(row14);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row14 + "]错误!" + "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -393,7 +412,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
oleDBConn.Close();
|
oleDBConn.Close();
|
||||||
oleDBConn.Dispose();
|
oleDBConn.Dispose();
|
||||||
|
|
||||||
AddDatasetToSQL2(ds.Tables[0], 14);
|
AddDatasetToSQL2(ds.Tables[0], 15);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -432,7 +451,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
|
|
||||||
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 = 0; i < ir; i++)
|
for (int i = 1; i < ir; i++)
|
||||||
{
|
{
|
||||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||||
var unitInfo = units.Where(y => y.UnitName == row0).FirstOrDefault();
|
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();
|
Model.Comprehensive_InspectionMachine oldViewInfo = new Model.Comprehensive_InspectionMachine();
|
||||||
oldViewInfo = oldViewInfos.FirstOrDefault(x => x.UnitId == unitInfo.UnitId
|
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)
|
if (oldViewInfo==null)
|
||||||
{
|
{
|
||||||
Model.Comprehensive_InspectionMachine Ins = new Model.Comprehensive_InspectionMachine();
|
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());
|
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.InspectionMachineId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionMachine));
|
||||||
Ins.CompileMan = this.CurrUser.UserId;
|
Ins.CompileMan = this.CurrUser.UserId;
|
||||||
Ins.CompileDate = DateTime.Now.Date;
|
Ins.CompileDate = DateTime.Now.Date;
|
||||||
|
@ -533,11 +553,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
{
|
{
|
||||||
oldViewInfo.UnitsCount = Convert.ToInt32(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.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.CompileMan = this.CurrUser.UserId;
|
||||||
oldViewInfo.CompileDate = DateTime.Now.Date;
|
oldViewInfo.CompileDate = DateTime.Now.Date;
|
||||||
|
|
|
@ -89,6 +89,7 @@
|
||||||
</f:Button>
|
</f:Button>
|
||||||
</Items>
|
</Items>
|
||||||
</f:Panel>
|
</f:Panel>
|
||||||
|
<f:NumberBox ID="txtRemarkCode" runat="server" Label="标志编号" LabelAlign="Right" Required="true" ShowRedStar="true" NoDecimal="true" NoNegative="true" LabelWidth="110px"></f:NumberBox>
|
||||||
</Items>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
<f:FormRow MarginTop="10px">
|
<f:FormRow MarginTop="10px">
|
||||||
|
|
|
@ -93,6 +93,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
{
|
{
|
||||||
drpAudit.SelectedValue = inspectionMachine.AuditMan;
|
drpAudit.SelectedValue = inspectionMachine.AuditMan;
|
||||||
}
|
}
|
||||||
|
this.txtRemarkCode.Text = inspectionMachine.RemarkCode.HasValue ? inspectionMachine.RemarkCode.ToString() : "";
|
||||||
var currApprove = InspectionMachineApproveService.GetCurrentApprove(inspectionMachine.InspectionMachineId);
|
var currApprove = InspectionMachineApproveService.GetCurrentApprove(inspectionMachine.InspectionMachineId);
|
||||||
if (currApprove != null)
|
if (currApprove != null)
|
||||||
{ //重新编制 编制人 可以 显示 提交 保存按钮
|
{ //重新编制 编制人 可以 显示 提交 保存按钮
|
||||||
|
@ -151,6 +152,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
this.txtTestCycle.Readonly = true;
|
this.txtTestCycle.Readonly = true;
|
||||||
this.txtUnitsCount.Readonly = true;
|
this.txtUnitsCount.Readonly = true;
|
||||||
this.drpAudit.Readonly = true;
|
this.drpAudit.Readonly = true;
|
||||||
|
this.txtRemarkCode.Readonly = true;
|
||||||
//this.btnAttach.Enabled = false;
|
//this.btnAttach.Enabled = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -191,6 +193,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
|
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
|
||||||
return;
|
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();
|
Model.Comprehensive_InspectionMachine inspectionMachone = new Model.Comprehensive_InspectionMachine();
|
||||||
inspectionMachone.ProjectId = this.CurrUser.LoginProjectId;
|
inspectionMachone.ProjectId = this.CurrUser.LoginProjectId;
|
||||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
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.IsCheckOK = this.rblIsCheckOK.SelectedValue == "true" ? true : false;
|
||||||
inspectionMachone.LeaveDate = Funs.GetNewDateTime(this.txtLeaveDate.Text);
|
inspectionMachone.LeaveDate = Funs.GetNewDateTime(this.txtLeaveDate.Text);
|
||||||
inspectionMachone.UnitsCount = Funs.GetNewInt(this.txtUnitsCount.Text.Trim());
|
inspectionMachone.UnitsCount = Funs.GetNewInt(this.txtUnitsCount.Text.Trim());
|
||||||
|
inspectionMachone.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||||
if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue))
|
if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue))
|
||||||
{
|
{
|
||||||
inspectionMachone.AuditMan = drpAudit.SelectedValue;
|
inspectionMachone.AuditMan = drpAudit.SelectedValue;
|
||||||
|
@ -259,6 +268,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
|
Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning);
|
||||||
return;
|
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();
|
Model.Comprehensive_InspectionMachine inspectionMachone = new Model.Comprehensive_InspectionMachine();
|
||||||
inspectionMachone.ProjectId = this.CurrUser.LoginProjectId;
|
inspectionMachone.ProjectId = this.CurrUser.LoginProjectId;
|
||||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||||
|
|
|
@ -192,6 +192,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Button btnAttach;
|
protected global::FineUIPro.Button btnAttach;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtRemarkCode 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// drpAudit 控件。
|
/// drpAudit 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -372,7 +372,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
protected void btnOut_Click(object sender, EventArgs e)
|
protected void btnOut_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string rootPath = Server.MapPath("~/");
|
string rootPath = Server.MapPath("~/");
|
||||||
string initTemplatePath = Const.InspectionPersonTempUrl;
|
string initTemplatePath = Const.InspectionPersonDataInUrl;
|
||||||
string uploadfilepath = string.Empty;
|
string uploadfilepath = string.Empty;
|
||||||
string newUrl = string.Empty;
|
string newUrl = string.Empty;
|
||||||
uploadfilepath = rootPath + initTemplatePath;
|
uploadfilepath = rootPath + initTemplatePath;
|
||||||
|
@ -392,10 +392,11 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
{
|
{
|
||||||
lists = lists.Where(x => x.PersonName.Contains(this.stxtPersonName.Text.Trim()));
|
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)
|
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);
|
File.Copy(uploadfilepath, newUrl);
|
||||||
// 第一步:读取文件流
|
// 第一步:读取文件流
|
||||||
NPOI.SS.UserModel.IWorkbook workbook;
|
NPOI.SS.UserModel.IWorkbook workbook;
|
||||||
|
@ -430,7 +431,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||||
NPOI.SS.UserModel.ICell cell;
|
NPOI.SS.UserModel.ICell cell;
|
||||||
int i = 1;
|
int i = 2;
|
||||||
foreach (var item in lists)
|
foreach (var item in lists)
|
||||||
{
|
{
|
||||||
// 第二步:创建新数据行
|
// 第二步:创建新数据行
|
||||||
|
@ -446,6 +447,10 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
|
|
||||||
cell = row.CreateCell(2);
|
cell = row.CreateCell(2);
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(item.PersonName);//姓名
|
||||||
|
|
||||||
|
cell = row.CreateCell(3);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
string proName = string.Empty;
|
string proName = string.Empty;
|
||||||
var cnp = BLL.CNProfessionalService.GetCNProfessional(item.CNProfessionalId);
|
var cnp = BLL.CNProfessionalService.GetCNProfessional(item.CNProfessionalId);
|
||||||
if (cnp != null)
|
if (cnp != null)
|
||||||
|
@ -454,7 +459,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
}
|
}
|
||||||
cell.SetCellValue(proName);//专业
|
cell.SetCellValue(proName);//专业
|
||||||
|
|
||||||
cell = row.CreateCell(3);
|
cell = row.CreateCell(4);
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
string unitWork = string.Empty;
|
string unitWork = string.Empty;
|
||||||
if (!string.IsNullOrEmpty(item.UnitWorkId))
|
if (!string.IsNullOrEmpty(item.UnitWorkId))
|
||||||
|
@ -463,23 +468,19 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
}
|
}
|
||||||
cell.SetCellValue(unitWork);//单位工程名称
|
cell.SetCellValue(unitWork);//单位工程名称
|
||||||
|
|
||||||
cell = row.CreateCell(4);
|
cell = row.CreateCell(5);
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
string postName = string.Empty;
|
string postName = string.Empty;
|
||||||
if (!string.IsNullOrEmpty(item.PostId))
|
if (!string.IsNullOrEmpty(item.PostId))
|
||||||
{
|
{
|
||||||
var post = BLL.PostService.GetPostById(item.PostId);
|
var post = BLL.PostService.GetPostById(item.PostId);
|
||||||
if (post!=null)
|
if (post != null)
|
||||||
{
|
{
|
||||||
postName = post.PostName;
|
postName = post.PostName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cell.SetCellValue(postName);//工种
|
cell.SetCellValue(postName);//工种
|
||||||
|
|
||||||
cell = row.CreateCell(5);
|
|
||||||
cell.CellStyle = cellStyle;
|
|
||||||
cell.SetCellValue(item.PersonName);//姓名
|
|
||||||
|
|
||||||
cell = row.CreateCell(6);
|
cell = row.CreateCell(6);
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
cell.SetCellValue(item.CertificateNumber);//证书编号
|
cell.SetCellValue(item.CertificateNumber);//证书编号
|
||||||
|
@ -498,8 +499,42 @@ namespace FineUIPro.Web.Comprehensive
|
||||||
|
|
||||||
cell = row.CreateCell(10);
|
cell = row.CreateCell(10);
|
||||||
cell.CellStyle = cellStyle;
|
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.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++;
|
i++;
|
||||||
}
|
}
|
||||||
// 第三步:写入文件流
|
// 第三步:写入文件流
|
||||||
|
|
|
@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
oleDBConn.Close();
|
oleDBConn.Close();
|
||||||
oleDBConn.Dispose();
|
oleDBConn.Dispose();
|
||||||
|
|
||||||
AddDatasetToSQL(ds.Tables[0], 13);
|
AddDatasetToSQL(ds.Tables[0], 15);
|
||||||
hdCheckResult.Text = "1";
|
hdCheckResult.Text = "1";
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
|
@ -172,28 +172,21 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
select x;
|
select x;
|
||||||
|
|
||||||
var cns = from x in Funs.DB.Base_CNProfessional 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;
|
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();
|
Model.Comprehensive_InspectionPerson oldViewInfo = new Model.Comprehensive_InspectionPerson();
|
||||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||||
var unitInfo = units.Where(y => y.UnitName == row0).FirstOrDefault();
|
var unitInfo = units.Where(y => y.UnitName == row0).FirstOrDefault();
|
||||||
if (unitInfo != null && !string.IsNullOrEmpty(row0))
|
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();
|
string row1 = pds.Rows[i][1].ToString();
|
||||||
if (string.IsNullOrEmpty(row1))
|
if (string.IsNullOrEmpty(row1))
|
||||||
{
|
{
|
||||||
|
@ -219,23 +212,24 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
string row4 = pds.Rows[i][4].ToString();
|
string row4 = pds.Rows[i][4].ToString();
|
||||||
if (!string.IsNullOrEmpty(row4))
|
if (!string.IsNullOrEmpty(row4))
|
||||||
{
|
{
|
||||||
var post = posts.Where(x => x.PostName == row4.Trim()).FirstOrDefault();
|
string[] reunit = row4.Split(',');
|
||||||
if (post == null)
|
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();
|
string row5 = pds.Rows[i][5].ToString();
|
||||||
if (!string.IsNullOrEmpty(row7))
|
if (!string.IsNullOrEmpty(row5))
|
||||||
{
|
{
|
||||||
try
|
var post = posts.Where(x => x.PostName == row5.Trim()).FirstOrDefault();
|
||||||
|
if (post == null)
|
||||||
{
|
{
|
||||||
DateTime date = Convert.ToDateTime(row7.Trim());
|
result += (i + 2).ToString() + "," + "工种" + "," + "[" + row5 + "]不存在!" + "|";
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
result += (i + 2).ToString() + "," + "有效期" + "," + "[" + row7 + "]错误!" + "|";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,36 +242,69 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
}
|
}
|
||||||
catch (Exception)
|
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 (!string.IsNullOrEmpty(row9))
|
||||||
{
|
|
||||||
if (row9 != "是" && row9 != "否")
|
|
||||||
{
|
|
||||||
result += (i + 2).ToString() + "," + "是否在场" + "," + "[" + row9 + "]错误!" + "|";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
string row10 = pds.Rows[i][10].ToString();
|
|
||||||
if (!string.IsNullOrEmpty(row10))
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DateTime date = Convert.ToDateTime(row10.Trim());
|
DateTime date = Convert.ToDateTime(row9.Trim());
|
||||||
}
|
}
|
||||||
catch (Exception)
|
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();
|
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() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int t = Convert.ToInt32(row14);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row14 + "]错误!" + "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -388,7 +415,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
oleDBConn.Close();
|
oleDBConn.Close();
|
||||||
oleDBConn.Dispose();
|
oleDBConn.Dispose();
|
||||||
|
|
||||||
AddDatasetToSQL2(ds.Tables[0], 13);
|
AddDatasetToSQL2(ds.Tables[0], 15);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -426,9 +453,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
select x;
|
select x;
|
||||||
|
|
||||||
var cns = from x in Funs.DB.Base_CNProfessional 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;
|
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();
|
Model.Comprehensive_InspectionPerson oldViewInfo = new Model.Comprehensive_InspectionPerson();
|
||||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||||
|
@ -436,7 +469,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
if (unitInfo != null && !string.IsNullOrEmpty(row0))
|
if (unitInfo != null && !string.IsNullOrEmpty(row0))
|
||||||
{
|
{
|
||||||
oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
|
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();
|
).FirstOrDefault();
|
||||||
if (oldViewInfo == null)
|
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;
|
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()))
|
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());
|
||||||
}
|
}
|
||||||
|
if (!string.IsNullOrEmpty(pds.Rows[i][5].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()))
|
|
||||||
{
|
{
|
||||||
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()))
|
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][9].ToString().Trim()))
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(pds.Rows[i][10].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.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
|
||||||
Ins.RemarkCode = pds.Rows[i][12].ToString().Trim();
|
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.InspectionPersonId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionPerson));
|
||||||
Ins.CompileMan = this.CurrUser.UserId;
|
Ins.CompileMan = this.CurrUser.UserId;
|
||||||
Ins.CompileDate = DateTime.Now.Date;
|
Ins.CompileDate = DateTime.Now.Date;
|
||||||
Ins.Status = BLL.Const.Comprehensive_Compile;
|
Ins.Status = BLL.Const.Comprehensive_Compile;
|
||||||
Ins.IsTrain = true;
|
|
||||||
BLL.InspectionPersonService.AddInspectionPerson(Ins);
|
BLL.InspectionPersonService.AddInspectionPerson(Ins);
|
||||||
if (pds.Rows[i][4].ToString().Trim() == "焊工")
|
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;
|
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()))
|
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());
|
||||||
}
|
}
|
||||||
|
if (!string.IsNullOrEmpty(pds.Rows[i][5].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()))
|
|
||||||
{
|
{
|
||||||
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()))
|
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][9].ToString().Trim()))
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(pds.Rows[i][10].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.IsOnSite = pds.Rows[i][10].ToString().Trim() == "是" ? true : false;
|
||||||
oldViewInfo.RemarkCode= pds.Rows[i][12].ToString().Trim();
|
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.CompileMan = this.CurrUser.UserId;
|
||||||
oldViewInfo.CompileDate = DateTime.Now.Date;
|
oldViewInfo.CompileDate = DateTime.Now.Date;
|
||||||
oldViewInfo.Status = BLL.Const.Comprehensive_Compile;
|
oldViewInfo.Status = BLL.Const.Comprehensive_Compile;
|
||||||
oldViewInfo.IsTrain = true;
|
|
||||||
BLL.InspectionPersonService.UpdateInspectionPerson(oldViewInfo);
|
BLL.InspectionPersonService.UpdateInspectionPerson(oldViewInfo);
|
||||||
if (pds.Rows[i][4].ToString().Trim() == "焊工")
|
if (pds.Rows[i][4].ToString().Trim() == "焊工")
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
<f:RadioItem Text="是" Value="true" Selected="true" />
|
<f:RadioItem Text="是" Value="true" Selected="true" />
|
||||||
<f:RadioItem Text="否" Value="false" />
|
<f:RadioItem Text="否" Value="false" />
|
||||||
</f:RadioButtonList>
|
</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>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
<f:FormRow>
|
<f:FormRow>
|
||||||
|
@ -86,6 +86,7 @@
|
||||||
</f:Button>
|
</f:Button>
|
||||||
</Items>
|
</Items>
|
||||||
</f:Panel>
|
</f:Panel>
|
||||||
|
<f:TextBox ID="txtRemark" runat="server" Label="备注" MaxLength="150" LabelWidth="150px" LabelAlign="Right"></f:TextBox>
|
||||||
</Items>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
this.drpUnitWorkIds.SelectedValueArray = inspectionPerson.UnitWorkId.Split(',');
|
this.drpUnitWorkIds.SelectedValueArray = inspectionPerson.UnitWorkId.Split(',');
|
||||||
}
|
}
|
||||||
this.txtRemark.Text = inspectionPerson.Remark;
|
this.txtRemark.Text = inspectionPerson.Remark;
|
||||||
|
this.txtRemarkCode.Text = inspectionPerson.RemarkCode.HasValue ? inspectionPerson.RemarkCode.ToString() : "";
|
||||||
|
|
||||||
|
|
||||||
var currApprove = InspectionPersonApproveService.GetCurrentApprove(inspectionPerson.InspectionPersonId);
|
var currApprove = InspectionPersonApproveService.GetCurrentApprove(inspectionPerson.InspectionPersonId);
|
||||||
|
@ -173,6 +174,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
this.drpPostId.Readonly = true;
|
this.drpPostId.Readonly = true;
|
||||||
this.drpAudit.Readonly = true;
|
this.drpAudit.Readonly = true;
|
||||||
this.drpUnitWorkIds.Readonly = true;
|
this.drpUnitWorkIds.Readonly = true;
|
||||||
|
this.txtRemarkCode.Readonly = true;
|
||||||
//this.btnAttach.Enabled = false;
|
//this.btnAttach.Enabled = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -223,6 +225,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
return;
|
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();
|
Model.BS_Welder welder = new Model.BS_Welder();
|
||||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
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.DepartureTime = Convert.ToDateTime(this.txtDepartureTime.Text.ToString());
|
||||||
}
|
}
|
||||||
inspectionPerson.Remark = this.txtRemark.Text.Trim();
|
inspectionPerson.Remark = this.txtRemark.Text.Trim();
|
||||||
|
inspectionPerson.RemarkCode =Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||||
string ids = string.Empty;
|
string ids = string.Empty;
|
||||||
var lists = this.drpUnitWorkIds.SelectedValueArray;
|
var lists = this.drpUnitWorkIds.SelectedValueArray;
|
||||||
foreach (var item in lists)
|
foreach (var item in lists)
|
||||||
|
@ -401,6 +410,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
return;
|
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();
|
Model.BS_Welder welder = new Model.BS_Welder();
|
||||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
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.DepartureTime = Convert.ToDateTime(this.txtDepartureTime.Text.ToString());
|
||||||
}
|
}
|
||||||
inspectionPerson.Remark = this.txtRemark.Text.Trim();
|
inspectionPerson.Remark = this.txtRemark.Text.Trim();
|
||||||
|
inspectionPerson.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||||
string ids = string.Empty;
|
string ids = string.Empty;
|
||||||
var lists = this.drpUnitWorkIds.SelectedValueArray;
|
var lists = this.drpUnitWorkIds.SelectedValueArray;
|
||||||
foreach (var item in lists)
|
foreach (var item in lists)
|
||||||
|
|
|
@ -166,13 +166,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||||
protected global::FineUIPro.RadioButtonList rblIsTrain;
|
protected global::FineUIPro.RadioButtonList rblIsTrain;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtRemark 控件。
|
/// txtRemarkCode 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtRemark;
|
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Panel2 控件。
|
/// Panel2 控件。
|
||||||
|
@ -201,6 +201,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Button btnAttach;
|
protected global::FineUIPro.Button btnAttach;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtRemark 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.TextBox txtRemark;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// drpAudit 控件。
|
/// drpAudit 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -212,7 +212,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
protected void btnOut_Click(object sender, EventArgs e)
|
protected void btnOut_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string rootPath = Server.MapPath("~/");
|
string rootPath = Server.MapPath("~/");
|
||||||
string initTemplatePath = Const.TrainingRecordsTempUrl;
|
string initTemplatePath = Const.CQMS_TrainingRecordsTemplateUrl;
|
||||||
string uploadfilepath = string.Empty;
|
string uploadfilepath = string.Empty;
|
||||||
string newUrl = string.Empty;
|
string newUrl = string.Empty;
|
||||||
uploadfilepath = rootPath + initTemplatePath;
|
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.Where(x => x.TrainingContents.Contains(this.txtTrainingContents.Text.Trim()));
|
||||||
}
|
}
|
||||||
|
lists = lists.OrderBy(x => x.RemarkCode);
|
||||||
if (lists != null)
|
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);
|
File.Copy(uploadfilepath, newUrl);
|
||||||
// 第一步:读取文件流
|
// 第一步:读取文件流
|
||||||
NPOI.SS.UserModel.IWorkbook workbook;
|
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.ISheet sheet = workbook.GetSheetAt(0);
|
||||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||||
NPOI.SS.UserModel.ICell cell;
|
NPOI.SS.UserModel.ICell cell;
|
||||||
int i = 1;
|
int i = 2;
|
||||||
foreach (var item in lists)
|
foreach (var item in lists)
|
||||||
{
|
{
|
||||||
// 第二步:创建新数据行
|
// 第二步:创建新数据行
|
||||||
|
@ -304,6 +306,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
cell = row.CreateCell(6);
|
cell = row.CreateCell(6);
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
cell.SetCellValue(item.Remark);//备注
|
cell.SetCellValue(item.Remark);//备注
|
||||||
|
|
||||||
|
cell = row.CreateCell(7);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// 第三步:写入文件流
|
// 第三步:写入文件流
|
||||||
|
|
|
@ -165,7 +165,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
|
|
||||||
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 = 0; i < ir; i++)
|
for (int i = 1; i < ir; i++)
|
||||||
{
|
{
|
||||||
string row0 = pds.Rows[i][0].ToString();
|
string row0 = pds.Rows[i][0].ToString();
|
||||||
if (string.IsNullOrEmpty(row0))
|
if (string.IsNullOrEmpty(row0))
|
||||||
|
@ -217,6 +217,17 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
{
|
{
|
||||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int t = Convert.ToInt32(row7);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row7 + "]错误!" + "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(result))
|
if (!string.IsNullOrEmpty(result))
|
||||||
{
|
{
|
||||||
|
@ -356,13 +367,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
|
|
||||||
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 = 0; i < ir; i++)
|
for (int i = 1; i < ir; i++)
|
||||||
{
|
{
|
||||||
Model.Comprehensive_TrainingRecords oldViewInfo = new Model.Comprehensive_TrainingRecords();
|
Model.Comprehensive_TrainingRecords oldViewInfo = new Model.Comprehensive_TrainingRecords();
|
||||||
|
|
||||||
string row1 = pds.Rows[i][1].ToString().Trim();
|
string row1 = pds.Rows[i][1].ToString().Trim();
|
||||||
var cn = cns.Where(y => y.ProfessionalName == row1).FirstOrDefault();
|
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();
|
).FirstOrDefault();
|
||||||
if (oldViewInfo == null)
|
if (oldViewInfo == null)
|
||||||
{
|
{
|
||||||
|
@ -379,7 +390,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
}
|
}
|
||||||
des.KeynoteSpeaker = pds.Rows[i][5].ToString().Trim();
|
des.KeynoteSpeaker = pds.Rows[i][5].ToString().Trim();
|
||||||
des.Remark = pds.Rows[i][6].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);
|
BLL.TrainingRecordsService.AddTrainingRecords(des);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,11 @@
|
||||||
<f:TextBox ID="txtKeynoteSpeaker" runat="server" Label="主讲人" MaxLength="50" LabelAlign="Right" LabelWidth="130px"></f:TextBox>
|
<f:TextBox ID="txtKeynoteSpeaker" runat="server" Label="主讲人" MaxLength="50" LabelAlign="Right" LabelWidth="130px"></f:TextBox>
|
||||||
</Items>
|
</Items>
|
||||||
</f:FormRow>
|
</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>
|
<f:FormRow>
|
||||||
<Items>
|
<Items>
|
||||||
<f:TextArea ID="txtRemark" runat="server" Label="备注" MaxLength="50" LabelAlign="Right" LabelWidth="130px"></f:TextArea>
|
<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.txtHours.Text = trainingRecords.Hours.HasValue ? trainingRecords.Hours.ToString() : "";
|
||||||
this.txtKeynoteSpeaker.Text = trainingRecords.KeynoteSpeaker;
|
this.txtKeynoteSpeaker.Text = trainingRecords.KeynoteSpeaker;
|
||||||
this.txtRemark.Text = trainingRecords.Remark;
|
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);
|
Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning);
|
||||||
return;
|
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();
|
Model.Comprehensive_TrainingRecords trainingRecords = new Model.Comprehensive_TrainingRecords();
|
||||||
trainingRecords.CNProfessionalId = this.drpCNProfessionalId.SelectedValue;
|
trainingRecords.CNProfessionalId = this.drpCNProfessionalId.SelectedValue;
|
||||||
trainingRecords.TrainingContents = this.txtTrainingContents.Text.Trim();
|
trainingRecords.TrainingContents = this.txtTrainingContents.Text.Trim();
|
||||||
|
@ -76,6 +83,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||||
trainingRecords.Hours = Funs.GetNewDecimal(this.txtHours.Text.Trim());
|
trainingRecords.Hours = Funs.GetNewDecimal(this.txtHours.Text.Trim());
|
||||||
trainingRecords.KeynoteSpeaker = this.txtKeynoteSpeaker.Text.Trim();
|
trainingRecords.KeynoteSpeaker = this.txtKeynoteSpeaker.Text.Trim();
|
||||||
trainingRecords.Remark = this.txtRemark.Text.Trim();
|
trainingRecords.Remark = this.txtRemark.Text.Trim();
|
||||||
|
trainingRecords.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim());
|
||||||
if (!string.IsNullOrEmpty(this.TrainingRecordsId))
|
if (!string.IsNullOrEmpty(this.TrainingRecordsId))
|
||||||
{
|
{
|
||||||
trainingRecords.TrainingRecordsId = this.TrainingRecordsId;
|
trainingRecords.TrainingRecordsId = this.TrainingRecordsId;
|
||||||
|
|
|
@ -93,6 +93,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtKeynoteSpeaker;
|
protected global::FineUIPro.TextBox txtKeynoteSpeaker;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtRemarkCode 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.NumberBox txtRemarkCode;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtRemark 控件。
|
/// txtRemark 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||||
<UseIISExpress>true</UseIISExpress>
|
<UseIISExpress>true</UseIISExpress>
|
||||||
<Use64BitIISExpress>false</Use64BitIISExpress>
|
<Use64BitIISExpress>false</Use64BitIISExpress>
|
||||||
<IISExpressSSLPort />
|
<IISExpressSSLPort />
|
||||||
|
|
|
@ -87250,7 +87250,7 @@ namespace Model
|
||||||
|
|
||||||
private System.Nullable<System.DateTime> _CompileDate;
|
private System.Nullable<System.DateTime> _CompileDate;
|
||||||
|
|
||||||
private string _RemarkCode;
|
private System.Nullable<int> _RemarkCode;
|
||||||
|
|
||||||
private EntityRef<Base_CNProfessional> _Base_CNProfessional;
|
private EntityRef<Base_CNProfessional> _Base_CNProfessional;
|
||||||
|
|
||||||
|
@ -87288,7 +87288,7 @@ namespace Model
|
||||||
partial void OnCompileManChanged();
|
partial void OnCompileManChanged();
|
||||||
partial void OnCompileDateChanging(System.Nullable<System.DateTime> value);
|
partial void OnCompileDateChanging(System.Nullable<System.DateTime> value);
|
||||||
partial void OnCompileDateChanged();
|
partial void OnCompileDateChanged();
|
||||||
partial void OnRemarkCodeChanging(string value);
|
partial void OnRemarkCodeChanging(System.Nullable<int> value);
|
||||||
partial void OnRemarkCodeChanged();
|
partial void OnRemarkCodeChanged();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -87557,8 +87557,8 @@ namespace Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")]
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="Int")]
|
||||||
public string RemarkCode
|
public System.Nullable<int> RemarkCode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -89539,7 +89539,7 @@ namespace Model
|
||||||
|
|
||||||
private string _AuditMan;
|
private string _AuditMan;
|
||||||
|
|
||||||
private string _RemarkCode;
|
private System.Nullable<int> _RemarkCode;
|
||||||
|
|
||||||
private EntityRef<Base_CNProfessional> _Base_CNProfessional;
|
private EntityRef<Base_CNProfessional> _Base_CNProfessional;
|
||||||
|
|
||||||
|
@ -89603,7 +89603,7 @@ namespace Model
|
||||||
partial void OnStatusChanged();
|
partial void OnStatusChanged();
|
||||||
partial void OnAuditManChanging(string value);
|
partial void OnAuditManChanging(string value);
|
||||||
partial void OnAuditManChanged();
|
partial void OnAuditManChanged();
|
||||||
partial void OnRemarkCodeChanging(string value);
|
partial void OnRemarkCodeChanging(System.Nullable<int> value);
|
||||||
partial void OnRemarkCodeChanged();
|
partial void OnRemarkCodeChanged();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -90128,8 +90128,8 @@ namespace Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")]
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="Int")]
|
||||||
public string RemarkCode
|
public System.Nullable<int> RemarkCode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -93788,7 +93788,7 @@ namespace Model
|
||||||
|
|
||||||
private string _EquipmentNO;
|
private string _EquipmentNO;
|
||||||
|
|
||||||
private string _RemarkCode;
|
private System.Nullable<int> _RemarkCode;
|
||||||
|
|
||||||
private string _UsedPlace;
|
private string _UsedPlace;
|
||||||
|
|
||||||
|
@ -93844,7 +93844,7 @@ namespace Model
|
||||||
partial void OnCompileDateChanged();
|
partial void OnCompileDateChanged();
|
||||||
partial void OnEquipmentNOChanging(string value);
|
partial void OnEquipmentNOChanging(string value);
|
||||||
partial void OnEquipmentNOChanged();
|
partial void OnEquipmentNOChanged();
|
||||||
partial void OnRemarkCodeChanging(string value);
|
partial void OnRemarkCodeChanging(System.Nullable<int> value);
|
||||||
partial void OnRemarkCodeChanged();
|
partial void OnRemarkCodeChanged();
|
||||||
partial void OnUsedPlaceChanging(string value);
|
partial void OnUsedPlaceChanging(string value);
|
||||||
partial void OnUsedPlaceChanged();
|
partial void OnUsedPlaceChanged();
|
||||||
|
@ -94200,8 +94200,8 @@ namespace Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")]
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="Int")]
|
||||||
public string RemarkCode
|
public System.Nullable<int> RemarkCode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -94765,7 +94765,7 @@ namespace Model
|
||||||
|
|
||||||
private string _AuditMan;
|
private string _AuditMan;
|
||||||
|
|
||||||
private string _RemarkCode;
|
private System.Nullable<int> _RemarkCode;
|
||||||
|
|
||||||
private EntityRef<Base_CNProfessional> _Base_CNProfessional;
|
private EntityRef<Base_CNProfessional> _Base_CNProfessional;
|
||||||
|
|
||||||
|
@ -94819,7 +94819,7 @@ namespace Model
|
||||||
partial void OnStatusChanged();
|
partial void OnStatusChanged();
|
||||||
partial void OnAuditManChanging(string value);
|
partial void OnAuditManChanging(string value);
|
||||||
partial void OnAuditManChanged();
|
partial void OnAuditManChanged();
|
||||||
partial void OnRemarkCodeChanging(string value);
|
partial void OnRemarkCodeChanging(System.Nullable<int> value);
|
||||||
partial void OnRemarkCodeChanged();
|
partial void OnRemarkCodeChanged();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -95263,8 +95263,8 @@ namespace Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")]
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="Int")]
|
||||||
public string RemarkCode
|
public System.Nullable<int> RemarkCode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -95708,7 +95708,7 @@ namespace Model
|
||||||
|
|
||||||
private string _AuditMan;
|
private string _AuditMan;
|
||||||
|
|
||||||
private string _RemarkCode;
|
private System.Nullable<int> _RemarkCode;
|
||||||
|
|
||||||
private EntityRef<Base_Post> _Base_Post;
|
private EntityRef<Base_Post> _Base_Post;
|
||||||
|
|
||||||
|
@ -95770,7 +95770,7 @@ namespace Model
|
||||||
partial void OnStatusChanged();
|
partial void OnStatusChanged();
|
||||||
partial void OnAuditManChanging(string value);
|
partial void OnAuditManChanging(string value);
|
||||||
partial void OnAuditManChanged();
|
partial void OnAuditManChanged();
|
||||||
partial void OnRemarkCodeChanging(string value);
|
partial void OnRemarkCodeChanging(System.Nullable<int> value);
|
||||||
partial void OnRemarkCodeChanged();
|
partial void OnRemarkCodeChanged();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -96222,8 +96222,8 @@ namespace Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")]
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="Int")]
|
||||||
public string RemarkCode
|
public System.Nullable<int> RemarkCode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -102801,7 +102801,7 @@ namespace Model
|
||||||
|
|
||||||
private string _Remark;
|
private string _Remark;
|
||||||
|
|
||||||
private string _RemarkCode;
|
private System.Nullable<int> _RemarkCode;
|
||||||
|
|
||||||
private EntityRef<Base_CNProfessional> _Base_CNProfessional;
|
private EntityRef<Base_CNProfessional> _Base_CNProfessional;
|
||||||
|
|
||||||
|
@ -102829,7 +102829,7 @@ namespace Model
|
||||||
partial void OnKeynoteSpeakerChanged();
|
partial void OnKeynoteSpeakerChanged();
|
||||||
partial void OnRemarkChanging(string value);
|
partial void OnRemarkChanging(string value);
|
||||||
partial void OnRemarkChanged();
|
partial void OnRemarkChanged();
|
||||||
partial void OnRemarkCodeChanging(string value);
|
partial void OnRemarkCodeChanging(System.Nullable<int> value);
|
||||||
partial void OnRemarkCodeChanged();
|
partial void OnRemarkCodeChanged();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -103028,8 +103028,8 @@ namespace Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")]
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="Int")]
|
||||||
public string RemarkCode
|
public System.Nullable<int> RemarkCode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||||
<UseIISExpress>true</UseIISExpress>
|
<UseIISExpress>true</UseIISExpress>
|
||||||
<Use64BitIISExpress />
|
<Use64BitIISExpress />
|
||||||
<IISExpressSSLPort />
|
<IISExpressSSLPort />
|
||||||
|
|
Loading…
Reference in New Issue