全厂移交统计表
This commit is contained in:
commit
b3d60a2ee0
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<Use64BitIISExpress>false</Use64BitIISExpress>
|
||||
<IISExpressSSLPort />
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -40,6 +40,8 @@
|
|||
</f:CheckBox>--%>
|
||||
|
||||
<f:Button ID="BtnAnalyse" Text="统计" Icon="ChartPie" runat="server" OnClick="BtnAnalyse_Click"></f:Button>
|
||||
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
|
@ -63,9 +65,20 @@
|
|||
</Items>
|
||||
|
||||
<Items>
|
||||
<f:Tree ID="Tree1" IsFluid="true" ShowHeader="true" EnableCollapse="false"
|
||||
Title="System" runat="server" Width="400px" CssStyle="width:200px; height:600px">
|
||||
<%-- <f:Tree ID="Tree1" IsFluid="true" ShowHeader="true" EnableCollapse="false"
|
||||
Title="System" runat="server" Width="400px" CssStyle="width:200px; height:600px"
|
||||
OnNodeCommand="tvControlItem_NodeCommand"
|
||||
AutoLeafIdentification="true">
|
||||
</f:Tree>--%>
|
||||
<%--<f:Tree ID="Tree1" IsFluid="true" EnableCollapse="false" ShowHeader="false"
|
||||
OnNodeCommand="tvControlItem_NodeCommand" CssStyle="width:200px; height:600px"
|
||||
runat="server">
|
||||
</f:Tree>--%>
|
||||
<f:Tree ID="trRectify" Width="200px" EnableCollapse="true" ShowHeader="true"
|
||||
CssStyle="width:200px; height:600px"
|
||||
OnNodeCommand="trRectify_NodeCommand" AutoLeafIdentification="true" runat="server">
|
||||
</f:Tree>
|
||||
|
||||
</Items>
|
||||
</f:Tab>
|
||||
</Tabs>
|
||||
|
|
|
@ -52,6 +52,12 @@ namespace FineUIPro.Web.Transfer.Chart
|
|||
/// </summary>
|
||||
private void AnalyseData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(ProjectId))
|
||||
{
|
||||
Alert.ShowInTop("项目未获取到,请刷新页面。", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var sTime = DateTime.Now.AddDays(-7);
|
||||
var eTime = DateTime.Now; ;
|
||||
|
||||
|
@ -64,8 +70,9 @@ namespace FineUIPro.Web.Transfer.Chart
|
|||
}
|
||||
|
||||
//查询当前日期中的system的具体数目,去除重复
|
||||
var list = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == ProjectId
|
||||
&& x.Test_Package_FINISH >= sTime && x.Test_Package_FINISH <= eTime).ToList();
|
||||
var list = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId
|
||||
&& x.FDate >= sTime && x.FDate <= eTime).ToList();
|
||||
|
||||
var SystemList = (from x in list select x.SystemName).Distinct();
|
||||
|
||||
//先加载左侧system 树菜单
|
||||
|
@ -87,39 +94,63 @@ namespace FineUIPro.Web.Transfer.Chart
|
|||
Model.SpTDesktopItem newspItem = new Model.SpTDesktopItem();
|
||||
rowTime["日期"] = string.Format("{0:yyyy-MM-dd}", i); ;
|
||||
//根据日期查询当前system的数量
|
||||
var systemListbyDate = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == ProjectId
|
||||
&& x.Test_Package_FINISH >= Convert.ToDateTime(rowTime["日期"])
|
||||
&& x.Test_Package_FINISH < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList();
|
||||
var systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId
|
||||
&& x.FDate >= Convert.ToDateTime(rowTime["日期"])
|
||||
&& x.FDate < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList();
|
||||
|
||||
//具体的system 去重
|
||||
var systemList = (from x in systemListbyDate select x.SystemName).Distinct();
|
||||
if (systemList.ToList().Count>0)
|
||||
//查询TestPackage 去重
|
||||
var testpackageList = (from x in systemListbyDate select x.TestPackage).Distinct();
|
||||
|
||||
if (testpackageList.ToList().Count>0)
|
||||
{
|
||||
systemBol = true;
|
||||
}
|
||||
foreach (var item in systemList)
|
||||
foreach (var item in testpackageList)
|
||||
{
|
||||
//查询当前日期每个system的数量
|
||||
var systemSumCount = systemListbyDate.Where(x => x.SystemName == item).ToList().Count;
|
||||
//查询当前日期每个testpackage的数量
|
||||
var systemSumCount = systemListbyDate.Where(x => x.TestPackage == item).ToList().Count;
|
||||
|
||||
//子系统中完成的数量
|
||||
var subSystemSumCount = systemListbyDate.Where(x => x.SystemName == item &&
|
||||
x.FINAL_Status.ToLower() == "finished").ToList().Count;
|
||||
var subSystemSumCount = systemListbyDate.Where(x => x.TestPackage == item &&
|
||||
x.Status.ToLower() == "finished").ToList().Count;
|
||||
|
||||
//子系统中没完成的情况
|
||||
var subSystemSumNotStartCount = systemListbyDate.Where(x => x.SystemName == item &&
|
||||
x.FINAL_Status.ToLower() == "not start").ToList().Count;
|
||||
var subSystemSumNotStartCount = systemListbyDate.Where(x => x.TestPackage == item &&
|
||||
(x.Status.ToLower() == "not start"|| x.Status=="" || x.Status==null )).ToList().Count;
|
||||
|
||||
//如果总数量等于完成的数量,完成量+1
|
||||
if (systemSumCount == subSystemSumCount)
|
||||
{
|
||||
//如果都是完成,需要最后 12表 test packge 必须是Finished才能是完成
|
||||
var punchlistFromList= Funs.DB.Transfer_PunchlistFrom.Where(x=>x.ProjectId==ProjectId
|
||||
&& x.Test_Package==item
|
||||
&& x.PUNCH_ITEM_FINISH_DATE>= Convert.ToDateTime(rowTime["日期"])
|
||||
&& x.PUNCH_ITEM_FINISH_DATE < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList();
|
||||
//如果查到
|
||||
if (punchlistFromList.Count > 0)
|
||||
{
|
||||
//12表当前日期完成的数量
|
||||
var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
|
||||
//如果完成的数量等于总得数量,则是完成
|
||||
if (punchlistFromFinshCount == punchlistFromList.Count)
|
||||
{
|
||||
finishedCount += 1;
|
||||
}
|
||||
else {
|
||||
inProgress += 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
inProgress += 1;
|
||||
}
|
||||
}
|
||||
//如果总数量等于not start,未开始量+1
|
||||
else if (systemSumCount== subSystemSumNotStartCount)
|
||||
{
|
||||
notStart += 1;
|
||||
}
|
||||
else {
|
||||
inProgress += 1;
|
||||
|
||||
}
|
||||
}
|
||||
rowTime["Finished"] = finishedCount;
|
||||
|
@ -130,7 +161,7 @@ namespace FineUIPro.Web.Transfer.Chart
|
|||
}
|
||||
if (systemBol)
|
||||
{
|
||||
this.ChartUc.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "Instrumentation PROGRESS", this.drpChartType.SelectedValue, 1100, 600, false));
|
||||
this.ChartUc.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "PROGRESS REPORT", this.drpChartType.SelectedValue, 1100, 600, false));
|
||||
}
|
||||
|
||||
|
||||
|
@ -161,75 +192,158 @@ namespace FineUIPro.Web.Transfer.Chart
|
|||
|
||||
private void LoadData(IEnumerable<String> list)
|
||||
{
|
||||
Tree1.Nodes.Clear();
|
||||
// 模拟从数据库返回数据表
|
||||
DataTable table = CreateDataTable(list);
|
||||
|
||||
DataSet ds = new DataSet();
|
||||
ds.Tables.Add(table);
|
||||
ds.Relations.Add("TreeRelation", ds.Tables[0].Columns["Id"], ds.Tables[0].Columns["ParentId"]);
|
||||
|
||||
foreach (DataRow row in ds.Tables[0].Rows)
|
||||
this.trRectify.Nodes.Clear();
|
||||
this.trRectify.ShowBorder = false;
|
||||
this.trRectify.ShowHeader = false;
|
||||
this.trRectify.EnableIcons = true;
|
||||
this.trRectify.AutoScroll = true;
|
||||
this.trRectify.EnableSingleClickExpand = true;
|
||||
TreeNode rootNode = new TreeNode
|
||||
{
|
||||
if (row.IsNull("ParentId"))
|
||||
{
|
||||
TreeNode node = new TreeNode();
|
||||
node.Text = row["Text"].ToString();
|
||||
Tree1.Nodes.Add(node);
|
||||
|
||||
ResolveSubTree(row, node);
|
||||
}
|
||||
}
|
||||
Text = "全部",
|
||||
NodeID = "ALL",
|
||||
EnableClickEvent = true,
|
||||
Expanded = true
|
||||
};
|
||||
this.trRectify.Nodes.Add(rootNode);
|
||||
BoundTree(rootNode.Nodes, list);
|
||||
}
|
||||
|
||||
private void ResolveSubTree(DataRow dataRow, TreeNode treeNode)
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
/// </summary>
|
||||
/// <param name="nodes"></param>
|
||||
/// <param name="menuId"></param>
|
||||
private void BoundTree(TreeNodeCollection nodes, IEnumerable<String> list)
|
||||
{
|
||||
DataRow[] rows = dataRow.GetChildRows("TreeRelation");
|
||||
if (rows.Length > 0)
|
||||
{
|
||||
// 如果是目录,则默认展开
|
||||
treeNode.Expanded = true;
|
||||
foreach (DataRow row in rows)
|
||||
{
|
||||
TreeNode node = new TreeNode();
|
||||
node.Text = row["Text"].ToString();
|
||||
treeNode.Nodes.Add(node);
|
||||
|
||||
ResolveSubTree(row, node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region CreateDataTable
|
||||
|
||||
private DataTable CreateDataTable(IEnumerable<String> list)
|
||||
{
|
||||
DataTable table = new DataTable();
|
||||
DataColumn column1 = new DataColumn("Id", typeof(string));
|
||||
DataColumn column2 = new DataColumn("Text", typeof(String));
|
||||
DataColumn column3 = new DataColumn("ParentId", typeof(string));
|
||||
table.Columns.Add(column1);
|
||||
table.Columns.Add(column2);
|
||||
table.Columns.Add(column3);
|
||||
|
||||
DataRow row = table.NewRow();
|
||||
row[0] = "ALL";
|
||||
row[1] = "全部";
|
||||
row[2] = DBNull.Value;
|
||||
table.Rows.Add(row);
|
||||
|
||||
TreeNode tn = null;
|
||||
foreach (var item in list)
|
||||
{
|
||||
row = table.NewRow();
|
||||
row[0] = item.ToString();
|
||||
row[1] = item.ToString();
|
||||
row[2] = "ALL";
|
||||
table.Rows.Add(row);
|
||||
tn = new TreeNode
|
||||
{
|
||||
Text = item.ToString(),
|
||||
NodeID = item.ToString(),
|
||||
EnableClickEvent = true
|
||||
};
|
||||
nodes.Add(tn);
|
||||
}
|
||||
return table;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 点击树节点
|
||||
protected void trRectify_NodeCommand(object sender, TreeCommandEventArgs e) {
|
||||
var SystemName = this.trRectify.SelectedNodeID;
|
||||
if (SystemName == "ALL")
|
||||
{
|
||||
AnalyseData();
|
||||
}
|
||||
else
|
||||
{
|
||||
var sTime = DateTime.Now.AddDays(-7);
|
||||
var eTime = DateTime.Now; ;
|
||||
|
||||
//如果没有填写日期,则是七天内的
|
||||
if (!string.IsNullOrEmpty(txtStarTime.Text) && !string.IsNullOrEmpty(txtEndTime.Text))
|
||||
{
|
||||
sTime = Convert.ToDateTime(txtStarTime.Text);
|
||||
eTime = Convert.ToDateTime(txtEndTime.Text);
|
||||
|
||||
}
|
||||
DataTable dtTime = new DataTable();
|
||||
dtTime.Columns.Add("日期", typeof(string));
|
||||
dtTime.Columns.Add("Finished", typeof(string));
|
||||
dtTime.Columns.Add("In Progress", typeof(string));
|
||||
dtTime.Columns.Add("Not Start", typeof(string));
|
||||
|
||||
var systemBol = false;
|
||||
for (var i = sTime; i <= eTime; i = i.AddDays(1))
|
||||
{
|
||||
var finishedCount = 0;
|
||||
var inProgress = 0;
|
||||
var notStart = 0;
|
||||
DataRow rowTime = dtTime.NewRow();
|
||||
Model.SpTDesktopItem newspItem = new Model.SpTDesktopItem();
|
||||
rowTime["日期"] = string.Format("{0:yyyy-MM-dd}", i); ;
|
||||
//根据日期查询当前system的数量
|
||||
var systemListbyDate = Funs.DB.View_TransferDetail.Where(x => x.Projectid == ProjectId && x.SystemName == SystemName
|
||||
&& x.FDate >= Convert.ToDateTime(rowTime["日期"])
|
||||
&& x.FDate < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList();
|
||||
|
||||
//查询TestPackage 去重
|
||||
var testpackageList = (from x in systemListbyDate select x.TestPackage).Distinct();
|
||||
|
||||
if (testpackageList.ToList().Count > 0)
|
||||
{
|
||||
systemBol = true;
|
||||
}
|
||||
foreach (var item in testpackageList)
|
||||
{
|
||||
//查询当前日期每个testpackage的数量
|
||||
var systemSumCount = systemListbyDate.Where(x => x.TestPackage == item).ToList().Count;
|
||||
|
||||
//子系统中完成的数量
|
||||
var subSystemSumCount = systemListbyDate.Where(x => x.TestPackage == item &&
|
||||
x.Status.ToLower() == "finished").ToList().Count;
|
||||
|
||||
//子系统中没完成的情况
|
||||
var subSystemSumNotStartCount = systemListbyDate.Where(x => x.TestPackage == item &&
|
||||
(x.Status.ToLower() == "not start" || x.Status == "" || x.Status == null)).ToList().Count;
|
||||
|
||||
//如果总数量等于完成的数量,完成量+1
|
||||
if (systemSumCount == subSystemSumCount)
|
||||
{
|
||||
//如果都是完成,需要最后 12表 test packge 必须是Finished才能是完成
|
||||
var punchlistFromList = Funs.DB.Transfer_PunchlistFrom.Where(x => x.ProjectId == ProjectId
|
||||
&& x.SystemName==SystemName
|
||||
&& x.Test_Package == item
|
||||
&& x.PUNCH_ITEM_FINISH_DATE >= Convert.ToDateTime(rowTime["日期"])
|
||||
&& x.PUNCH_ITEM_FINISH_DATE < Convert.ToDateTime(rowTime["日期"]).AddDays(1)).ToList();
|
||||
//如果查到
|
||||
if (punchlistFromList.Count > 0)
|
||||
{
|
||||
//12表当前日期完成的数量
|
||||
var punchlistFromFinshCount = punchlistFromList.Where(x => x.PUNCH_ITEM_STATUS.ToLower() == "finished").ToList().Count();
|
||||
//如果完成的数量等于总得数量,则是完成
|
||||
if (punchlistFromFinshCount == punchlistFromList.Count)
|
||||
{
|
||||
finishedCount += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
inProgress += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inProgress += 1;
|
||||
}
|
||||
}
|
||||
//如果总数量等于not start,未开始量+1
|
||||
else if (systemSumCount == subSystemSumNotStartCount)
|
||||
{
|
||||
notStart += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
inProgress += 1;
|
||||
}
|
||||
}
|
||||
rowTime["Finished"] = finishedCount;
|
||||
rowTime["In Progress"] = inProgress;
|
||||
rowTime["Not Start"] = notStart;
|
||||
dtTime.Rows.Add(rowTime);
|
||||
|
||||
}
|
||||
if (systemBol)
|
||||
{
|
||||
this.ChartUc.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "SYSTEM PROGRESS REPORT", this.drpChartType.SelectedValue, 1100, 600, false));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -141,12 +141,12 @@ namespace FineUIPro.Web.Transfer.Chart
|
|||
protected global::Web.Controls.ChartControl ChartUc;
|
||||
|
||||
/// <summary>
|
||||
/// Tree1 控件。
|
||||
/// trRectify 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree Tree1;
|
||||
protected global::FineUIPro.Tree trRectify;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer
|
|||
}
|
||||
}
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row4))
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -328,11 +328,13 @@ namespace FineUIPro.Web.Transfer
|
|||
{
|
||||
List<Model.Transfer_Civil_Structure> list = new List<Model.Transfer_Civil_Structure>();
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
|
||||
{
|
||||
//查询第一列,没查到的情况下作导入处理
|
||||
var modelOnly = Funs.DB.Transfer_Civil_Structure.FirstOrDefault(x => x.Civil_Structure == pds.Rows[i][0].ToString().Trim()
|
||||
&& x.ProjectId == CurrUser.LoginProjectId);
|
||||
if (modelOnly==null)
|
||||
if (modelOnly == null)
|
||||
{
|
||||
Model.Transfer_Civil_Structure model = new Model.Transfer_Civil_Structure();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
|
@ -366,6 +368,7 @@ namespace FineUIPro.Web.Transfer
|
|||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Funs.DB.Transfer_Civil_Structure.InsertAllOnSubmit(list);
|
||||
|
|
|
@ -180,7 +180,7 @@ namespace FineUIPro.Web.Transfer
|
|||
}
|
||||
}
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row4))
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -327,6 +327,8 @@ namespace FineUIPro.Web.Transfer
|
|||
{
|
||||
List<Model.Transfer_Electrical> list = new List<Model.Transfer_Electrical>();
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
|
||||
{
|
||||
//查询第一列,没查到的情况下作导入处理
|
||||
var modelOnly = Funs.DB.Transfer_Electrical.FirstOrDefault(x => x.ELECTRICAL == pds.Rows[i][0].ToString().Trim()
|
||||
|
@ -365,6 +367,7 @@ namespace FineUIPro.Web.Transfer
|
|||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Funs.DB.Transfer_Electrical.InsertAllOnSubmit(list);
|
||||
|
|
|
@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer
|
|||
}
|
||||
}
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row4))
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -328,6 +328,8 @@ namespace FineUIPro.Web.Transfer
|
|||
{
|
||||
List<Model.Transfer_Firefighting> list = new List<Model.Transfer_Firefighting>();
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
|
||||
{
|
||||
//查询第一列,没查到的情况下作导入处理
|
||||
var modelOnly = Funs.DB.Transfer_Firefighting.FirstOrDefault(x => x.Firefighting == pds.Rows[i][0].ToString().Trim() && x.ProjectId == CurrUser.LoginProjectId);
|
||||
|
@ -365,6 +367,7 @@ namespace FineUIPro.Web.Transfer
|
|||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Funs.DB.Transfer_Firefighting.InsertAllOnSubmit(list);
|
||||
|
|
|
@ -180,7 +180,7 @@ namespace FineUIPro.Web.Transfer
|
|||
}
|
||||
}
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row4))
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -327,6 +327,8 @@ namespace FineUIPro.Web.Transfer
|
|||
{
|
||||
List<Model.Transfer_HVAC> list = new List<Model.Transfer_HVAC>();
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
|
||||
{
|
||||
//查询第一列,没查到的情况下作导入处理
|
||||
var modelOnly = Funs.DB.Transfer_HVAC.FirstOrDefault(x => x.HVAC == pds.Rows[i][0].ToString().Trim()
|
||||
|
@ -365,6 +367,7 @@ namespace FineUIPro.Web.Transfer
|
|||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Funs.DB.Transfer_HVAC.InsertAllOnSubmit(list);
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace FineUIPro.Web.Transfer
|
|||
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
|
||||
oleDBConnString += "Data Source=";
|
||||
oleDBConnString += fileName;
|
||||
oleDBConnString += ";Extended Properties=Excel 8.0;";
|
||||
oleDBConnString += ";Extended Properties='Excel 8.0';";
|
||||
OleDbConnection oleDBConn = null;
|
||||
OleDbDataAdapter oleAdMaster = null;
|
||||
DataTable m_tableName = new DataTable();
|
||||
|
@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer
|
|||
}
|
||||
}
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row4))
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -328,10 +328,12 @@ namespace FineUIPro.Web.Transfer
|
|||
{
|
||||
List<Model.Transfer_Instrumentation> list = new List<Model.Transfer_Instrumentation>();
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
|
||||
{
|
||||
//查询第一列,没查到的情况下作导入处理
|
||||
var modelOnly = Funs.DB.Transfer_Instrumentation.FirstOrDefault(x => x.INSTRUMENTATION == pds.Rows[i][0].ToString().Trim()
|
||||
&& x.ProjectId==CurrUser.LoginProjectId);
|
||||
&& x.ProjectId == CurrUser.LoginProjectId);
|
||||
if (modelOnly == null)
|
||||
{
|
||||
Model.Transfer_Instrumentation model = new Model.Transfer_Instrumentation();
|
||||
|
@ -350,7 +352,8 @@ namespace FineUIPro.Web.Transfer
|
|||
model.FINAL_Status = pds.Rows[i][6].ToString().Trim();
|
||||
list.Add(model);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
//修改
|
||||
modelOnly.INSTRUMENTATION = pds.Rows[i][0].ToString().Trim();
|
||||
modelOnly.SystemName = pds.Rows[i][1].ToString().Trim();
|
||||
|
@ -364,6 +367,9 @@ namespace FineUIPro.Web.Transfer
|
|||
modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim();
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
|
|
|
@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer
|
|||
}
|
||||
}
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row4))
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -328,6 +328,8 @@ namespace FineUIPro.Web.Transfer
|
|||
{
|
||||
List<Model.Transfer_Plumbing> list = new List<Model.Transfer_Plumbing>();
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
|
||||
{
|
||||
//查询第一列,没查到的情况下作导入处理
|
||||
var modelOnly = Funs.DB.Transfer_Plumbing.FirstOrDefault(x => x.Plumbing == pds.Rows[i][0].ToString().Trim()
|
||||
|
@ -366,6 +368,7 @@ namespace FineUIPro.Web.Transfer
|
|||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Funs.DB.Transfer_Plumbing.InsertAllOnSubmit(list);
|
||||
|
|
|
@ -316,9 +316,11 @@ namespace FineUIPro.Web.Transfer
|
|||
{
|
||||
List<Model.Transfer_PunchlistFrom> list = new List<Model.Transfer_PunchlistFrom>();
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][1].ToString().Trim()))
|
||||
{
|
||||
//查询第一列,没查到的情况下作导入处理
|
||||
var modelOnly = Funs.DB.Transfer_PunchlistFrom.FirstOrDefault(x => x.Punch_No == pds.Rows[i][0].ToString().Trim()
|
||||
var modelOnly = Funs.DB.Transfer_PunchlistFrom.FirstOrDefault(x => x.Punch_No == pds.Rows[i][1].ToString().Trim()
|
||||
&& x.ProjectId == CurrUser.LoginProjectId);
|
||||
if (modelOnly == null)
|
||||
{
|
||||
|
@ -370,6 +372,7 @@ namespace FineUIPro.Web.Transfer
|
|||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Funs.DB.Transfer_PunchlistFrom.InsertAllOnSubmit(list);
|
||||
|
|
|
@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer
|
|||
}
|
||||
}
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row4))
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -328,6 +328,8 @@ namespace FineUIPro.Web.Transfer
|
|||
{
|
||||
List<Model.Transfer_Telecom> list = new List<Model.Transfer_Telecom>();
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
|
||||
{
|
||||
//查询第一列,没查到的情况下作导入处理
|
||||
var modelOnly = Funs.DB.Transfer_Telecom.FirstOrDefault(x => x.Telecom == pds.Rows[i][0].ToString().Trim()
|
||||
|
@ -366,6 +368,7 @@ namespace FineUIPro.Web.Transfer
|
|||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Funs.DB.Transfer_Telecom.InsertAllOnSubmit(list);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
|
|
Loading…
Reference in New Issue