This commit is contained in:
李云虎 2024-07-29 17:25:07 +08:00
parent 1eb9661726
commit 569205fa76
14 changed files with 1149 additions and 68 deletions

View File

@ -10,7 +10,7 @@
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="RegionPanel1" AjaxAspnetControls="divAccidentUnit,divAccidentTime" />
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="RegionPanel1" AjaxAspnetControls="divAccidentUnit,divAccidentTime,divAccidentTime1" />
<f:Panel ID="Panel3" CssClass="blockpanel" runat="server" EnableCollapse="false"
BodyPadding="10px" ShowBorder="true" ShowHeader="false">
<Items>
@ -30,7 +30,7 @@
OnSelectedIndexChanged="drpChartType_SelectedIndexChanged" Width="300px" LabelWidth="80px">
<f:ListItem Value="Line" Text="折线图"></f:ListItem>
<f:ListItem Value="Column" Text="柱形图"></f:ListItem>
<%-- <f:ListItem Value="Pie" Text="饼形图"></f:ListItem>
<%-- <f:ListItem Value="Pie" Text="饼形图"></f:ListItem>
<f:ListItem Value="StackedArea" Text="堆积面积图"></f:ListItem>
<f:ListItem Value="Spline" Text="样条图"></f:ListItem>
<f:ListItem Value="SplineArea" Text="样条面积图"></f:ListItem>
@ -52,7 +52,7 @@
<f:TabStrip ID="TabStrip1" CssClass="f-tabstrip-theme-simple" Height="600px" ShowBorder="true"
TabPosition="Top" MarginBottom="5px" EnableTabCloseMenu="false" runat="server">
<Tabs>
<f:Tab ID="Tab2" Title="图形" BodyPadding="5px" Layout="Fit" IconFont="Bookmark" runat="server"
<f:Tab ID="Tab1" Title="图形" BodyPadding="5px" Layout="Fit" IconFont="Bookmark" runat="server"
TitleToolTip="图形">
<Items>
<f:ContentPanel ShowHeader="false" runat="server" ID="cpAccidentTime" Margin="0 0 0 0">
@ -62,6 +62,15 @@
</f:ContentPanel>
</Items>
</f:Tab>
<f:Tab ID="Tab2" Title="百分比" BodyPadding="5px" Layout="Fit" IconFont="Bookmark" runat="server" TitleToolTip="百分比">
<Items>
<f:ContentPanel ShowHeader="false" runat="server" ID="ContentPanel1" Margin="0 0 0 0">
<div id="divAccidentTime1">
<uc1:ChartControl ID="ChartAccidentTime1" runat="server" />
</div>
</f:ContentPanel>
</Items>
</f:Tab>
</Tabs>
</f:TabStrip>
</Items>

View File

@ -58,11 +58,34 @@ namespace FineUIPro.Web.Transfer.Chart
rowTime["日期"] = QueryTime.ToString("yyyy/MM/dd");
DateTime startTime = Convert.ToDateTime(QueryTime.ToString("yyyy-MM-dd") + " 00:00:00");
DateTime endTime = Convert.ToDateTime(QueryTime.ToString("yyyy-MM-dd") + " 23:59:59");
rowTime["计划完成数量"] = forms.Where(x => x.Required_Date >= startTime && x.Required_Date <= endTime).Count();
rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date >= startTime && x.Actual_Date <= endTime).Count();
//rowTime["计划完成数量"] = forms.Where(x => x.Required_Date >= startTime && x.Required_Date <= endTime).Count();
//rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date >= startTime && x.Actual_Date <= endTime).Count();
rowTime["计划完成数量"] = forms.Where(x => x.Required_Date <= endTime).Count();
rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date <= endTime).Count();
dtTime.Rows.Add(rowTime);
}
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "尾项完成统计分析", this.drpChartType.SelectedValue, 1300, 550, false));
///按单位统计
DataTable dtTime1 = new DataTable();
dtTime1.Columns.Add("日期", typeof(string));
dtTime1.Columns.Add("计划完成百分比(%)", typeof(string));
dtTime1.Columns.Add("实际完成百分比(%)", typeof(string));
for (int i = 6; i >= 0; i--)
{
DataRow rowTime = dtTime1.NewRow();
DateTime QueryTime = DateTime.Now.AddDays(i * -1);
rowTime["日期"] = QueryTime.ToString("yyyy/MM/dd");
DateTime startTime = Convert.ToDateTime(QueryTime.ToString("yyyy-MM-dd") + " 00:00:00");
DateTime endTime = Convert.ToDateTime(QueryTime.ToString("yyyy-MM-dd") + " 23:59:59");
double jhCount = forms.Where(x => x.Required_Date <= endTime).Count();
double sjCount = forms.Where(x => x.Actual_Date <= endTime).Count();
double allCount = forms.Count();
rowTime["计划完成百分比(%)"] = allCount == 0 ? "0.00" : (jhCount / allCount * 100).ToString("0.00");
rowTime["实际完成百分比(%)"] = allCount == 0 ? "0.00" : (sjCount / allCount * 100).ToString("0.00");
dtTime1.Rows.Add(rowTime);
}
this.ChartAccidentTime1.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime1, "尾项完成统计分析", this.drpChartType.SelectedValue, 1300, 550, false));
}
#endregion
@ -81,11 +104,34 @@ namespace FineUIPro.Web.Transfer.Chart
rowTime["月份"] = QueryTime.ToString("yyyy/MM");
DateTime startTime = QueryTime;
DateTime endTime = Convert.ToDateTime(QueryTime.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd") + " 23:59:59");
rowTime["计划完成数量"] = forms.Where(x => x.Required_Date >= startTime && x.Required_Date <= endTime).Count();
rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date >= startTime && x.Actual_Date <= endTime).Count();
//rowTime["计划完成数量"] = forms.Where(x => x.Required_Date >= startTime && x.Required_Date <= endTime).Count();
//rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date >= startTime && x.Actual_Date <= endTime).Count();
rowTime["计划完成数量"] = forms.Where(x => x.Required_Date <= endTime).Count();
rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date <= endTime).Count();
dtTime.Rows.Add(rowTime);
}
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "尾项完成统计分析", this.drpChartType.SelectedValue, 1300, 550, false));
///按单位统计
DataTable dtTime1 = new DataTable();
dtTime1.Columns.Add("月份", typeof(string));
dtTime1.Columns.Add("计划完成百分比(%)", typeof(string));
dtTime1.Columns.Add("实际完成百分比(%)", typeof(string));
for (int i = 1; i <= DateTime.Now.Month; i++)
{
DataRow rowTime = dtTime1.NewRow();
DateTime QueryTime = Convert.ToDateTime($"{DateTime.Now.Year.ToString()}-{i}-1 00:00:00");
rowTime["月份"] = QueryTime.ToString("yyyy/MM");
DateTime startTime = QueryTime;
DateTime endTime = Convert.ToDateTime(QueryTime.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd") + " 23:59:59");
double jhCount = forms.Where(x => x.Required_Date <= endTime).Count();
double sjCount = forms.Where(x => x.Actual_Date <= endTime).Count();
double allCount = forms.Count();
rowTime["计划完成百分比(%)"] = allCount == 0 ? "0.00" : (jhCount / allCount * 100).ToString("0.00");
rowTime["实际完成百分比(%)"] = allCount == 0 ? "0.00" : (sjCount / allCount * 100).ToString("0.00");
dtTime1.Rows.Add(rowTime);
}
this.ChartAccidentTime1.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime1, "尾项完成统计分析", this.drpChartType.SelectedValue, 1300, 550, false));
}
}

