20250116 key Quantity、项目状态修改

This commit is contained in:
毕文静 2025-01-16 17:02:02 +08:00
parent d02ac75d48
commit 4c28c0514b
10 changed files with 461 additions and 213 deletions

View File

@ -81,5 +81,97 @@ namespace BLL
return false;
}
}
#region Identifier下拉值加载
public static void InitIdentifierDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
{
dropName.DataValueField = "DisciplinesWBSCode";
dropName.DataTextField = "DisciplinesWBSCode";
dropName.DataSource = GetDisciplinesWBSCodeList();
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
public static List<string> GetDisciplinesWBSCodeList()
{
return (from x in Funs.DB.Base_QuantityDesctiption
join y in Funs.DB.Base_DisciplinesWBS on x.DisciplinesWBSId equals y.DisciplinesWBSId
orderby y.DisciplinesWBSCode
select y.DisciplinesWBSCode).Distinct().ToList();
}
#endregion
#region Descipline下拉值加载
public static void InitDesciplineDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease, string disciplinesWBSCode)
{
dropName.DataValueField = "DisciplinesWBSName";
dropName.DataTextField = "DisciplinesWBSName";
dropName.DataSource = GetDesciplineList(disciplinesWBSCode);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
public static List<string> GetDesciplineList(string disciplinesWBSCode)
{
return (from x in Funs.DB.Base_QuantityDesctiption
join y in Funs.DB.Base_DisciplinesWBS on x.DisciplinesWBSId equals y.DisciplinesWBSId
where y.DisciplinesWBSCode == disciplinesWBSCode
orderby y.DisciplinesWBSName
select y.DisciplinesWBSName).Distinct().ToList();
}
#endregion
#region Quantity Desctiption
public static void InitQuantityDesctiptionDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease, string disciplinesWBSCode, string disciplinesWBSName)
{
dropName.DataValueField = "QuantityDesctiption";
dropName.DataTextField = "QuantityDesctiption";
dropName.DataSource = GetQuantityDesctiptionList(disciplinesWBSCode, disciplinesWBSName);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
public static List<string> GetQuantityDesctiptionList(string disciplinesWBSCode, string disciplinesWBSName)
{
return (from x in Funs.DB.Base_QuantityDesctiption
join y in Funs.DB.Base_DisciplinesWBS on x.DisciplinesWBSId equals y.DisciplinesWBSId
where y.DisciplinesWBSCode == disciplinesWBSCode && y.DisciplinesWBSName == disciplinesWBSName
orderby x.QuantityDesctiption
select x.QuantityDesctiption).Distinct().ToList();
}
#endregion
#region PlanMHRsUnit
public static void InitPlanMHRsUnitDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease, string disciplinesWBSCode, string disciplinesWBSName, string quantityDesctiption)
{
dropName.DataValueField = "PlanMHRsUnit";
dropName.DataTextField = "PlanMHRsUnit";
dropName.DataSource = GetPlanMHRsUnitList(disciplinesWBSCode, disciplinesWBSName, quantityDesctiption);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
public static List<string> GetPlanMHRsUnitList(string disciplinesWBSCode, string disciplinesWBSName, string quantityDesctiption)
{
return (from x in Funs.DB.Base_QuantityDesctiption
join y in Funs.DB.Base_DisciplinesWBS on x.DisciplinesWBSId equals y.DisciplinesWBSId
where y.DisciplinesWBSCode == disciplinesWBSCode && y.DisciplinesWBSName == disciplinesWBSName
&& x.QuantityDesctiption == quantityDesctiption
orderby x.PlanMHRsUnit
select x.PlanMHRsUnit.ToString()).Distinct().ToList();
}
#endregion
}
}

View File

