20240928 单位工程划分
This commit is contained in:
@@ -155,7 +155,6 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
#endregion
|
||||
|
||||
#region 数据绑定和事件
|
||||
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
@@ -166,7 +165,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
var zxsql = strSql + " union all " + strSql1 + " ) as t order by t.Sort,t.DivisionLevel asc";
|
||||
var zxsql = strSql + " union all " + strSql1 + " ) as t order by t.BranchEngineeringCode,t.Sort,t.DivisionLevel,t.ProEngineeringNum asc";
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(zxsql, parameter);
|
||||
Grid1.DataSource = tb;
|
||||
Grid1.DataBind();
|
||||
@@ -177,28 +176,6 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
this.Grid1.SelectedRowIDArray = selectIds.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 改变页索引
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
//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();
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
@@ -277,6 +254,118 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DivisionDivideAndCropDataIn.aspx", "导入 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 拷贝
|
||||
/// <summary>
|
||||
/// 拷贝
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool isOk = false;
|
||||
if (!string.IsNullOrEmpty(this.trUnitWork.SelectedNodeID))
|
||||
{
|
||||
var unitwork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(this.trUnitWork.SelectedNodeID);
|
||||
if (unitwork != null)
|
||||
{
|
||||
Model.WBS_UnitWork newSupUnitWork = new Model.WBS_UnitWork();
|
||||
newSupUnitWork.UnitWorkId = SQLHelper.GetNewID(typeof(Model.WBS_UnitWork));
|
||||
newSupUnitWork.UnitWorkCode = unitwork.UnitWorkCode;
|
||||
newSupUnitWork.UnitWorkName = unitwork.UnitWorkName;
|
||||
newSupUnitWork.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newSupUnitWork.SuperUnitWork = unitwork.SuperUnitWork;
|
||||
BLL.UnitWorkService.AddUnitWork(newSupUnitWork);
|
||||
isOk = true;
|
||||
|
||||
var divisionDivides = BLL.DivisionDivideService.GetDivisionDivideByUnitWorkId(this.trUnitWork.SelectedNodeID);
|
||||
if (divisionDivides != null)
|
||||
{
|
||||
foreach (var item in divisionDivides)
|
||||
{
|
||||
Model.WBS_DivisionDivide newDivisionDivide = new Model.WBS_DivisionDivide();
|
||||
newDivisionDivide.DivisionDivideId = SQLHelper.GetNewID(typeof(Model.WBS_DivisionDivide));
|
||||
newDivisionDivide.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newDivisionDivide.UnitWorkId = newSupUnitWork.UnitWorkId;
|
||||
newDivisionDivide.DivisionId = item.DivisionId;
|
||||
BLL.DivisionDivideService.AddDivisionDivide(newDivisionDivide);
|
||||
isOk = true;
|
||||
}
|
||||
}
|
||||
|
||||
var unitworkList = BLL.UnitWorkService.GetUnitWorksBySupUnitWork(this.trUnitWork.SelectedNodeID);
|
||||
if (unitworkList.Count() > 0)
|
||||
{
|
||||
foreach (var item in unitworkList)
|
||||
{
|
||||
Model.WBS_UnitWork newUnitWork = new Model.WBS_UnitWork();
|
||||
newUnitWork.UnitWorkId = SQLHelper.GetNewID(typeof(Model.WBS_UnitWork));
|
||||
newUnitWork.UnitWorkCode = item.UnitWorkCode;
|
||||
newUnitWork.UnitWorkName = item.UnitWorkName;
|
||||
newUnitWork.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newUnitWork.SuperUnitWork = newSupUnitWork.UnitWorkId;
|
||||
BLL.UnitWorkService.AddUnitWork(newUnitWork);
|
||||
isOk = true;
|
||||
|
||||
var divisionDivideLists = BLL.DivisionDivideService.GetDivisionDivideByUnitWorkId(item.UnitWorkId);
|
||||
if (divisionDivideLists != null)
|
||||
{
|
||||
foreach (var divis in divisionDivideLists)
|
||||
{
|
||||
Model.WBS_DivisionDivide newDivisionDivide = new Model.WBS_DivisionDivide();
|
||||
newDivisionDivide.DivisionDivideId = SQLHelper.GetNewID(typeof(Model.WBS_DivisionDivide));
|
||||
newDivisionDivide.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newDivisionDivide.UnitWorkId = newUnitWork.UnitWorkId;
|
||||
newDivisionDivide.DivisionId = divis.DivisionId;
|
||||
BLL.DivisionDivideService.AddDivisionDivide(newDivisionDivide);
|
||||
isOk = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isOk)
|
||||
{
|
||||
ShowNotify("拷贝成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("拷贝失败!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 修改
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.trUnitWork.SelectedNodeID))
|
||||
{
|
||||
var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(this.trUnitWork.SelectedNodeID);
|
||||
if (unitWork != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../../ProjectData/UnitWorkEdit.aspx?Id={0}&&SuperId={1}", this.trUnitWork.SelectedNode.NodeID, unitWork.SuperUnitWork, "编辑 - ")));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出窗体
|
||||
/// <summary>
|
||||
/// 关闭弹出窗体
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
InitTreeMenu();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
@@ -298,11 +387,12 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
this.btnImport.Hidden = false;
|
||||
this.btnCopy.Hidden = false;
|
||||
this.btnEdit.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user