2024-12-13 15:54:19 +08:00
|
|
|
|
using BLL;
|
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.EditorManage
|
|
|
|
|
{
|
|
|
|
|
public partial class KeyQuantityEditorEdit : PageBase
|
|
|
|
|
{
|
|
|
|
|
#region 定义项
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 主键
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string KeyQuantityId
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (string)ViewState["KeyQuantityId"];
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
ViewState["KeyQuantityId"] = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 项目Id
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ProjectId
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (string)ViewState["ProjectId"];
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
ViewState["ProjectId"] = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 加载
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
|
|
|
|
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
2025-01-16 17:02:02 +08:00
|
|
|
|
//BindGrid();
|
2024-12-13 15:54:19 +08:00
|
|
|
|
string view = Request.Params["view"];
|
|
|
|
|
if (view == "1")
|
|
|
|
|
{
|
|
|
|
|
this.btnSave.Hidden = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GetButtonPower();
|
|
|
|
|
}
|
2025-01-16 17:02:02 +08:00
|
|
|
|
|
2025-02-24 10:10:04 +08:00
|
|
|
|
BLL.ConstValue.InitSysConstDropDownList(this.drpType, "KeyQuantityType", false);
|
|
|
|
|
if (!string.IsNullOrEmpty(this.drpType.SelectedValue) && this.drpType.SelectedValue != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
BLL.QuantityDesctiptionService.InitIdentifierDropDownList(this.drpIdentifier, this.drpType.SelectedValue, true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Funs.FineUIPleaseSelect(this.drpIdentifier);
|
|
|
|
|
}
|
2025-01-16 17:02:02 +08:00
|
|
|
|
Funs.FineUIPleaseSelect(this.drpDescipline);
|
|
|
|
|
Funs.FineUIPleaseSelect(this.drpQuantityDesctiption);
|
|
|
|
|
Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit);
|
|
|
|
|
|
2024-12-13 15:54:19 +08:00
|
|
|
|
this.ProjectId = Request.Params["eProjectId"];
|
|
|
|
|
this.KeyQuantityId = Request.Params["keyQuantityId"];
|
|
|
|
|
if (!string.IsNullOrEmpty(this.KeyQuantityId))
|
|
|
|
|
{
|
|
|
|
|
Model.Editor_KeyQuantity keyQuantity = BLL.KeyQuantityService.GetKeyQuantityById(this.KeyQuantityId);
|
|
|
|
|
if (keyQuantity != null)
|
|
|
|
|
{
|
|
|
|
|
this.ProjectId = keyQuantity.EProjectId;
|
2025-01-16 17:02:02 +08:00
|
|
|
|
//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();
|
|
|
|
|
// }
|
|
|
|
|
// txtQuantityDesctiption.Text = key.QuantityDesctiption;
|
|
|
|
|
// txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : "";
|
|
|
|
|
//}
|
2025-02-24 10:10:04 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(keyQuantity.Type))
|
2024-12-13 15:54:19 +08:00
|
|
|
|
{
|
2025-02-24 10:10:04 +08:00
|
|
|
|
this.drpType.SelectedValue = keyQuantity.Type;
|
2025-01-16 17:02:02 +08:00
|
|
|
|
|
2025-02-24 10:10:04 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(keyQuantity.Identifier))
|
2024-12-13 15:54:19 +08:00
|
|
|
|
{
|
2025-02-24 10:10:04 +08:00
|
|
|
|
this.drpIdentifier.Items.Clear();
|
|
|
|
|
BLL.QuantityDesctiptionService.InitIdentifierDropDownList(this.drpIdentifier, keyQuantity.Type, true);
|
|
|
|
|
this.drpIdentifier.SelectedValue = keyQuantity.Identifier;
|
2025-01-16 17:02:02 +08:00
|
|
|
|
|
2025-02-24 10:10:04 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(keyQuantity.Descipline))
|
2024-12-13 15:54:19 +08:00
|
|
|
|
{
|
2025-02-24 10:10:04 +08:00
|
|
|
|
this.drpDescipline.Items.Clear();
|
|
|
|
|
BLL.QuantityDesctiptionService.InitDesciplineDropDownList(this.drpDescipline, true, keyQuantity.Type, keyQuantity.Identifier);
|
|
|
|
|
this.drpDescipline.SelectedValue = keyQuantity.Descipline;
|
2024-12-13 15:54:19 +08:00
|
|
|
|
|
2025-02-24 10:10:04 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(keyQuantity.QuantityDesctiption))
|
2025-01-16 17:02:02 +08:00
|
|
|
|
{
|
2025-02-24 10:10:04 +08:00
|
|
|
|
this.drpQuantityDesctiption.Items.Clear();
|
|
|
|
|
BLL.QuantityDesctiptionService.InitQuantityDesctiptionDropDownList(this.drpQuantityDesctiption, true, keyQuantity.Type, keyQuantity.Identifier, keyQuantity.Descipline);
|
|
|
|
|
this.drpQuantityDesctiption.SelectedValue = keyQuantity.QuantityDesctiption;
|
|
|
|
|
|
|
|
|
|
if (keyQuantity.PlanMHRsUnit.HasValue)
|
|
|
|
|
{
|
|
|
|
|
this.drpPlanMHRsUnit.Items.Clear();
|
|
|
|
|
BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, keyQuantity.Type, keyQuantity.Identifier, keyQuantity.Descipline, keyQuantity.QuantityDesctiption);
|
|
|
|
|
this.drpPlanMHRsUnit.SelectedValue = keyQuantity.PlanMHRsUnit.ToString();
|
|
|
|
|
}
|
2025-01-16 17:02:02 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-13 15:54:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-24 10:10:04 +08:00
|
|
|
|
this.txtPlanMHRsSummary.Text = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(keyQuantity.EProjectId, keyQuantity.Identifier, keyQuantity.Descipline).ToString();
|
2024-12-13 15:54:19 +08:00
|
|
|
|
this.txtInputQuantity.Text = keyQuantity.InputQuantity.HasValue ? keyQuantity.InputQuantity.ToString() : "";
|
|
|
|
|
this.txtPlanMHRs.Text = keyQuantity.PlanMHRs.HasValue ? keyQuantity.PlanMHRs.ToString() : "";
|
2025-01-16 17:02:02 +08:00
|
|
|
|
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();
|
2024-12-13 15:54:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 绑定数据
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 数据绑定
|
|
|
|
|
/// </summary>
|
2025-01-16 17:02:02 +08:00
|
|
|
|
//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();
|
|
|
|
|
//}
|
2024-12-13 15:54:19 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 分页、排序
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 分页
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
2025-01-16 17:02:02 +08:00
|
|
|
|
//protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
|
|
|
|
//{
|
|
|
|
|
// Grid1.PageIndex = e.NewPageIndex;
|
|
|
|
|
// BindGrid();
|
|
|
|
|
//}
|
2024-12-13 15:54:19 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 分页显示条数下拉框
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
2025-01-16 17:02:02 +08:00
|
|
|
|
//protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
//{
|
|
|
|
|
// Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
|
|
|
|
// BindGrid();
|
|
|
|
|
//}
|
2024-12-13 15:54:19 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 排序
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
2025-01-16 17:02:02 +08:00
|
|
|
|
//protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
|
|
|
|
//{
|
|
|
|
|
// Grid1.SortDirection = e.SortDirection;
|
|
|
|
|
// Grid1.SortField = e.SortField;
|
|
|
|
|
// BindGrid();
|
|
|
|
|
//}
|
2024-12-13 15:54:19 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 筛选
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
2025-01-16 17:02:02 +08:00
|
|
|
|
//protected void txtSearch_TextChanged(object sender, EventArgs e)
|
|
|
|
|
//{
|
|
|
|
|
// BindGrid();
|
|
|
|
|
//}
|
2024-12-13 15:54:19 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 保存
|
|
|
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2025-02-24 10:10:04 +08:00
|
|
|
|
if (this.drpType.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpType.SelectedValue))
|
|
|
|
|
{
|
|
|
|
|
ShowAlert("Please select Type!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-01-16 17:02:02 +08:00
|
|
|
|
if (this.drpIdentifier.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpIdentifier.SelectedValue))
|
|
|
|
|
{
|
|
|
|
|
ShowAlert("Please select Identifier!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.drpDescipline.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpDescipline.SelectedValue))
|
2024-12-13 15:54:19 +08:00
|
|
|
|
{
|
2025-01-16 17:02:02 +08:00
|
|
|
|
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);
|
2024-12-13 15:54:19 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Model.Editor_KeyQuantity newKeyQuantity = new Model.Editor_KeyQuantity();
|
2025-02-24 10:10:04 +08:00
|
|
|
|
newKeyQuantity.Type = this.drpType.SelectedValue;
|
2024-12-13 15:54:19 +08:00
|
|
|
|
newKeyQuantity.InputQuantity = Funs.GetNewDecimal(this.txtInputQuantity.Text);
|
|
|
|
|
newKeyQuantity.PlanMHRs = Funs.GetNewDecimal(this.txtPlanMHRs.Text);
|
2025-01-16 17:02:02 +08:00
|
|
|
|
newKeyQuantity.Identifier = this.drpIdentifier.SelectedText;
|
|
|
|
|
newKeyQuantity.Descipline = this.drpDescipline.SelectedText;
|
|
|
|
|
newKeyQuantity.QuantityDesctiption = this.drpQuantityDesctiption.SelectedText;
|
|
|
|
|
newKeyQuantity.PlanMHRsUnit = Funs.GetNewDecimal(this.drpPlanMHRsUnit.SelectedText);
|
|
|
|
|
|
2024-12-13 15:54:19 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(this.KeyQuantityId))
|
|
|
|
|
{
|
|
|
|
|
newKeyQuantity.KeyQuantityId = this.KeyQuantityId;
|
|
|
|
|
BLL.KeyQuantityService.UpdateKeyQuantity(newKeyQuantity);
|
|
|
|
|
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Modify Key Quantity Editor information!");
|
|
|
|
|
ShowNotify("Save Successfully!", MessageBoxIcon.Success);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
newKeyQuantity.EProjectId = ProjectId;
|
|
|
|
|
this.KeyQuantityId = SQLHelper.GetNewID(typeof(Model.Editor_KeyQuantity));
|
|
|
|
|
newKeyQuantity.KeyQuantityId = this.KeyQuantityId;
|
|
|
|
|
BLL.KeyQuantityService.AddKeyQuantity(newKeyQuantity);
|
|
|
|
|
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add Key Quantity Editor information!");
|
|
|
|
|
ShowNotify("Save Successfully!", MessageBoxIcon.Success);
|
|
|
|
|
}
|
|
|
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region DropDownList下拉选择事件
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 部门下拉选择事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
2025-01-16 17:02:02 +08:00
|
|
|
|
//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;
|
|
|
|
|
// }
|
2024-12-13 15:54:19 +08:00
|
|
|
|
|
2025-01-16 17:02:02 +08:00
|
|
|
|
// decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value);
|
|
|
|
|
// this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString();
|
2024-12-13 15:54:19 +08:00
|
|
|
|
|
2025-01-16 17:02:02 +08:00
|
|
|
|
// 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() : "";
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
2024-12-13 15:54:19 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Input Quantity输入事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void txtInputQuantity_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.txtPlanMHRs.Text = string.Empty;
|
|
|
|
|
this.txtPlanMHRsSummary.Text = string.Empty;
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtInputQuantity.Text.Trim()))
|
|
|
|
|
{
|
2025-01-16 17:02:02 +08:00
|
|
|
|
this.txtPlanMHRs.Text = (Funs.GetNewDecimal(this.txtInputQuantity.Text) * Funs.GetNewDecimal(this.drpPlanMHRsUnit.SelectedText)).ToString();
|
2024-12-13 15:54:19 +08:00
|
|
|
|
|
2025-01-16 17:02:02 +08:00
|
|
|
|
decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.ProjectId ,this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue);
|
2024-12-13 15:54:19 +08:00
|
|
|
|
if (s > 0)
|
|
|
|
|
{
|
|
|
|
|
this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.txtPlanMHRsSummary.Text = this.txtPlanMHRs.Text;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-16 17:02:02 +08:00
|
|
|
|
|
2025-02-24 10:10:04 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Type 下拉选择
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void drpType_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.drpIdentifier.Items.Clear();
|
|
|
|
|
this.drpDescipline.Items.Clear();
|
|
|
|
|
this.drpQuantityDesctiption.Items.Clear();
|
|
|
|
|
this.drpPlanMHRsUnit.Items.Clear();
|
|
|
|
|
if (this.drpType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpType.SelectedValue))
|
|
|
|
|
{
|
|
|
|
|
BLL.QuantityDesctiptionService.InitIdentifierDropDownList(this.drpIdentifier, this.drpType.SelectedValue, true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Funs.FineUIPleaseSelect(this.drpIdentifier);
|
|
|
|
|
}
|
|
|
|
|
this.drpIdentifier.SelectedIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-16 17:02:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Identifier 下拉选择
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void drpIdentifier_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2025-02-24 10:10:04 +08:00
|
|
|
|
this.drpDescipline.Items.Clear();
|
|
|
|
|
this.drpQuantityDesctiption.Items.Clear();
|
|
|
|
|
this.drpPlanMHRsUnit.Items.Clear();
|
|
|
|
|
if (this.drpIdentifier.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIdentifier.SelectedValue) && this.drpType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpType.SelectedValue))
|
2025-01-16 17:02:02 +08:00
|
|
|
|
{
|
2025-02-24 10:10:04 +08:00
|
|
|
|
BLL.QuantityDesctiptionService.InitDesciplineDropDownList(this.drpDescipline, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue);
|
2025-01-16 17:02:02 +08:00
|
|
|
|
}
|
|
|
|
|
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;
|
2025-02-24 10:10:04 +08:00
|
|
|
|
this.drpQuantityDesctiption.Items.Clear();
|
|
|
|
|
this.drpPlanMHRsUnit.Items.Clear();
|
|
|
|
|
if (this.drpType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpType.SelectedValue) && this.drpIdentifier.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIdentifier.SelectedValue) && this.drpDescipline.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpDescipline.SelectedValue))
|
2025-01-16 17:02:02 +08:00
|
|
|
|
{
|
2025-02-24 10:10:04 +08:00
|
|
|
|
BLL.QuantityDesctiptionService.InitQuantityDesctiptionDropDownList(this.drpQuantityDesctiption, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue);
|
2025-01-16 17:02:02 +08:00
|
|
|
|
|
|
|
|
|
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();
|
2025-02-24 10:10:04 +08:00
|
|
|
|
if (this.drpType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpType.SelectedValue) && this.drpIdentifier.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIdentifier.SelectedValue) && this.drpDescipline.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpDescipline.SelectedValue) && this.drpQuantityDesctiption.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpQuantityDesctiption.SelectedValue))
|
2025-01-16 17:02:02 +08:00
|
|
|
|
{
|
2025-02-24 10:10:04 +08:00
|
|
|
|
BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue, this.drpQuantityDesctiption.SelectedValue);
|
2025-01-16 17:02:02 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit);
|
|
|
|
|
}
|
|
|
|
|
this.drpPlanMHRsUnit.SelectedIndex = 0;
|
|
|
|
|
}
|
2024-12-13 15:54:19 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 权限设置
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 菜单按钮权限
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void GetButtonPower()
|
|
|
|
|
{
|
|
|
|
|
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.KeyQuantityMenuId);
|
|
|
|
|
if (buttonList.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
if (buttonList.Contains(BLL.Const.BtnSave))
|
|
|
|
|
{
|
|
|
|
|
this.btnSave.Hidden = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-24 10:10:04 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
2024-12-13 15:54:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|