@ -23,10 +23,10 @@ namespace BLL
return Funs.DB.Editor_KeyQuantity.FirstOrDefault(e => e.KeyQuantityId == keyQuantityId);
}
public static decimal? GetSumPlanMHRsByKeyId(string keyId)
public static decimal? GetSumPlanMHRsByKeyId(string eprojectId, string identifier, string descipline)
{
decimal? sum = 0;
sum = (from x in Funs.DB.Editor_KeyQuantity where x.KeyId == keyId select x.PlanMHRs).Sum();
sum = (from x in Funs.DB.Editor_KeyQuantity where x.EProjectId == eprojectId && x.Identifier == identifier && x.Descipline == descipline select x.PlanMHRs).Sum();
return sum;
}
@ -42,6 +42,10 @@ namespace BLL
newKeyQuantity.KeyId = keyQuantity.KeyId;
newKeyQuantity.InputQuantity = keyQuantity.InputQuantity;
newKeyQuantity.PlanMHRs = keyQuantity.PlanMHRs;
newKeyQuantity.Identifier = keyQuantity.Identifier;
newKeyQuantity.Descipline = keyQuantity.Descipline;
newKeyQuantity.QuantityDesctiption = keyQuantity.QuantityDesctiption;
newKeyQuantity.PlanMHRsUnit = keyQuantity.PlanMHRsUnit;
Funs.DB.Editor_KeyQuantity.InsertOnSubmit(newKeyQuantity);
Funs.DB.SubmitChanges();
}
@ -58,6 +62,10 @@ namespace BLL
newKeyQuantity.KeyId = keyQuantity.KeyId;
newKeyQuantity.InputQuantity = keyQuantity.InputQuantity;
newKeyQuantity.PlanMHRs = keyQuantity.PlanMHRs;
newKeyQuantity.Identifier = keyQuantity.Identifier;
newKeyQuantity.Descipline = keyQuantity.Descipline;
newKeyQuantity.QuantityDesctiption = keyQuantity.QuantityDesctiption;
newKeyQuantity.PlanMHRsUnit = keyQuantity.PlanMHRsUnit;
Funs.DB.SubmitChanges();
}
}

View File

@ -135,20 +135,20 @@
</Items>
<Items>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="Key Quantity" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="KeyQuantityId" AllowCellEditing="true" EnableColumnLines="true" DataIDField="KeyQuantityId" AllowSorting="true" SortField="DepartName,DisciplinesWBSName"
runat="server" BoxFlex="1" DataKeyNames="KeyQuantityId" AllowCellEditing="true" EnableColumnLines="true" DataIDField="KeyQuantityId" AllowSorting="true" SortField="Identifier,Descipline"
SortDirection="ASC" OnSort="Grid2_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid2_PageIndexChange" EnableTextSelection="true">
<Columns>
<f:RenderField Width="140px" ColumnID="ProjectControl_JobNo" DataField="ProjectControl_JobNo" SortField="ProjectControl_JobNo"
FieldType="String" HeaderText="Job No" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="DepartName" DataField="DepartName" SortField="DepartName"
<%--<f:RenderField Width="100px" ColumnID="DepartName" DataField="DepartName" SortField="DepartName"
FieldType="String" HeaderText="Type" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>--%>
<f:RenderField Width="80px" ColumnID="Identifier" DataField="Identifier"
SortField="Identifier" FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="DisciplinesWBSCode" DataField="DisciplinesWBSCode"
SortField="DisciplinesWBSCode" FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="DisciplinesWBSName" DataField="DisciplinesWBSName"
<f:RenderField Width="180px" ColumnID="Descipline" DataField="Descipline"
FieldType="String" HeaderText="Descipline" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="QuantityDesctiption" DataField="QuantityDesctiption"

View File