View File

@ -105,13 +105,13 @@ namespace FineUIPro.Web.Transfer.Chart
protected global::FineUIPro.TabStrip TabStrip1;
/// <summary>
/// Tab2 控件。
/// Tab1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tab Tab2;
protected global::FineUIPro.Tab Tab1;
/// <summary>
/// cpAccidentTime 控件。
@ -130,5 +130,32 @@ namespace FineUIPro.Web.Transfer.Chart
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::Web.Controls.ChartControl ChartAccidentTime;
/// <summary>
/// Tab2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tab Tab2;
/// <summary>
/// ContentPanel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ContentPanel ContentPanel1;
/// <summary>
/// ChartAccidentTime1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::Web.Controls.ChartControl ChartAccidentTime1;
}
}

View File

@ -88,6 +88,7 @@
EnableRowDoubleClickEvent="true" EnableTextSelection="true" EnableSummary="true" SummaryPosition="Flow">
<Columns>
<f:BoundField DataField="Action_By" ColumnID="Action_By" HeaderText="单位" ExpandUnusedSpace="true" MinWidth="150px" />
<f:RenderField Width="150px" ColumnID="Cat_All_Count" DataField="Cat_All_Count" HeaderText="汇总" TextAlign="Center" FieldType="Double" />
<f:GroupField HeaderText="类别" TextAlign="Center" MinWidth="600px">
<Columns>
<f:RenderField Width="150px" ColumnID="Cat_A_Count" DataField="Cat_A_Count" HeaderText="A" TextAlign="Center" FieldType="Double" />

View File

