20230221焊接修改
This commit is contained in:
@@ -54,7 +54,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
|
||||
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
|
||||
{
|
||||
var unit = HJGL_YardPlanningService.GetHJGL_YardPlanningByProjectId(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID);
|
||||
var unit = HJGL_YardPlanningService.GetHJGL_YardPlanningById( tvControlItem.SelectedNodeID);
|
||||
this.imgPhoto.ImageUrl = null;
|
||||
if (unit != null)
|
||||
{
|
||||
@@ -119,7 +119,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
foreach (var q in unitWork1)
|
||||
{
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
|
||||
//int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
|
||||
int a = (from x in Funs.DB.HJGL_YardPlanning where x.SurperId == q.UnitWorkId select x).Count();
|
||||
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
|
||||
TreeNode tn1 = new TreeNode();
|
||||
tn1.NodeID = q.UnitWorkId;
|
||||
@@ -127,24 +128,53 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
tn1.ToolTip = "施工单位:" + u.UnitName;
|
||||
tn1.EnableClickEvent = true;
|
||||
rootNode1.Nodes.Add(tn1);
|
||||
if (a > 0)
|
||||
{
|
||||
BoundTree(tn1.Nodes, tn1.NodeID);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (unitWork2.Count() > 0)
|
||||
{
|
||||
foreach (var q in unitWork2)
|
||||
{
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
|
||||
int a = (from x in Funs.DB.HJGL_YardPlanning where x.SurperId==q.UnitWorkId select x).Count();
|
||||
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
|
||||
TreeNode tn2 = new TreeNode();
|
||||
tn2.NodeID = q.UnitWorkId;
|
||||
// tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
|
||||
tn2.Text = q.UnitWorkName ;
|
||||
tn2.CommandName = "主项";
|
||||
tn2.ToolTip = "施工单位:" + u.UnitName;
|
||||
tn2.EnableClickEvent = true;
|
||||
rootNode2.Nodes.Add(tn2);
|
||||
if (a>0)
|
||||
{
|
||||
BoundTree(tn2.Nodes, tn2.NodeID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BoundTree(TreeNodeCollection nodes, string superId)
|
||||
{
|
||||
var mdoel = BLL.HJGL_YardPlanningService.GetHJGL_YardPlanningBySurperId(superId);
|
||||
foreach (var m in mdoel)
|
||||
{
|
||||
TreeNode chidNode = new TreeNode
|
||||
{
|
||||
Text = m.YardPlanName,
|
||||
NodeID = m.YardPlanningId,
|
||||
Expanded = true,
|
||||
Selectable = true,
|
||||
EnableClickEvent= true,
|
||||
};
|
||||
nodes.Add(chidNode);
|
||||
this.BoundTree(chidNode.Nodes, m.YardPlanningId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 点击TreeView
|
||||
@@ -186,8 +216,6 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
@@ -213,10 +241,10 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
}
|
||||
protected void filePhoto_FileSelected(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
|
||||
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID) && tvControlItem.SelectedNode.CommandName != "主项")
|
||||
{
|
||||
if (filePhoto.HasFile)
|
||||
{
|
||||
{
|
||||
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
|
||||
if (string.IsNullOrEmpty(rootUrl))
|
||||
{
|
||||
@@ -244,19 +272,48 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
imgPhoto.ImageUrl = "~/FileUpload/HJGL_YardPlanning/" + fileName;
|
||||
|
||||
|
||||
HJGL_YardPlanningService.SavePic(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID, "FileUpload/HJGL_YardPlanning/" + fileName);
|
||||
HJGL_YardPlanningService.SavePic( tvControlItem.SelectedNodeID, "FileUpload/HJGL_YardPlanning/" + fileName);
|
||||
// 清空文件上传组件(上传后要记着清空,否则点击提交表单时会再次上传!!)
|
||||
filePhoto.Reset();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请选择一个主项!", MessageBoxIcon.Warning);
|
||||
Alert.ShowInTop("主节点无法上传,请新增节点!", MessageBoxIcon.Warning);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 树点击事件
|
||||
protected void btnMenuAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("YardPlanningEdit.aspx?YardPlanningId={0}&&Type=Add", this.tvControlItem.SelectedNodeID, "增加 - ")));
|
||||
|
||||
}
|
||||
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.tvControlItem.SelectedNode.CommandName == "主项")
|
||||
{
|
||||
ShowNotify("无法修改此节点!", MessageBoxIcon.Warning);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("YardPlanningEdit.aspx?YardPlanningId={0}&&Type=Edit", this.tvControlItem.SelectedNodeID, "增加 - ")));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
BLL.HJGL_YardPlanningService.DleteAllById(this.tvControlItem.SelectedNodeID);
|
||||
|
||||
this.InitTreeMenu();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Tree点击事件
|
||||
/// </summary>
|
||||
@@ -266,7 +323,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
|
||||
{
|
||||
var unit = HJGL_YardPlanningService.GetHJGL_YardPlanningByProjectId(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID);
|
||||
var unit = HJGL_YardPlanningService.GetHJGL_YardPlanningById( tvControlItem.SelectedNodeID);
|
||||
this.imgPhoto.ImageUrl = null;
|
||||
if (unit != null)
|
||||
{
|
||||
@@ -279,162 +336,34 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
this.imgPhoto.ImageUrl = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
protected void btnAttachUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
|
||||
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID)&& tvControlItem.SelectedNode.CommandName!="主项")
|
||||
{
|
||||
var model = HJGL_YardPlanningService.GetHJGL_YardPlanningByProjectId(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID);
|
||||
var model = HJGL_YardPlanningService.GetHJGL_YardPlanningById( tvControlItem.SelectedNodeID);
|
||||
if (model == null)
|
||||
{
|
||||
HJGL_YardPlanningService.SavePic(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID, "");
|
||||
model = HJGL_YardPlanningService.GetHJGL_YardPlanningByProjectId(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID);
|
||||
HJGL_YardPlanningService.SavePic( tvControlItem.SelectedNodeID, "");
|
||||
// model = HJGL_YardPlanningService.GetHJGL_YardPlanningByProjectId(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID);
|
||||
}
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/HJGL_YardPlanning&menuId={1}", model.YardPlanningId, BLL.Const.HJGL_YardPlanningMenuId)));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请选择一个主项!", MessageBoxIcon.Warning);
|
||||
Alert.ShowInTop("主节点无法上传,请新增节点!", MessageBoxIcon.Warning);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
ShowNotify("修改成功!", MessageBoxIcon.Success);
|
||||
this.InitTreeMenu();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//public partial class EmergencyProcess : PageBase
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 项目id
|
||||
// /// </summary>
|
||||
// public string ProjectId
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return (string)ViewState["ProjectId"];
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// ViewState["ProjectId"] = value;
|
||||
// }
|
||||
// }
|
||||
|
||||
// #region 加载
|
||||
// /// <summary>
|
||||
// /// 加载页面
|
||||
// /// </summary>
|
||||
// /// <param name="sender"></param>
|
||||
// /// <param name="e"></param>
|
||||
// protected void Page_Load(object sender, EventArgs e)
|
||||
// {
|
||||
// if (!IsPostBack)
|
||||
// {
|
||||
// ////权限按钮方法
|
||||
// this.GetButtonPower();
|
||||
// this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
// if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId)
|
||||
// {
|
||||
// this.ProjectId = Request.Params["projectId"];
|
||||
// }
|
||||
// // 绑定表格
|
||||
// this.BindGrid();
|
||||
// }
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// #region GV绑定数据
|
||||
// /// <summary>
|
||||
// /// 绑定数据
|
||||
// /// </summary>
|
||||
// void BindGrid()
|
||||
// {
|
||||
// var getEmergencys = (from x in Funs.DB.Emergency_EmergencyProcess
|
||||
// where x.ProjectId == this.ProjectId
|
||||
// select x).ToList();
|
||||
// if (getEmergencys.Count() == 0)
|
||||
// {
|
||||
// var getEEmergencyProcessItems = from x in Funs.DB.Emergency_EmergencyProcess
|
||||
// where x.ProjectId == null
|
||||
// select x;
|
||||
// foreach (var item in getEEmergencyProcessItems)
|
||||
// {
|
||||
// Model.Emergency_EmergencyProcess newItem = new Model.Emergency_EmergencyProcess
|
||||
// {
|
||||
// EmergencyProcessId = SQLHelper.GetNewID(),
|
||||
// ProjectId = this.ProjectId,
|
||||
// ProcessSteps = item.ProcessSteps,
|
||||
// ProcessName = item.ProcessName,
|
||||
// StepOperator = item.StepOperator,
|
||||
// Remark = item.Remark,
|
||||
// };
|
||||
// Funs.DB.Emergency_EmergencyProcess.InsertOnSubmit(newItem);
|
||||
// Funs.DB.SubmitChanges();
|
||||
|
||||
// getEmergencys.Add(item);
|
||||
// }
|
||||
// }
|
||||
|
||||
// Grid1.RecordCount = getEmergencys.Count();
|
||||
// DataTable tb = this.GetPagedDataTable(Grid1, getEmergencys);
|
||||
// Grid1.DataSource = tb;
|
||||
// Grid1.DataBind();
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// #region 编辑
|
||||
// /// <summary>
|
||||
// /// 双击事件
|
||||
// /// </summary>
|
||||
// /// <param name="sender"></param>
|
||||
// /// <param name="e"></param>
|
||||
// protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
// {
|
||||
// this.EditData();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 右键编辑事件
|
||||
// /// </summary>
|
||||
// /// <param name="sender"></param>
|
||||
// /// <param name="e"></param>
|
||||
// protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
// {
|
||||
// this.EditData();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// 编辑数据方法
|
||||
// /// </summary>
|
||||
// void EditData()
|
||||
// {
|
||||
// if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
// {
|
||||
// Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
// return;
|
||||
// }
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EmergencyProcessEdit.aspx?EmergencyProcessId={0}", Grid1.SelectedRowID, "详细 - ")));
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// #region 获取按钮权限
|
||||
// /// <summary>
|
||||
// /// 获取按钮权限
|
||||
// /// </summary>
|
||||
// /// <param name="button"></param>
|
||||
// /// <returns></returns>
|
||||
// void GetButtonPower()
|
||||
// {
|
||||
// if (Request.Params["value"] == "0")
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_YardPlanningMenuId);
|
||||
// if (buttonList.Count() > 0)
|
||||
// {
|
||||
// if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
// {
|
||||
// this.btnMenuEdit.Hidden = false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// #endregion
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user