@ -10,14 +10,14 @@
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" BodyPadding="10px" Margin="0 5px 0 0" AutoScroll="true" runat="server" EnableCollapse="true" Title="FCR Log" ShowHeader="false">
<f:Panel ID="Panel1" BodyPadding="10px" Margin="5px 5px 5px 5px" AutoScroll="true" runat="server" EnableCollapse="true" Title="FCR Log" ShowHeader="false">
<Items>
<f:Form ID="Form2" ShowBorder="false" ShowHeader="false" AutoScroll="true"
runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
runat="server" RedStarPosition="BeforeText" LabelAlign="Right" BodyPadding="10px">
<Rows>
<f:FormRow>
<Items>
<f:DropDownBox runat="server" ID="drpKeyId" LabelWidth="120px" EmptyText="请从下拉表格中选择" Label="Type" MatchFieldWidth="false" AutoPostBack="true" OnTextChanged="drpKeyId_TextChanged">
<%--<f:DropDownBox runat="server" ID="drpKeyId" LabelWidth="120px" EmptyText="请从下拉表格中选择" Label="Type" MatchFieldWidth="false" AutoPostBack="true" OnTextChanged="drpKeyId_TextChanged">
<PopPanel>
<f:Grid ID="Grid1" Width="650px" Height="300px" Hidden="true"
DataIDField="KeyId" DataTextField="DepartName"
@ -55,32 +55,28 @@
</Toolbars>
</f:Grid>
</PopPanel>
</f:DropDownBox>
<f:TextBox ID="txtIdentifier" runat="server" Label="Identifier" LabelWidth="200px" Readonly="true"></f:TextBox>
</f:DropDownBox>--%>
<f:DropDownList ID="drpIdentifier" runat="server" Label="Identifier" LabelWidth="200px" AutoPostBack="true" OnSelectedIndexChanged="drpIdentifier_SelectedIndexChanged" EnableEdit="true"></f:DropDownList>
<f:DropDownList ID="drpDescipline" runat="server" Label="Descipline" LabelWidth="200px" AutoPostBack="true" OnSelectedIndexChanged="drpDescipline_SelectedIndexChanged" EnableEdit="true"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtDescipline" runat="server" Label="Descipline" LabelWidth="120px" Readonly="true"></f:TextBox>
<f:TextBox ID="txtQuantityDesctiption" runat="server" Label="Quantity Desctiption" LabelWidth="200px" Readonly="true"></f:TextBox>
<f:DropDownList ID="drpQuantityDesctiption" runat="server" Label="Quantity Desctiption" LabelWidth="200px" AutoPostBack="true" OnSelectedIndexChanged="drpQuantityDesctiption_SelectedIndexChanged" EnableEdit="true"></f:DropDownList>
<f:DropDownList ID="drpPlanMHRsUnit" runat="server" Label="Plan MHRs/Unit" LabelWidth="200px" EnableEdit="true"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:NumberBox ID="txtInputQuantity" runat="server" Label="Input Quantity" LabelWidth="120px" NoNegative="true" AutoPostBack="true" OnTextChanged="txtInputQuantity_TextChanged"></f:NumberBox>
<f:NumberBox ID="txtPlanMHRsUnit" runat="server" Label="Plan MHRs/Unit" LabelWidth="200px" Readonly="true"></f:NumberBox>
<f:NumberBox ID="txtInputQuantity" runat="server" Label="Input Quantity" LabelWidth="200px" NoNegative="true" AutoPostBack="true" OnTextChanged="txtInputQuantity_TextChanged"></f:NumberBox>
<%--<f:NumberBox ID="txtPlanMHRsUnit" runat="server" Label="Plan MHRs/Unit" LabelWidth="200px" Readonly="true"></f:NumberBox>--%>
<f:NumberBox ID="txtPlanMHRs" runat="server" Label="Plan MHRs" LabelWidth="200px" Readonly="true"></f:NumberBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:NumberBox ID="txtPlanMHRs" runat="server" Label="Plan MHRs" LabelWidth="120px" Readonly="true"></f:NumberBox>
<f:NumberBox ID="txtPlanMHRsSummary" runat="server" Label="Plan MHRs Summary" LabelWidth="200px" Readonly="true"></f:NumberBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:NumberBox ID="txtActualMHRs" runat="server" Label="Actual MHRs" LabelWidth="120px" Readonly="true"></f:NumberBox>
<f:Label ID="Label1" runat="server"></f:Label>
<f:NumberBox ID="txtActualMHRs" runat="server" Label="Actual MHRs" LabelWidth="200px" Readonly="true"></f:NumberBox>
</Items>
</f:FormRow>
</Rows>

View File