@ -196,12 +196,13 @@ namespace FineUIPro.Web.Transfer.Chart
strSql.AppendLine(" AND System_No=@System_No ");
listStr.Add(new SqlParameter("@System_No", _systemNo));
}
strSql.AppendLine(" select Action_By,cast(0 as decimal(18,2)) Cat_A_Count,cast(0 as decimal(18,2)) Cat_B_Count,cast(0 as decimal(18,2)) Cat_C_Count,cast(0 as decimal(18,2)) Cat_D_Count INTO #PunchlistFromSortTemp2 from #AllPunchlistFromSortTemp2 Group by Action_By; ");
strSql.AppendLine(" select Action_By,cast(0 as decimal(18,2)) Cat_All_Count,cast(0 as decimal(18,2)) Cat_A_Count,cast(0 as decimal(18,2)) Cat_B_Count,cast(0 as decimal(18,2)) Cat_C_Count,cast(0 as decimal(18,2)) Cat_D_Count INTO #PunchlistFromSortTemp2 from #AllPunchlistFromSortTemp2 Group by Action_By; ");
strSql.AppendLine(" update a set a.Cat_A_Count=(select count(1) from #AllPunchlistFromSortTemp2 b where a.Action_By=b.Action_By AND (isnull(b.Cat,'')='A' or isnull(b.Cat,'')='a')) ");
strSql.AppendLine(",a.Cat_B_Count=(select count(1) from #AllPunchlistFromSortTemp2 b where a.Action_By=b.Action_By AND (isnull(b.Cat,'')='B' or isnull(b.Cat,'')='b')) ");
strSql.AppendLine(",a.Cat_C_Count=(select count(1) from #AllPunchlistFromSortTemp2 b where a.Action_By=b.Action_By AND (isnull(b.Cat,'')='C' or isnull(b.Cat,'')='c')) ");
strSql.AppendLine(",a.Cat_D_Count=(select count(1) from #AllPunchlistFromSortTemp2 b where a.Action_By=b.Action_By AND (isnull(b.Cat,'')='D' or isnull(b.Cat,'')='d')) ");
strSql.AppendLine("from #PunchlistFromSortTemp2 a;");
strSql.AppendLine(" update #PunchlistFromSortTemp2 set Cat_All_Count=Cat_A_Count+Cat_B_Count+Cat_C_Count+Cat_D_Count; ");
strSql.AppendLine("select * from #PunchlistFromSortTemp2 ");
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
strSql.AppendLine(" order by Action_By ");
@ -217,8 +218,10 @@ namespace FineUIPro.Web.Transfer.Chart
int cat_B_Count = 0;
int cat_C_Count = 0;
int cat_D_Count = 0;
int cat_All_Count = 0;
foreach (DataRow row in tb.Rows)
{
cat_All_Count += Convert.ToInt32(row["Cat_All_Count"]);
cat_A_Count += Convert.ToInt32(row["Cat_A_Count"]);
cat_B_Count += Convert.ToInt32(row["Cat_B_Count"]);
cat_C_Count += Convert.ToInt32(row["Cat_C_Count"]);
@ -228,6 +231,7 @@ namespace FineUIPro.Web.Transfer.Chart
JObject summary = new JObject();
summary.Add("Action_By", "合计");
summary.Add("Cat_All_Count", cat_All_Count.ToString());
summary.Add("Cat_A_Count", cat_A_Count.ToString());
summary.Add("Cat_B_Count", cat_B_Count.ToString());
summary.Add("Cat_C_Count", cat_C_Count.ToString());

View File

@ -21,9 +21,16 @@
<Toolbars>
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox runat="server" ID="txtNum_NO" Label="No." LabelWidth="40px" LabelAlign="Right" Width="120px"></f:TextBox>
<f:TextBox runat="server" ID="txtSystem_No" Label="System No" LabelWidth="100px" LabelAlign="Right" Width="180px"></f:TextBox>
<f:TextBox runat="server" ID="txtSub_Sys_No" Label="Sub Sys No" LabelWidth="100px" LabelAlign="Right" Width="180px"></f:TextBox>
<f:DropDownList ID="ddlCat" runat="server" Label="Cat." AutoPostBack="true" Width="80px" LabelWidth="40px">
<f:ListItem Value="" Text=""></f:ListItem>
<f:ListItem Value="A" Text="A"></f:ListItem>
<f:ListItem Value="B" Text="B"></f:ListItem>
<f:ListItem Value="C" Text="C"></f:ListItem>
<f:ListItem Value="D" Text="D"></f:ListItem>
</f:DropDownList>
<f:TextBox runat="server" ID="txtRaised_By" Label="Raised By" LabelWidth="90px" LabelAlign="Right" Width="150px"></f:TextBox>
<f:TextBox runat="server" ID="txtDisc" Label="Disc" LabelWidth="40px" LabelAlign="Right" Width="120px"></f:TextBox>
<f:DropDownList ID="ddlEng" runat="server" Label="Eng" AutoPostBack="true" Width="80px" LabelWidth="40px">
<f:ListItem Value="" Text=""></f:ListItem>
@ -33,26 +40,44 @@
<f:DropDownList ID="ddlMatI" runat="server" Label="Mat'l" AutoPostBack="true" Width="80px" LabelWidth="40px">
<f:ListItem Value="" Text=""></f:ListItem>
<f:ListItem Value="Y" Text="Y"></f:ListItem>
<f:ListItem Value="Y1" Text="Y1"></f:ListItem>
<f:ListItem Value="Y2" Text="Y2"></f:ListItem>
<f:ListItem Value="N" Text="N"></f:ListItem>
</f:DropDownList>
<f:DropDownList ID="ddlPunchType" runat="server" Label="Punch Type" AutoPostBack="true" Width="180px" LabelWidth="100px">
<f:ListItem Value="" Text=""></f:ListItem>
<f:ListItem Value="PWD" Text="PWD"></f:ListItem>
<f:ListItem Value="FWD" Text="FWD"></f:ListItem>
</f:DropDownList>
<f:Button ID="btnSearch" Icon="SystemSearch" EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<%-- <f:Button ID="btnNew" Icon="Add" EnablePostBack="true" runat="server" OnClick="btnNew_Click" ToolTip="新增" Hidden="true">
</f:Button>--%>
<%--<f:Button ID="btnAttach" Icon="TableCell" EnablePostBack="true" ToolTip="附件上传" runat="server" OnClick="btnAttach_Click">
</f:Button>--%>
<f:Button ID="btnNew" Icon="Add" EnablePostBack="false" runat="server" ToolTip="新增" Hidden="true">
</f:Button>
<f:Button ID="btnImport" ToolTip="导入" Icon="PackageIn" runat="server" OnClick="btnImport_Click" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="ddlPunchType" runat="server" Label="Punch Type" AutoPostBack="true" Width="180px" LabelWidth="100px">
<f:ListItem Value="" Text=""></f:ListItem>
<f:ListItem Value="PWD" Text="PWD"></f:ListItem>
<f:ListItem Value="FWD" Text="FWD"></f:ListItem>
</f:DropDownList>
<f:TextBox runat="server" ID="txtAction_By" Label="Action By" LabelWidth="80px" LabelAlign="Right" Width="180px"></f:TextBox>
<f:TextBox runat="server" ID="txtPIC" Label="责任人PIC" LabelWidth="90px" LabelAlign="Right" Width="180px"></f:TextBox>
<f:TextBox runat="server" ID="txtPIC_WUH" Label="责任人-五环/PIC-WUH" LabelWidth="180px" LabelAlign="Right" Width="300px"></f:TextBox>
<f:DropDownList ID="ddlStatus" runat="server" Label="状态/Status" AutoPostBack="true" Width="200px" LabelWidth="100px">
<f:ListItem Value="" Text=""></f:ListItem>
<f:ListItem Value="Completed" Text="Completed"></f:ListItem>
<f:ListItem Value="Not Start" Text="Not Start"></f:ListItem>
<f:ListItem Value="In Progress" Text="In Progress"></f:ListItem>
</f:DropDownList>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DatePicker runat="server" Label="Date Raised" ID="txtStartDate_Raised" LabelAlign="Right" LabelWidth="100px"
@ -225,14 +250,18 @@
Target="Top" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="700px" Height="560px">
</f:Window>
<f:Window ID="Window1" Title="尾项管理" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="1200px"
Height="600px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<Items>
<%--<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Text="修改" Icon="Pencil" OnClick="btnMenuModify_Click" Hidden="true">
</f:MenuButton>--%>
<f:MenuButton ID="btnMenuAttachA" runat="server" Icon="FolderUp" Text="Photoes附件" OnClick="btnMenuAttachA_Click" Hidden="true">
</f:MenuButton>
<f:MenuButton ID="btnMenuAttachB" runat="server" Icon="FolderUp" Text="Corrected_Photos附件" OnClick="btnMenuAttachB_Click" Hidden="true">
</f:MenuButton>
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Text="修改" Icon="Pencil" OnClick="btnMenuModify_Click" Hidden="true">
</f:MenuButton>
<f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?"
OnClick="btnMenuDel_Click" Hidden="true">
</f:MenuButton>

View File

@ -1,10 +1,17 @@
using BLL;
using BLL.Common;
using BLL.CQMS.Comprehensive;
using NPOI.SS.Formula.Functions;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
namespace FineUIPro.Web.Transfer
{
@ -22,13 +29,12 @@ namespace FineUIPro.Web.Transfer
{
GetButtonPower();
BindGrid();
this.btnNew.OnClientClick = Window1.GetShowReference("PunchlistFromEdit.aspx") + "return false;";
}
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindGrid()
public DataTable DataSql()
{
string strSql = @"select *
,(CASE isnull(IsEng,0) WHEN 1 THEN 'Y' ELSE 'N' END) IsEngStr
@ -38,10 +44,10 @@ namespace FineUIPro.Web.Transfer
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(this.txtNum_NO.Text.Trim()))
if (!string.IsNullOrEmpty(this.txtRaised_By.Text.Trim()))
{
strSql += " AND Num_NO like @Num_NO";
listStr.Add(new SqlParameter("@Num_NO", "%" + this.txtNum_NO.Text.Trim() + "%"));
strSql += " AND Raised_By = @Raised_By";
listStr.Add(new SqlParameter("@Raised_By", this.txtRaised_By.Text.Trim()));
}
if (!string.IsNullOrEmpty(this.txtSystem_No.Text.Trim()))
{
@ -96,16 +102,49 @@ namespace FineUIPro.Web.Transfer
if (!string.IsNullOrEmpty(ddlMatI.SelectedValue.Trim()))
{
strSql += " AND IsMatI = @IsMatI";
listStr.Add(new SqlParameter("@IsMatI", ddlMatI.SelectedValue.Trim() == "Y" ? 1 : 0));
listStr.Add(new SqlParameter("@IsMatI", ddlMatI.SelectedValue.Trim()));
}
if (!string.IsNullOrEmpty(ddlPunchType.SelectedValue.Trim()))
{
strSql += " AND Punch_Type = @Punch_Type";
listStr.Add(new SqlParameter("@Punch_Type", ddlPunchType.SelectedValue.Trim()));
}
if (!string.IsNullOrEmpty(ddlCat.SelectedValue.Trim()))
{
strSql += " AND Cat = @Cat";
listStr.Add(new SqlParameter("@Cat", ddlCat.SelectedValue.Trim()));
}
if (!string.IsNullOrEmpty(txtAction_By.Text.Trim()))
{
strSql += " AND Action_By = @Action_By";
listStr.Add(new SqlParameter("@Action_By", txtAction_By.Text.Trim()));
}
if (!string.IsNullOrEmpty(txtPIC.Text.Trim()))
{
strSql += " AND PIC = @PIC";
listStr.Add(new SqlParameter("@PIC", txtPIC.Text.Trim()));
}
if (!string.IsNullOrEmpty(txtPIC_WUH.Text.Trim()))
{
strSql += " AND PIC_WUH = @PIC_WUH";
listStr.Add(new SqlParameter("@PIC_WUH", txtPIC_WUH.Text.Trim()));
}
if (!string.IsNullOrEmpty(ddlStatus.SelectedValue.Trim()))
{
strSql += " AND Status = @Status";
listStr.Add(new SqlParameter("@Status", ddlStatus.SelectedValue.Trim()));
}
strSql += " order by Num_No ";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
return SQLHelper.GetDataTableRunText(strSql, parameter);
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindGrid()
{
DataTable tb = DataSql();
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
@ -277,13 +316,13 @@ namespace FineUIPro.Web.Transfer
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
//this.btnNew.Hidden = false;
this.btnNew.Hidden = false;
btnMenuAttachA.Hidden = false;
btnMenuAttachB.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
//this.btnMenuModify.Hidden = false;
this.btnMenuModify.Hidden = false;
this.Grid1.EnableRowDoubleClickEvent = true;
btnMenuAttachA.Hidden = false;
btnMenuAttachB.Hidden = false;
@ -304,25 +343,140 @@ namespace FineUIPro.Web.Transfer
}
#endregion
#region
#region
/// <summary>
/// 附件上传
/// 右键编辑事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttach_Click(object sender, EventArgs e)
protected void btnMenuModify_Click(object sender, EventArgs e)
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.PunchlistFromMenuId);
if (buttonList.Contains(BLL.Const.BtnAdd))
if (Grid1.SelectedRowIndexArray.Length == 0)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/Transfer/PunchlistFrom&menuId={1}", this.CurrUser.LoginProjectId + "PunchlistFrom", BLL.Const.PunchlistFromMenuId)));
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
else
string id = Grid1.SelectedRowID;
var accidentPersonRecord = Funs.DB.Transfer_PunchlistFrom.FirstOrDefault(p => p.Id == id);
if (accidentPersonRecord == null)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/Transfer/PunchlistFrom&menuId={1}", this.CurrUser.LoginProjectId + "PunchlistFrom", BLL.Const.PunchlistFromMenuId)));
Alert.ShowInTop("修改的数据已经不存在,请检查!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PunchlistFromEdit.aspx?Id={0}", id, "编辑 - ")));
}
#endregion
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/");
string initTemplatePath = string.Empty;
string uploadfilepath = string.Empty;
string newUrl = string.Empty;
string filePath = string.Empty;
initTemplatePath = "File\\Excel\\DataOut\\PunchlistFrom导出模板.xlsx";
uploadfilepath = rootPath + initTemplatePath;
DataTable tb = DataSql();
if (tb.Rows.Count <= 0)
{
ShowNotify("没有要导出的数据!!!", MessageBoxIcon.Warning);
return;
}
newUrl = uploadfilepath.Replace("导出模板","导出数据").Replace(".xlsx",DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx");
File.Copy(uploadfilepath, newUrl);
NPOI.SS.UserModel.IWorkbook workbook;
using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read))
{
workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream);
}
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
int i = 2;
foreach (DataRow tbRow in tb.Rows)
{
NPOI.SS.UserModel.IRow row = sheet.CreateRow(i);
NPOI.SS.UserModel.ICell cell;
cell = row.CreateCell(0);
cell.SetCellValue(tbRow["Num_NO"]==null?"": tbRow["Num_NO"].ToString());
cell = row.CreateCell(1);
cell.SetCellValue(tbRow["System_No"] == null ? "" : tbRow["System_No"].ToString());
cell = row.CreateCell(2);
cell.SetCellValue(tbRow["Sub_Sys_No"] == null ? "" : tbRow["Sub_Sys_No"].ToString());
cell = row.CreateCell(3);
cell.SetCellValue(tbRow["DESCRIPTION"] == null ? "" : tbRow["DESCRIPTION"].ToString());
cell = row.CreateCell(5);
cell.SetCellValue(tbRow["Cat"] == null ? "" : tbRow["Cat"].ToString());
cell = row.CreateCell(6);
cell.SetCellValue(tbRow["Raised_By"] == null ? "" : tbRow["Raised_By"].ToString());
cell = row.CreateCell(7);
cell.SetCellValue(tbRow["Date_Raised"] == DBNull.Value ? "" :Convert.ToDateTime(tbRow["Date_Raised"]).ToString("yyyy-MM-dd"));
cell = row.CreateCell(8);
cell.SetCellValue(tbRow["Disc"] == null ? "" : tbRow["Disc"].ToString());
cell = row.CreateCell(9);
cell.SetCellValue(tbRow["IsEngStr"] == null ? "" : tbRow["IsEngStr"].ToString());
cell = row.CreateCell(10);
cell.SetCellValue(tbRow["IsMatIStr"] == null ? "" : tbRow["IsMatIStr"].ToString());
cell = row.CreateCell(11);
cell.SetCellValue(tbRow["Punch_Type"] == null ? "" : tbRow["Punch_Type"].ToString());
cell = row.CreateCell(12);
cell.SetCellValue(tbRow["Required_Date"] == DBNull.Value ? "" : Convert.ToDateTime(tbRow["Required_Date"]).ToString("yyyy-MM-dd"));
cell = row.CreateCell(13);
cell.SetCellValue(tbRow["Action_By"] == null ? "" : tbRow["Action_By"].ToString());
cell = row.CreateCell(14);
cell.SetCellValue(tbRow["PIC"] == null ? "" : tbRow["PIC"].ToString());
cell = row.CreateCell(15);
cell.SetCellValue(tbRow["PIC_WUH"] == null ? "" : tbRow["PIC_WUH"].ToString());
cell = row.CreateCell(16);
cell.SetCellValue(tbRow["Correction_Action"] == null ? "" : tbRow["Correction_Action"].ToString());
cell = row.CreateCell(18);
cell.SetCellValue(tbRow["Actual_Date"] == DBNull.Value ? "" : Convert.ToDateTime(tbRow["Actual_Date"]).ToString("yyyy-MM-dd"));
cell = row.CreateCell(19);
cell.SetCellValue(tbRow["Cleared_By"] == null ? "" : tbRow["Cleared_By"].ToString());
cell = row.CreateCell(20);
cell.SetCellValue(tbRow["Cleared_Date"] == DBNull.Value ? "" : Convert.ToDateTime(tbRow["Cleared_Date"]).ToString("yyyy-MM-dd"));
cell = row.CreateCell(21);
cell.SetCellValue(tbRow["Confirmed_By"] == null ? "" : tbRow["Confirmed_By"].ToString());
cell = row.CreateCell(22);
cell.SetCellValue(tbRow["Confirmed_Date"] == DBNull.Value ? "" : Convert.ToDateTime(tbRow["Confirmed_Date"]).ToString("yyyy-MM-dd"));
cell = row.CreateCell(23);
cell.SetCellValue(tbRow["Verified_By"] == null ? "" : tbRow["Verified_By"].ToString());
cell = row.CreateCell(24);
cell.SetCellValue(tbRow["Verified_Date"] == DBNull.Value ? "" : Convert.ToDateTime(tbRow["Verified_Date"]).ToString("yyyy-MM-dd"));
cell = row.CreateCell(25);
cell.SetCellValue(tbRow["Status"] == null ? "" : tbRow["Status"].ToString());
cell = row.CreateCell(26);
cell.SetCellValue(tbRow["Remark"] == null ? "" : tbRow["Remark"].ToString());
i++;
}
// 第三步:写入文件流
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
{
workbook.Write(stream);
workbook.Close();
}
string fileName = Path.GetFileName(newUrl);
FileInfo info = new FileInfo(newUrl);
long fileSize = info.Length;
Response.Clear();
Response.ContentType = "application/x-zip-compressed";
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.AddHeader("Content-Length", fileSize.ToString());
Response.TransmitFile(newUrl, 0, fileSize);
Response.Flush();
Response.Close();
File.Delete(newUrl);
}
}
}

