20230606新增费用申请页面、项目列表按活跃度排序
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.BaseInfo;
|
||||
using Model;
|
||||
using System;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.CostGoods
|
||||
@@ -49,28 +51,23 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
this.CostManageId = Request.Params["CostManageId"];
|
||||
this.CostManageItemId = Request.Params["CostManageItemId"];
|
||||
this.drpInvestCostProject.DataTextField = "Text";
|
||||
this.drpInvestCostProject.DataValueField = "Value";
|
||||
this.drpInvestCostProject.DataSource = BLL.CostManageItemService.GetInvestCostProjectList();
|
||||
this.drpInvestCostProject.DataBind();
|
||||
this.CostManageItemId = Request.Params["CostManageItemId"] ?? SQLHelper.GetNewID();
|
||||
|
||||
CostTypeService.InitCostTypeDropDownList(this.drpSupCostType, true);
|
||||
if (!string.IsNullOrEmpty(this.CostManageItemId))
|
||||
{
|
||||
Model.CostGoods_CostManageItem costManageItem = BLL.CostManageItemService.GetCostManageItemById(this.CostManageItemId);
|
||||
var costManageItem = BLL.CostManageItemService.GetCostManageItemById(this.CostManageItemId);
|
||||
if (costManageItem != null)
|
||||
{
|
||||
this.CostManageId = costManageItem.CostManageId;
|
||||
this.drpInvestCostProject.SelectedValue = costManageItem.InvestCostProject;
|
||||
this.txtUseReason.Text = costManageItem.UseReason;
|
||||
if (costManageItem.Counts != null)
|
||||
{
|
||||
this.txtCount.Text = Convert.ToString(costManageItem.Counts);
|
||||
}
|
||||
this.drpSupCostType.SelectedValue = costManageItem.SupCostTypeId;
|
||||
CostTypeService.InitCostTypeItemDropDownList(this.drpCostType, this.drpSupCostType.SelectedValue, false);
|
||||
this.drpCostType.SelectedValue = costManageItem.CostTypeId;
|
||||
this.txtInvestCostProject.Text= costManageItem.InvestCostProject;
|
||||
if (costManageItem.PriceMoney != null)
|
||||
{
|
||||
this.txtPriceMoney.Text = Convert.ToString(costManageItem.PriceMoney);
|
||||
}
|
||||
this.txtTotalMoney.Text = Convert.ToString(costManageItem.Counts * costManageItem.PriceMoney);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,43 +82,80 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool isSave = true;
|
||||
Model.CostGoods_CostManageItem costManageItem = new Model.CostGoods_CostManageItem
|
||||
{
|
||||
CostManageId = this.CostManageId,
|
||||
InvestCostProject = this.drpInvestCostProject.SelectedValue,
|
||||
UseReason = this.txtUseReason.Text.Trim(),
|
||||
Counts = Funs.GetNewInt(this.txtCount.Text.Trim()),
|
||||
CostManageItemId = this.CostManageItemId,
|
||||
InvestCostProject = this.txtInvestCostProject.Text.Trim(),
|
||||
PriceMoney = Funs.GetNewDecimalOrZero(this.txtPriceMoney.Text.Trim()),
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.CostManageItemId))
|
||||
|
||||
var getSupType =CostTypeService.GetCostTypeById(this.drpSupCostType.SelectedValue);
|
||||
if (getSupType != null)
|
||||
{
|
||||
costManageItem.CostManageItemId = this.CostManageItemId;
|
||||
BLL.CostManageItemService.UpdateCostManageItem(costManageItem);
|
||||
costManageItem.SupCostTypeId = getSupType.CostTypeId;
|
||||
costManageItem.SupCostTypeName = getSupType.CostTypeName;
|
||||
costManageItem.SupSortIndex = getSupType.CostTypeCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.CostManageItemId = SQLHelper.GetNewID(typeof(Model.CostGoods_CostManageItem));
|
||||
costManageItem.CostManageItemId = this.CostManageItemId;
|
||||
BLL.CostManageItemService.AddCostManageItem(costManageItem);
|
||||
isSave = false;
|
||||
}
|
||||
var getCostType=CostTypeService.GetCostTypeItemById(this.drpCostType.SelectedValue);
|
||||
if (getCostType != null)
|
||||
{
|
||||
costManageItem.CostTypeId = getCostType.CostTypeItemId;
|
||||
costManageItem.CostTypeName = getCostType.CostTypeItemName;
|
||||
costManageItem.SortIndex = getCostType.SortIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
isSave = false;
|
||||
}
|
||||
|
||||
if (isSave)
|
||||
{
|
||||
var getItem = BLL.CostManageItemService.GetCostManageItemById(this.CostManageItemId);
|
||||
if (getItem != null)
|
||||
{
|
||||
costManageItem.CostManageItemId = this.CostManageItemId;
|
||||
BLL.CostManageItemService.UpdateCostManageItem(costManageItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
costManageItem.CostManageItemId = this.CostManageItemId;
|
||||
BLL.CostManageItemService.AddCostManageItem(costManageItem);
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("费用类别或分项存在问题,请重新选择!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 计算总价
|
||||
/// <summary>
|
||||
/// 计算总价
|
||||
/// 类型下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Text_TextChanged(object sender, EventArgs e)
|
||||
protected void drpSupCostType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtCount.Text.Trim()) && !string.IsNullOrEmpty(this.txtPriceMoney.Text.Trim()))
|
||||
{
|
||||
int? count = Funs.GetNewInt(this.txtCount.Text.Trim());
|
||||
decimal? price = Funs.GetNewDecimalOrZero(this.txtPriceMoney.Text.Trim());
|
||||
this.txtTotalMoney.Text = Convert.ToString(count * price);
|
||||
}
|
||||
CostTypeService.InitCostTypeItemDropDownList(this.drpCostType,this.drpSupCostType.SelectedValue, false);
|
||||
}
|
||||
|
||||
#region 附件上传
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAttachUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CostManageItemAttachUrl&menuId={1}", this.CostManageItemId, BLL.Const.ProjectCostManageMenuId)));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user