@ -53,7 +53,7 @@ namespace FineUIPro.Web.EditorManage
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
BindGrid();
//BindGrid();
string view = Request.Params["view"];
if (view == "1")
{
@ -63,6 +63,12 @@ namespace FineUIPro.Web.EditorManage
{
GetButtonPower();
}
BLL.QuantityDesctiptionService.InitIdentifierDropDownList(this.drpIdentifier, true);
Funs.FineUIPleaseSelect(this.drpDescipline);
Funs.FineUIPleaseSelect(this.drpQuantityDesctiption);
Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit);
this.ProjectId = Request.Params["eProjectId"];
this.KeyQuantityId = Request.Params["keyQuantityId"];
if (!string.IsNullOrEmpty(this.KeyQuantityId))
@ -71,31 +77,64 @@ namespace FineUIPro.Web.EditorManage
if (keyQuantity != null)
{
this.ProjectId = keyQuantity.EProjectId;
this.drpKeyId.Value = keyQuantity.KeyId;
var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value);
if (key != null)
{
if (!string.IsNullOrEmpty(key.DisciplinesWBSId))
{
var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId);
if (wbs != null)
{
this.txtIdentifier.Text = wbs.DisciplinesWBSCode;
this.txtDescipline.Text = wbs.DisciplinesWBSName;
}
//this.drpKeyId.Value = keyQuantity.KeyId;
//var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value);
//if (key != null)
//{
// if (!string.IsNullOrEmpty(key.DisciplinesWBSId))
// {
// var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId);
// if (wbs != null)
// {
// this.txtIdentifier.Text = wbs.DisciplinesWBSCode;
// this.txtDescipline.Text = wbs.DisciplinesWBSName;
// }
this.txtPlanMHRsSummary.Text = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value).ToString();
double? actualHoursSum = (from x in Funs.DB.ManHours_Actual
where x.EProjectId == this.ProjectId
&& x.Discipline == wbs.DisciplinesWBSName
select x.Hours).Sum();
this.txtActualMHRs.Text = actualHoursSum.ToString();
// this.txtPlanMHRsSummary.Text = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value).ToString();
// double? actualHoursSum = (from x in Funs.DB.ManHours_Actual
// where x.EProjectId == this.ProjectId
// && x.Discipline == wbs.DisciplinesWBSName
// select x.Hours).Sum();
// this.txtActualMHRs.Text = actualHoursSum.ToString();
// }
// txtQuantityDesctiption.Text = key.QuantityDesctiption;
// txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : "";
//}
if (!string.IsNullOrEmpty(keyQuantity.Identifier))
{
this.drpIdentifier.Items.Clear();
BLL.QuantityDesctiptionService.InitIdentifierDropDownList(this.drpIdentifier, true);
this.drpIdentifier.SelectedValue = keyQuantity.Identifier;
if (!string.IsNullOrEmpty(keyQuantity.Descipline))
{
this.drpDescipline.Items.Clear();
BLL.QuantityDesctiptionService.InitDesciplineDropDownList(this.drpDescipline, true, keyQuantity.Identifier);
this.drpDescipline.SelectedValue = keyQuantity.Descipline;
if (!string.IsNullOrEmpty(keyQuantity.QuantityDesctiption))
{
this.drpQuantityDesctiption.Items.Clear();
BLL.QuantityDesctiptionService.InitQuantityDesctiptionDropDownList(this.drpQuantityDesctiption, true, keyQuantity.Identifier, keyQuantity.Descipline);
this.drpQuantityDesctiption.SelectedValue = keyQuantity.QuantityDesctiption;
if (keyQuantity.PlanMHRsUnit.HasValue)
{
this.drpPlanMHRsUnit.Items.Clear();
BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, keyQuantity.Identifier, keyQuantity.Descipline, keyQuantity.QuantityDesctiption);
this.drpPlanMHRsUnit.SelectedValue = keyQuantity.PlanMHRsUnit.ToString();
}
}
}
txtQuantityDesctiption.Text = key.QuantityDesctiption;
txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : "";
}
this.txtPlanMHRsSummary.Text = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(keyQuantity.EProjectId,keyQuantity.Identifier, keyQuantity.Descipline).ToString();
this.txtInputQuantity.Text = keyQuantity.InputQuantity.HasValue ? keyQuantity.InputQuantity.ToString() : "";
this.txtPlanMHRs.Text = keyQuantity.PlanMHRs.HasValue ? keyQuantity.PlanMHRs.ToString() : "";
double? actualHoursSum = (from x in Funs.DB.ManHours_Actual
where x.EProjectId == this.ProjectId
&& x.Discipline == keyQuantity.Descipline
select x.Hours).Sum();
this.txtActualMHRs.Text = actualHoursSum.ToString();
}
}
}
@ -106,34 +145,34 @@ namespace FineUIPro.Web.EditorManage
/// <summary>
/// 数据绑定
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT qd.KeyId,
qd.DepartId,
qd.DisciplinesWBSId,
qd.QuantityDesctiption,
qd.PlanMHRsUnit,
d.DepartName,
wbs.DisciplinesWBSCode,
wbs.DisciplinesWBSName
FROM Base_QuantityDesctiption qd
left join Base_Depart as d on qd.DepartId = d.DepartId
left join Base_DisciplinesWBS as wbs on wbs.DisciplinesWBSId = qd.DisciplinesWBSId WHERE 1=1";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtSearch.Text.Trim()))
{
strSql += " AND d.DepartName like @DepartName ";
listStr.Add(new SqlParameter("@DepartName", "%" + this.txtSearch.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
// 2.获取当前分页数据
//var table = this.GetPagedDataTable(Grid1, tb1);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
//private void BindGrid()
//{
// string strSql = @"SELECT qd.KeyId,
// qd.DepartId,
// qd.DisciplinesWBSId,
// qd.QuantityDesctiption,
// qd.PlanMHRsUnit,
// d.DepartName,
// wbs.DisciplinesWBSCode,
// wbs.DisciplinesWBSName
// FROM Base_QuantityDesctiption qd
// left join Base_Depart as d on qd.DepartId = d.DepartId
// left join Base_DisciplinesWBS as wbs on wbs.DisciplinesWBSId = qd.DisciplinesWBSId WHERE 1=1";
// List<SqlParameter> listStr = new List<SqlParameter>();
// if (!string.IsNullOrEmpty(this.txtSearch.Text.Trim()))
// {
// strSql += " AND d.DepartName like @DepartName ";
// listStr.Add(new SqlParameter("@DepartName", "%" + this.txtSearch.Text.Trim() + "%"));
// }
// SqlParameter[] parameter = listStr.ToArray();
// DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
// // 2.获取当前分页数据
// //var table = this.GetPagedDataTable(Grid1, tb1);
// Grid1.RecordCount = tb.Rows.Count;
// var table = this.GetPagedDataTable(Grid1, tb);
// Grid1.DataSource = table;
// Grid1.DataBind();
//}
#endregion
#region
@ -142,59 +181,73 @@ namespace FineUIPro.Web.EditorManage
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
//protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
//{
// Grid1.PageIndex = e.NewPageIndex;
// BindGrid();
//}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
//protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
//{
// Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
// BindGrid();
//}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
//protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
//{
// Grid1.SortDirection = e.SortDirection;
// Grid1.SortField = e.SortField;
// BindGrid();
//}
/// <summary>
/// 筛选
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
BindGrid();
}
//protected void txtSearch_TextChanged(object sender, EventArgs e)
//{
// BindGrid();
//}
#endregion
#region
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.drpKeyId.Value == BLL.Const._Null || string.IsNullOrEmpty(this.drpKeyId.Value))
if (this.drpIdentifier.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpIdentifier.SelectedValue))
{
ShowAlert("Please select Type!", MessageBoxIcon.Warning);
ShowAlert("Please select Identifier!", MessageBoxIcon.Warning);
return;
}
if (this.drpDescipline.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpDescipline.SelectedValue))
{
ShowAlert("Please select Descipline!", MessageBoxIcon.Warning);
return;
}
if (this.drpQuantityDesctiption.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpQuantityDesctiption.SelectedValue))
{
ShowAlert("Please select Quantity Desctiption!", MessageBoxIcon.Warning);
return;
}
Model.Editor_KeyQuantity newKeyQuantity = new Model.Editor_KeyQuantity();
newKeyQuantity.KeyId = this.drpKeyId.Value;
//newKeyQuantity.KeyId = this.drpKeyId.Value;
newKeyQuantity.InputQuantity = Funs.GetNewDecimal(this.txtInputQuantity.Text);
newKeyQuantity.PlanMHRs = Funs.GetNewDecimal(this.txtPlanMHRs.Text);
newKeyQuantity.Identifier = this.drpIdentifier.SelectedText;
newKeyQuantity.Descipline = this.drpDescipline.SelectedText;
newKeyQuantity.QuantityDesctiption = this.drpQuantityDesctiption.SelectedText;
newKeyQuantity.PlanMHRsUnit = Funs.GetNewDecimal(this.drpPlanMHRsUnit.SelectedText);
if (!string.IsNullOrEmpty(this.KeyQuantityId))
{
newKeyQuantity.KeyQuantityId = this.KeyQuantityId;
@ -221,41 +274,41 @@ namespace FineUIPro.Web.EditorManage
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpKeyId_TextChanged(object sender, EventArgs e)
{
this.txtIdentifier.Text = string.Empty;
this.txtDescipline.Text = string.Empty;
this.txtQuantityDesctiption.Text = string.Empty;
this.txtPlanMHRsUnit.Text = string.Empty;
this.txtPlanMHRsSummary.Text = string.Empty;
if (!string.IsNullOrEmpty(this.drpKeyId.Value))
{
var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value);
if (key != null)
{
if (!string.IsNullOrEmpty(key.DisciplinesWBSId))
{
var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId);
if (wbs != null)
{
this.txtIdentifier.Text = wbs.DisciplinesWBSCode;
this.txtDescipline.Text = wbs.DisciplinesWBSName;
}
//protected void drpKeyId_TextChanged(object sender, EventArgs e)
//{
// this.txtIdentifier.Text = string.Empty;
// this.txtDescipline.Text = string.Empty;
// this.txtQuantityDesctiption.Text = string.Empty;
// this.txtPlanMHRsUnit.Text = string.Empty;
// this.txtPlanMHRsSummary.Text = string.Empty;
// if (!string.IsNullOrEmpty(this.drpKeyId.Value))
// {
// var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value);
// if (key != null)
// {
// if (!string.IsNullOrEmpty(key.DisciplinesWBSId))
// {
// var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId);
// if (wbs != null)
// {
// this.txtIdentifier.Text = wbs.DisciplinesWBSCode;
// this.txtDescipline.Text = wbs.DisciplinesWBSName;
// }
decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value);
this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString();
// decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value);
// this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString();
double? actualHoursSum = (from x in Funs.DB.ManHours_Actual
where x.EProjectId == this.ProjectId
&& x.Discipline == wbs.DisciplinesWBSName
select x.Hours).Sum();
this.txtActualMHRs.Text = actualHoursSum.ToString();
}
txtQuantityDesctiption.Text = key.QuantityDesctiption;
txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : "";
}
}
}
// double? actualHoursSum = (from x in Funs.DB.ManHours_Actual
// where x.EProjectId == this.ProjectId
// && x.Discipline == wbs.DisciplinesWBSName
// select x.Hours).Sum();
// this.txtActualMHRs.Text = actualHoursSum.ToString();
// }
// txtQuantityDesctiption.Text = key.QuantityDesctiption;
// txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : "";
// }
// }
//}
/// <summary>
/// Input Quantity输入事件
@ -268,9 +321,9 @@ namespace FineUIPro.Web.EditorManage
this.txtPlanMHRsSummary.Text = string.Empty;
if (!string.IsNullOrEmpty(this.txtInputQuantity.Text.Trim()))
{
this.txtPlanMHRs.Text = (Funs.GetNewDecimal(this.txtInputQuantity.Text) * Funs.GetNewDecimal(this.txtPlanMHRsUnit.Text)).ToString();
this.txtPlanMHRs.Text = (Funs.GetNewDecimal(this.txtInputQuantity.Text) * Funs.GetNewDecimal(this.drpPlanMHRsUnit.SelectedText)).ToString();
decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value);
decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.ProjectId ,this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue);
if (s > 0)
{
this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString();
@ -281,6 +334,70 @@ namespace FineUIPro.Web.EditorManage
}
}
}
/// <summary>
/// Identifier 下拉选择
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpIdentifier_SelectedIndexChanged(object sender, EventArgs e)
{
drpDescipline.Items.Clear();
if (this.drpIdentifier.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIdentifier.SelectedValue))
{
BLL.QuantityDesctiptionService.InitDesciplineDropDownList(this.drpDescipline, true, this.drpIdentifier.SelectedValue);
}
else
{
Funs.FineUIPleaseSelect(this.drpDescipline);
}
this.drpDescipline.SelectedIndex = 0;
}
/// <summary>
/// Descipline下拉选择
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpDescipline_SelectedIndexChanged(object sender, EventArgs e)
{
this.txtActualMHRs.Text = string.Empty;
drpQuantityDesctiption.Items.Clear();
if (this.drpDescipline.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpDescipline.SelectedValue))
{
BLL.QuantityDesctiptionService.InitQuantityDesctiptionDropDownList(this.drpQuantityDesctiption, true, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue);
double? actualHoursSum = (from x in Funs.DB.ManHours_Actual
where x.EProjectId == this.ProjectId
&& x.Discipline == this.drpDescipline.SelectedValue
select x.Hours).Sum();
this.txtActualMHRs.Text = actualHoursSum.ToString();
}
else
{
Funs.FineUIPleaseSelect(this.drpQuantityDesctiption);
}
this.drpQuantityDesctiption.SelectedIndex = 0;
}
/// <summary>
/// Quantity Desctiption下拉选择
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpQuantityDesctiption_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpPlanMHRsUnit.Items.Clear();
if (this.drpQuantityDesctiption.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpQuantityDesctiption.SelectedValue))
{
BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue, this.drpQuantityDesctiption.SelectedValue);
}
else
{
Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit);
}
this.drpPlanMHRsUnit.SelectedIndex = 0;
}
#endregion
#region
@ -298,6 +415,6 @@ namespace FineUIPro.Web.EditorManage
}
}
}
#endregion
#endregion
}
}