View File

@ -59,15 +59,6 @@ namespace FineUIPro.Web.Transfer
/// </remarks>
protected global::FineUIPro.Toolbar ToolSearch;
/// <summary>
/// txtNum_NO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtNum_NO;
/// <summary>
/// txtSystem_No 控件。
/// </summary>
@ -86,6 +77,24 @@ namespace FineUIPro.Web.Transfer
/// </remarks>
protected global::FineUIPro.TextBox txtSub_Sys_No;
/// <summary>
/// ddlCat 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlCat;
/// <summary>
/// txtRaised_By 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRaised_By;
/// <summary>
/// txtDisc 控件。
/// </summary>
@ -113,15 +122,6 @@ namespace FineUIPro.Web.Transfer
/// </remarks>
protected global::FineUIPro.DropDownList ddlMatI;
/// <summary>
/// ddlPunchType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPunchType;
/// <summary>
/// btnSearch 控件。
/// </summary>
@ -131,6 +131,15 @@ namespace FineUIPro.Web.Transfer
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnImport 控件。
/// </summary>
@ -140,6 +149,69 @@ namespace FineUIPro.Web.Transfer
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// ddlPunchType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPunchType;
/// <summary>
/// txtAction_By 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtAction_By;
/// <summary>
/// txtPIC 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPIC;
/// <summary>
/// txtPIC_WUH 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPIC_WUH;
/// <summary>
/// ddlStatus 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlStatus;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@ -284,6 +356,15 @@ namespace FineUIPro.Web.Transfer
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Menu1 控件。
/// </summary>
@ -311,6 +392,15 @@ namespace FineUIPro.Web.Transfer
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuAttachB;
/// <summary>
/// btnMenuModify 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuModify;
/// <summary>
/// btnMenuDel 控件。
/// </summary>

