20230531 脚本、版本日志整理
This commit is contained in:
@@ -22,6 +22,20 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
ViewState["ExpenseId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
@@ -34,27 +48,39 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideRefreshReference();
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
this.ExpenseId = Request.Params["ExpenseId"];
|
||||
if (!string.IsNullOrEmpty(this.ExpenseId))
|
||||
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, false);
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && !CommonService.IsSedinOrSub(this.CurrUser.UnitId))
|
||||
{
|
||||
var expense = BLL.ExpenseService.GetExpenseById(this.ExpenseId);
|
||||
if (expense != null)
|
||||
{
|
||||
if (expense != null)
|
||||
{
|
||||
this.ExpenseId = expense.ExpenseId;
|
||||
this.drpUnit.Text = UnitService.GetUnitNameByUnitId( expense.UnitId);
|
||||
this.txtYear.Text = expense.Year.ToString();
|
||||
this.lbSortIndex.Text = expense.SortIndex.ToString();
|
||||
|
||||
}
|
||||
}
|
||||
this.drpUnit.Readonly = true;
|
||||
}
|
||||
|
||||
|
||||
SetPage(BLL.ExpenseService.GetExpenseById(this.ExpenseId));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void SetPage(Model.CostGoods_Expense expense)
|
||||
{
|
||||
if (expense != null)
|
||||
{
|
||||
this.drpUnit.SelectedValue = expense.UnitId;
|
||||
this.txtYear.Text = expense.Year.ToString();
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", expense.ReportDate);
|
||||
this.Grid1.DataSource = from x in Funs.DB.CostGoods_ExpenseDetail
|
||||
where x.ExpenseId == this.ExpenseId
|
||||
orderby x.SupSortIndex, x.SortIndex
|
||||
select x;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region 附件上传
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
@@ -69,5 +95,20 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 单位变化事件
|
||||
/// <summary>
|
||||
/// 单位变化事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpUnit.SelectedValue != Const._Null && !string.IsNullOrEmpty(this.txtYear.Text))
|
||||
{
|
||||
SetPage(Funs.DB.CostGoods_Expense.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.UnitId == this.drpUnit.SelectedValue && x.Year.ToString() == this.txtYear.Text));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user