View File

@ -51,85 +51,40 @@ namespace FineUIPro.Web.EditorManage
protected global::FineUIPro.Form Form2;
/// <summary>
/// drpKeyId 控件。
/// drpIdentifier 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownBox drpKeyId;
protected global::FineUIPro.DropDownList drpIdentifier;
/// <summary>
/// Grid1 控件。
/// drpDescipline 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
protected global::FineUIPro.DropDownList drpDescipline;
/// <summary>
/// ToolbarSeparator1 控件。
/// drpQuantityDesctiption 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
protected global::FineUIPro.DropDownList drpQuantityDesctiption;
/// <summary>
/// ToolbarText1 控件。
/// drpPlanMHRsUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// txtSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSearch;
/// <summary>
/// txtIdentifier 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtIdentifier;
/// <summary>
/// txtDescipline 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDescipline;
/// <summary>
/// txtQuantityDesctiption 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtQuantityDesctiption;
protected global::FineUIPro.DropDownList drpPlanMHRsUnit;
/// <summary>
/// txtInputQuantity 控件。
@ -140,15 +95,6 @@ namespace FineUIPro.Web.EditorManage
/// </remarks>
protected global::FineUIPro.NumberBox txtInputQuantity;
/// <summary>
/// txtPlanMHRsUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtPlanMHRsUnit;
/// <summary>
/// txtPlanMHRs 控件。
/// </summary>
@ -176,15 +122,6 @@ namespace FineUIPro.Web.EditorManage
/// </remarks>
protected global::FineUIPro.NumberBox txtActualMHRs;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// Toolbar1 控件。
/// </summary>