View File

@ -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;IMEX=1; 8.0;HDR=1;'";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
@ -130,7 +130,7 @@ namespace FineUIPro.Web.Transfer
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL(ds.Tables[0], 24);
AddDatasetToSQL(ds.Tables[0], 23);
hdCheckResult.Text = "1";
}
catch (Exception exc)
@ -169,7 +169,7 @@ namespace FineUIPro.Web.Transfer
for (int i = 1; i < ir; i++)
{
string allRowData = string.Empty;
for (int j = 0; j < 24; j++)
for (int j = 0; j < 23; j++)
{
allRowData += pds.Rows[i][j].ToString();
}
@ -343,7 +343,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;IMEX=1; 8.0;HDR=1;'";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
@ -367,7 +367,7 @@ namespace FineUIPro.Web.Transfer
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL2(ds.Tables[0], 24);
AddDatasetToSQL2(ds.Tables[0], 23);
}
catch (Exception ex)
{
@ -445,7 +445,7 @@ namespace FineUIPro.Web.Transfer
model.Correction_Action = pds.Rows[i][14].ToString().Trim();
DateTime t15;
if (DateTime.TryParse(pds.Rows[i][15].ToString(), out t15) && !string.IsNullOrEmpty(pds.Rows[i][15].ToString()))
model.PUNCH_ITEM_FINISH_DATE = t15;
model.Actual_Date = t15;
model.Cleared_By = pds.Rows[i][16].ToString().Trim();
DateTime t17;
if (DateTime.TryParse(pds.Rows[i][17].ToString(), out t17) && !string.IsNullOrEmpty(pds.Rows[i][17].ToString()))
@ -458,8 +458,16 @@ namespace FineUIPro.Web.Transfer
DateTime t21;
if (DateTime.TryParse(pds.Rows[i][21].ToString(), out t21) && !string.IsNullOrEmpty(pds.Rows[i][21].ToString()))
model.Verified_Date = t21;
model.Status = pds.Rows[i][22].ToString().Trim();
model.Remark = pds.Rows[i][23].ToString().Trim();
model.Remark = pds.Rows[i][22].ToString().Trim();
if (model.Cleared_Date == null && model.Confirmed_Date == null && model.Verified_Date == null)
model.Status = "Not Start";
else if (model.Cleared_Date != null && model.Confirmed_Date != null && model.Verified_Date != null)
model.Status = "Completed";
else
model.Status = "In Progress";
list.Add(model);
maxNumNO++;
}

View File

@ -0,0 +1,159 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PunchlistFromEdit.aspx.cs" Inherits="FineUIPro.Web.Transfer.PunchlistFromEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>尾项管理新增编辑</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="SimpleForm1" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" Title="HSE事故(对人员)记录"
AutoScroll="true" BodyPadding="10px" runat="server" RedStarPosition="BeforeText"
LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtSystem_No" runat="server" Label="系统号/System No." LabelAlign="Right" LabelWidth="180px">
</f:TextBox>
<f:TextBox ID="txtSub_Sys_No" runat="server" Label="子系统号/Sub-sys. No." LabelAlign="Right" LabelWidth="200px">
</f:TextBox>
<f:TextBox ID="txtDESCRIPTION" runat="server" Label="尾项内容/Description" LabelAlign="Right" LabelWidth="200px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlCat" runat="server" Label="Cat." LabelWidth="180px">
<f:ListItem Value="" Text=""></f:ListItem>
<f:ListItem Value="A" Text="A"></f:ListItem>
<f:ListItem Value="B" Text="B"></f:ListItem>
<f:ListItem Value="C" Text="C"></f:ListItem>
<f:ListItem Value="D" Text="D"></f:ListItem>
</f:DropDownList>
<f:TextBox ID="txtRaised_By" runat="server" Label="提出人/Raised By" LabelAlign="Right" LabelWidth="200px">
</f:TextBox>
<f:DatePicker runat="server" Label="提出时间/Date Raised" ID="txtDate_Raised" LabelAlign="Right" LabelWidth="200px" Width="300px">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtDisc" runat="server" Label="专业/Disc." LabelAlign="Right" LabelWidth="180px">
</f:TextBox>
<f:DropDownList ID="ddlIsEng" runat="server" Label="设计需求/Eng(Y/N)" LabelWidth="200px">
<f:ListItem Value="" Text=""></f:ListItem>
<f:ListItem Value="Y" Text="Y"></f:ListItem>
<f:ListItem Value="N" Text="N"></f:ListItem>
</f:DropDownList>
<f:DropDownList ID="ddlIsMatI" runat="server" Label="材料需求/Matl(Y/N)" LabelWidth="200px" Width="300px">
<f:ListItem Value="" Text=""></f:ListItem>
<f:ListItem Value="Y" Text="Y"></f:ListItem>
<f:ListItem Value="Y1" Text="Y1"></f:ListItem>
<f:ListItem Value="Y2" Text="Y2"></f:ListItem>
<f:ListItem Value="N" Text="N"></f:ListItem>
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtPunch_Type" runat="server" Label="尾项类别/Punch Type" LabelAlign="Right" LabelWidth="180px">
</f:TextBox>
<f:DatePicker runat="server" Label="要求完成时间/Required Date" ID="txtRequired_Date" LabelAlign="Right" LabelWidth="200px">
</f:DatePicker>
<f:TextBox ID="txtAction_By" runat="server" Label="责任单位/Action By" LabelAlign="Right" LabelWidth="200px" Width="300px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtPIC" runat="server" Label="责任人PIC" LabelAlign="Right" LabelWidth="180px">
</f:TextBox>
<f:TextBox ID="txtPIC_WUH" runat="server" Label="责任人-五环/PIC-WUH" LabelAlign="Right" LabelWidth="200px">
</f:TextBox>
<f:TextBox ID="txtCorrection_Action" runat="server" Label="整改措施/Correction Action" LabelAlign="Right" LabelWidth="200px" Width="300px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker runat="server" Label="实际完成时间/Actual Date" ID="txtActual_Date" LabelAlign="Right" LabelWidth="180px" Width="300px">
</f:DatePicker>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:ToolbarFill runat="server"></f:ToolbarFill>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:GroupPanel Layout="Anchor" Title="Cleared(PIC/监理核查" runat="server">
<Items>
<f:Panel ID="Panel2" Layout="HBox" BoxConfigAlign="Stretch" ShowHeader="false" ShowBorder="false" runat="server">
<Items>
<f:TextBox ID="txtCleared_By" runat="server" Label="负责人/By" LabelAlign="Right" LabelWidth="70px" Width="180px">
</f:TextBox>
<f:DatePicker runat="server" Label="日期/Date" ID="txtCleared_Date" LabelAlign="Right" LabelWidth="70px" Width="180px">
</f:DatePicker>
</Items>
</f:Panel>
</Items>
</f:GroupPanel>
<f:GroupPanel Layout="Anchor" Title="Confirmed(WUH)确认(五环)" runat="server">
<Items>
<f:Panel ID="Panel1" Layout="HBox" BoxConfigAlign="Stretch" ShowHeader="false" ShowBorder="false" runat="server">
<Items>
<f:TextBox ID="txtConfirmed_By" runat="server" Label="负责人/By" LabelAlign="Right" LabelWidth="70px" Width="180px">
</f:TextBox>
<f:DatePicker runat="server" Label="日期/Date" ID="txtConfirmed_Date" LabelAlign="Right" LabelWidth="70px" Width="180px">
</f:DatePicker>
</Items>
</f:Panel>
</Items>
</f:GroupPanel>
<f:GroupPanel Layout="Anchor" Title="Verified(BASF)验收" runat="server">
<Items>
<f:Panel ID="Panel3" Layout="HBox" BoxConfigAlign="Stretch" ShowHeader="false" ShowBorder="false" runat="server">
<Items>
<f:TextBox ID="txtVerified_By" runat="server" Label="负责人/By" LabelAlign="Right" LabelWidth="70px" Width="180px">
</f:TextBox>
<f:DatePicker runat="server" Label="日期/Date" ID="txtVerified_Date" LabelAlign="Right" LabelWidth="70px" Width="180px">
</f:DatePicker>
</Items>
</f:Panel>
</Items>
</f:GroupPanel>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea runat="server" ID="txtRemark" Label="备注/Remark" LabelWidth="180px" MarginTop="10px"></f:TextArea>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnAttach_A" Text="Photoes附件" ToolTip="上传及查看" Icon="TableCell" runat="server"
OnClick="btnAttachA_Click">
</f:Button>
<f:Button ID="btnAttach_B" Text="Corrected Photos附件" ToolTip="上传及查看" Icon="TableCell" runat="server"
OnClick="btnAttachB_Click">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1" Text="保存"
OnClick="btnSave_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</form>
</body>
</html>