View File

@ -15,7 +15,7 @@
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="Key Quantity" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="KeyQuantityId" AllowCellEditing="true" EnableColumnLines="true"
ClicksToEdit="2" DataIDField="KeyQuantityId" AllowSorting="true" SortField="DepartName,DisciplinesWBSName"
ClicksToEdit="2" DataIDField="KeyQuantityId" AllowSorting="true" SortField="Identifier,Descipline"
SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
@ -36,13 +36,13 @@
<f:RenderField Width="120px" ColumnID="ProjectControl_JobNo" DataField="ProjectControl_JobNo" SortField="ProjectControl_JobNo"
FieldType="String" HeaderText="Job No" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="DepartName" DataField="DepartName" SortField="DepartName"
<%--<f:RenderField Width="100px" ColumnID="DepartName" DataField="DepartName" SortField="DepartName"
FieldType="String" HeaderText="Type" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>--%>
<f:RenderField Width="80px" ColumnID="Identifier" DataField="Identifier"
SortField="Identifier" FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="DisciplinesWBSCode" DataField="DisciplinesWBSCode"
SortField="DisciplinesWBSCode" FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="DisciplinesWBSName" DataField="DisciplinesWBSName"
<f:RenderField Width="180px" ColumnID="Descipline" DataField="Descipline"
FieldType="String" HeaderText="Descipline" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="QuantityDesctiption" DataField="QuantityDesctiption"