View File

@ -0,0 +1,222 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Xml;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace FineUIPro.Web.Transfer
{
public partial class PunchlistFromEdit : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
private string Id
{
get
{
return (string)ViewState["Id"];
}
set
{
ViewState["Id"] = value;
}
}
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.Id = Request.Params["Id"];
this.ProjectId = this.CurrUser.LoginProjectId;
var TransferPunchlistFrom = Funs.DB.Transfer_PunchlistFrom.FirstOrDefault(p => p.Id == this.Id);
if (TransferPunchlistFrom != null)
{
this.txtSystem_No.Text = TransferPunchlistFrom.System_No;
this.txtSub_Sys_No.Text = TransferPunchlistFrom.Sub_Sys_No;
this.txtDESCRIPTION.Text = TransferPunchlistFrom.DESCRIPTION;
this.ddlCat.SelectedValue = TransferPunchlistFrom.Cat;
this.txtRaised_By.Text = TransferPunchlistFrom.Raised_By;
if (TransferPunchlistFrom.Date_Raised != null)
this.txtDate_Raised.Text = Convert.ToDateTime(TransferPunchlistFrom.Date_Raised).ToString("yyyy-MM-dd");
this.txtDisc.Text = TransferPunchlistFrom.Disc;
if (TransferPunchlistFrom.IsEng == true)
this.ddlIsEng.SelectedValue = "Y";
else
this.ddlIsEng.SelectedValue = "N";
this.ddlIsMatI.SelectedValue = TransferPunchlistFrom.IsMatI ?? "";
this.txtPunch_Type.Text = TransferPunchlistFrom.Punch_Type;
if (TransferPunchlistFrom.Required_Date != null)
this.txtRequired_Date.Text = Convert.ToDateTime(TransferPunchlistFrom.Required_Date).ToString("yyyy-MM-dd");
this.txtAction_By.Text = TransferPunchlistFrom.Action_By;
this.txtPIC.Text = TransferPunchlistFrom.PIC;
this.txtPIC_WUH.Text = TransferPunchlistFrom.PIC_WUH;
this.txtCorrection_Action.Text = TransferPunchlistFrom.Correction_Action;
if (TransferPunchlistFrom.Actual_Date != null)
this.txtActual_Date.Text = Convert.ToDateTime(TransferPunchlistFrom.Actual_Date).ToString("yyyy-MM-dd");
this.txtCleared_By.Text = TransferPunchlistFrom.Cleared_By;
if (TransferPunchlistFrom.Cleared_Date != null)
this.txtCleared_Date.Text = Convert.ToDateTime(TransferPunchlistFrom.Cleared_Date).ToString("yyyy-MM-dd");
this.txtConfirmed_By.Text = TransferPunchlistFrom.Confirmed_By;
if (TransferPunchlistFrom.Confirmed_Date != null)
this.txtConfirmed_Date.Text = Convert.ToDateTime(TransferPunchlistFrom.Confirmed_Date).ToString("yyyy-MM-dd");
this.txtVerified_By.Text = TransferPunchlistFrom.Verified_By;
if (TransferPunchlistFrom.Verified_Date != null)
this.txtVerified_Date.Text = Convert.ToDateTime(TransferPunchlistFrom.Verified_Date).ToString("yyyy-MM-dd");
this.txtRemark.Text = TransferPunchlistFrom.Remark;
}
}
}
/// <summary>
/// Photoes附件上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachA_Click(object sender, EventArgs e)
{
AttachFileClick("A");
}
/// <summary>
/// Corrected Photos附件上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachB_Click(object sender, EventArgs e)
{
AttachFileClick("B");
}
/// <summary>
/// 通过不同的type来保存附件
/// </summary>
/// <param name="type"></param>
private void AttachFileClick(string type)
{
SaveData();
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?type=0&toKeyId={0}_{1}&path=FileUpload/Transfer/PunchlistFrom&menuId={2}", this, Id, type, BLL.Const.PunchlistFromMenuId)));
}
/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (SaveData() == 0) {
Alert.ShowInTop("保存失败!", MessageBoxIcon.Warning);
return;
}
ShowNotify("保存成功",MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
/// <summary>
/// 保存数据
/// </summary>
/// <returns></returns>
private int SaveData()
{
int reutState = 0;
var maxNumNO = 0;
var modelTp = Funs.DB.Transfer_PunchlistFrom.OrderByDescending(x => x.Num_NO).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
if (modelTp == null)
maxNumNO = 1;
else
maxNumNO = Convert.ToInt32(modelTp.Num_NO) + 1;
Model.Transfer_PunchlistFrom newTransferFrom = new Model.Transfer_PunchlistFrom()
{
Id= Guid.NewGuid().ToString(),
Num_NO = maxNumNO.ToString("0000"),
ProjectId=this.ProjectId,
System_No = this.txtSystem_No.Text.Trim(),
Sub_Sys_No = this.txtSub_Sys_No.Text.Trim(),
DESCRIPTION = this.txtDESCRIPTION.Text.Trim(),
Cat = this.ddlCat.SelectedValue,
Raised_By = this.txtRaised_By.Text.Trim(),
Date_Raised = Funs.GetNewDateTime(this.txtDate_Raised.Text),
Disc = this.txtDisc.Text.Trim(),
IsEng = this.ddlIsEng.SelectedValue == "Y" ? true : false,
IsMatI = this.ddlIsMatI.SelectedValue,
Punch_Type = this.txtPunch_Type.Text.Trim(),
Required_Date= Funs.GetNewDateTime(this.txtRequired_Date.Text),
Action_By= this.txtAction_By.Text.Trim(),
PIC= this.txtPIC.Text.Trim(),
PIC_WUH=this.txtPIC_WUH.Text.Trim(),
Correction_Action= this.txtCorrection_Action.Text.Trim(),
Actual_Date = Funs.GetNewDateTime(this.txtActual_Date.Text),
Cleared_By= this.txtCleared_By.Text.Trim(),
Cleared_Date = Funs.GetNewDateTime(this.txtCleared_Date.Text),
Confirmed_By= this.txtConfirmed_By.Text.Trim(),
Confirmed_Date = Funs.GetNewDateTime(this.txtConfirmed_Date.Text),
Verified_By= this.txtVerified_By.Text.Trim(),
Verified_Date = Funs.GetNewDateTime(this.txtVerified_Date.Text),
Remark= this.txtRemark.Text.Trim()
};
if (newTransferFrom.Cleared_Date == null && newTransferFrom.Confirmed_Date == null && newTransferFrom.Verified_Date == null)
newTransferFrom.Status = "Not Start";
else if (newTransferFrom.Cleared_Date != null && newTransferFrom.Confirmed_Date != null && newTransferFrom.Verified_Date != null)
newTransferFrom.Status = "Completed";
else
newTransferFrom.Status = "In Progress";
var TransferPunchlistFrom = Funs.DB.Transfer_PunchlistFrom.FirstOrDefault(p => p.Id == this.Id);
if (TransferPunchlistFrom == null)
{
Funs.DB.Transfer_PunchlistFrom.InsertOnSubmit(newTransferFrom);
this.Id = newTransferFrom.Id;
}
else
{
TransferPunchlistFrom.System_No = newTransferFrom.System_No;
TransferPunchlistFrom.Sub_Sys_No = newTransferFrom.Sub_Sys_No;
TransferPunchlistFrom.DESCRIPTION = newTransferFrom.DESCRIPTION;
TransferPunchlistFrom.Cat = newTransferFrom.Cat;
TransferPunchlistFrom.Raised_By = newTransferFrom.Raised_By;
TransferPunchlistFrom.Date_Raised = newTransferFrom.Date_Raised;
TransferPunchlistFrom.Disc = newTransferFrom.Disc;
TransferPunchlistFrom.IsEng = newTransferFrom.IsEng;
TransferPunchlistFrom.IsMatI = newTransferFrom.IsMatI;
TransferPunchlistFrom.Punch_Type = newTransferFrom.Punch_Type;
TransferPunchlistFrom.Required_Date = newTransferFrom.Required_Date;
TransferPunchlistFrom.Action_By = newTransferFrom.Action_By;
TransferPunchlistFrom.PIC = newTransferFrom.PIC;
TransferPunchlistFrom.PIC_WUH = newTransferFrom.PIC_WUH;
TransferPunchlistFrom.Correction_Action = newTransferFrom.Correction_Action;
TransferPunchlistFrom.Actual_Date = newTransferFrom.Actual_Date;
TransferPunchlistFrom.Cleared_By = newTransferFrom.Cleared_By;
TransferPunchlistFrom.Cleared_Date = newTransferFrom.Cleared_Date;
TransferPunchlistFrom.Confirmed_By = newTransferFrom.Confirmed_By;
TransferPunchlistFrom.Confirmed_Date = newTransferFrom.Confirmed_Date;
TransferPunchlistFrom.Verified_By = newTransferFrom.Verified_By;
TransferPunchlistFrom.Verified_Date = newTransferFrom.Verified_Date;
TransferPunchlistFrom.Remark = newTransferFrom.Remark;
TransferPunchlistFrom.Status = newTransferFrom.Status;
}
Funs.DB.SubmitChanges();
reutState = 1;
return reutState;
}
}
}

View File

@ -0,0 +1,332 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.Transfer
{
public partial class PunchlistFromEdit
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtSystem_No 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSystem_No;
/// <summary>
/// txtSub_Sys_No 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSub_Sys_No;
/// <summary>
/// txtDESCRIPTION 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDESCRIPTION;
/// <summary>
/// ddlCat 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlCat;
/// <summary>
/// txtRaised_By 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRaised_By;
/// <summary>
/// txtDate_Raised 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtDate_Raised;
/// <summary>
/// txtDisc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDisc;
/// <summary>
/// ddlIsEng 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlIsEng;
/// <summary>
/// ddlIsMatI 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlIsMatI;
/// <summary>
/// txtPunch_Type 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPunch_Type;
/// <summary>
/// txtRequired_Date 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtRequired_Date;
/// <summary>
/// txtAction_By 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtAction_By;
/// <summary>
/// txtPIC 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPIC;
/// <summary>
/// txtPIC_WUH 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPIC_WUH;
/// <summary>
/// txtCorrection_Action 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCorrection_Action;
/// <summary>
/// txtActual_Date 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtActual_Date;
/// <summary>
/// Panel2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel2;
/// <summary>
/// txtCleared_By 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCleared_By;
/// <summary>
/// txtCleared_Date 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtCleared_Date;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// txtConfirmed_By 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtConfirmed_By;
/// <summary>
/// txtConfirmed_Date 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtConfirmed_Date;
/// <summary>
/// Panel3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel3;
/// <summary>
/// txtVerified_By 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtVerified_By;
/// <summary>
/// txtVerified_Date 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtVerified_Date;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtRemark;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnAttach_A 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttach_A;
/// <summary>
/// btnAttach_B 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttach_B;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}