View File

@ -643,8 +643,10 @@ namespace FineUIPro.Web.EditorManage
}
// 后加当PM中Milestone(Actual)的Project Approval不为空并且IFC ALL的ReceiveHC不为空状态为In Procurement
//或者当PM中Milestone(Actual)的Project Approval不为空并且IFC NA的ReceiveHC不为空状态为In Procurement
var con_all = from x in Funs.DB.Editor_TDC where x.EProjectId == epro.EProjectId && x.Type == "D01_IFC" && x.Disc == "00_ALL" && x.ReceiveHC.HasValue select x;
if (epro.ProjectControl_JobType != "Other" && epro.PM_MA_ProjectApproval.HasValue && con_all.Count() > 0)
var con_na = from x in Funs.DB.Editor_TDC where x.EProjectId == epro.EProjectId && x.Type == "D01_IFC" && x.Disc == "90_NA" && x.ReceiveHC.HasValue select x;
if (epro.ProjectControl_JobType != "Other" && epro.PM_MA_ProjectApproval.HasValue && (con_all.Count() > 0 || con_na.Count() > 0))
{
if (eproject.ProjectControl_JobStatus == null || eproject.ProjectControl_JobStatus == "" || eproject.ProjectControl_JobStatus == "Detailed Design" || eproject.ProjectControl_JobStatus == "On Going" || eproject.ProjectControl_JobStatus == "Study" || eproject.ProjectControl_JobStatus == "Not Start")
{

View File

@ -223,14 +223,14 @@ namespace FineUIPro.Web.EditorManage
// 后加当PM中Milestone(Actual)的Project Approval不为空并且IFC ALL的ReceiveHC不为空状态为In Procurement
var con_all = from x in Funs.DB.Editor_TDC where x.EProjectId == eproject.EProjectId && x.Type == "D01_IFC" && x.Disc == "00_ALL" && x.ReceiveHC.HasValue select x;
if (eproject.ProjectControl_JobType != "Other" && eproject.PM_MA_ProjectApproval.HasValue && con_all.Count() > 0)
var con_na = from x in Funs.DB.Editor_TDC where x.EProjectId == eproject.EProjectId && x.Type == "D01_IFC" && x.Disc == "90_NA" && x.ReceiveHC.HasValue select x;
if (eproject.ProjectControl_JobType != "Other" && eproject.PM_MA_ProjectApproval.HasValue && (con_all.Count() > 0 || con_na.Count() > 0))
{
if (eproject.ProjectControl_JobStatus == null || eproject.ProjectControl_JobStatus == "" || eproject.ProjectControl_JobStatus == "Detailed Design" || eproject.ProjectControl_JobStatus == "On Going" || eproject.ProjectControl_JobStatus == "Study" || eproject.ProjectControl_JobStatus == "Not Start")
{
eproject.ProjectControl_JobStatus = "In Procurement";
}
}
#endregion
if ((eproject.Permit_PS_SafetyFinalAcc.HasValue && eproject.Permit_PA_SafetyFinalACC.HasValue

View File

@ -11584,6 +11584,14 @@ namespace Model
private System.Nullable<decimal> _PlanMHRs;
private string _Identifier;
private string _Descipline;
private string _QuantityDesctiption;
private System.Nullable<decimal> _PlanMHRsUnit;
private EntityRef<Base_QuantityDesctiption> _Base_QuantityDesctiption;
private EntityRef<Editor_EProject> _Editor_EProject;
@ -11602,6 +11610,14 @@ namespace Model
partial void OnInputQuantityChanged();
partial void OnPlanMHRsChanging(System.Nullable<decimal> value);
partial void OnPlanMHRsChanged();
partial void OnIdentifierChanging(string value);
partial void OnIdentifierChanged();
partial void OnDesciplineChanging(string value);
partial void OnDesciplineChanged();
partial void OnQuantityDesctiptionChanging(string value);
partial void OnQuantityDesctiptionChanged();
partial void OnPlanMHRsUnitChanging(System.Nullable<decimal> value);
partial void OnPlanMHRsUnitChanged();
#endregion
public Editor_KeyQuantity()
@ -11719,6 +11735,86 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Identifier", DbType="NVarChar(50)")]
public string Identifier
{
get
{
return this._Identifier;
}
set
{
if ((this._Identifier != value))
{
this.OnIdentifierChanging(value);
this.SendPropertyChanging();
this._Identifier = value;
this.SendPropertyChanged("Identifier");
this.OnIdentifierChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Descipline", DbType="NVarChar(50)")]
public string Descipline
{
get
{
return this._Descipline;
}
set
{
if ((this._Descipline != value))
{
this.OnDesciplineChanging(value);
this.SendPropertyChanging();
this._Descipline = value;
this.SendPropertyChanged("Descipline");
this.OnDesciplineChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_QuantityDesctiption", DbType="NVarChar(200)")]
public string QuantityDesctiption
{
get
{
return this._QuantityDesctiption;
}
set
{
if ((this._QuantityDesctiption != value))
{
this.OnQuantityDesctiptionChanging(value);
this.SendPropertyChanging();
this._QuantityDesctiption = value;
this.SendPropertyChanged("QuantityDesctiption");
this.OnQuantityDesctiptionChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanMHRsUnit", DbType="Decimal(18,2)")]
public System.Nullable<decimal> PlanMHRsUnit
{
get
{
return this._PlanMHRsUnit;
}
set
{
if ((this._PlanMHRsUnit != value))
{
this.OnPlanMHRsUnitChanging(value);
this.SendPropertyChanging();
this._PlanMHRsUnit = value;
this.SendPropertyChanged("PlanMHRsUnit");
this.OnPlanMHRsUnitChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Editor_KeyQuantity_Base_QuantityDesctiption", Storage="_Base_QuantityDesctiption", ThisKey="KeyId", OtherKey="KeyId", IsForeignKey=true)]
public Base_QuantityDesctiption Base_QuantityDesctiption
{