20230829 wbs拷贝单位工程下勾选状态
This commit is contained in:
		
							parent
							
								
									24ed5b1c49
								
							
						
					
					
						commit
						77e39c5281
					
				| 
						 | 
					@ -151,9 +151,9 @@
 | 
				
			||||||
            <f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true" Hidden="true" Icon="Pencil"
 | 
					            <f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true" Hidden="true" Icon="Pencil"
 | 
				
			||||||
                runat="server" Text="修改">
 | 
					                runat="server" Text="修改">
 | 
				
			||||||
            </f:MenuButton>          
 | 
					            </f:MenuButton>          
 | 
				
			||||||
            <%--        <f:MenuButton ID="btnMenuCopy" OnClick="btnMenuCopy_Click" EnablePostBack="true"
 | 
					            <f:MenuButton ID="btnMenuCopy" OnClick="btnMenuCopy_Click" EnablePostBack="true" Icon="DatabaseCopy"
 | 
				
			||||||
            runat="server" Text="拷贝" >
 | 
					                runat="server" Text="拷贝">
 | 
				
			||||||
        </f:MenuButton>--%>
 | 
					            </f:MenuButton>
 | 
				
			||||||
            <f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Hidden="true" Icon="Delete"
 | 
					            <f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Hidden="true" Icon="Delete"
 | 
				
			||||||
                ConfirmText="确认删除选中项?" ConfirmTarget="Top" runat="server" Text="删除">
 | 
					                ConfirmText="确认删除选中项?" ConfirmTarget="Top" runat="server" Text="删除">
 | 
				
			||||||
            </f:MenuButton>
 | 
					            </f:MenuButton>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1374,5 +1374,86 @@ namespace FineUIPro.Web.CQMS.WBS
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #region 拷贝单位工程下勾选状态
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 拷贝单位工程下勾选状态
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        /// <param name="sender"></param>
 | 
				
			||||||
 | 
					        /// <param name="e"></param>
 | 
				
			||||||
 | 
					        protected void btnMenuCopy_Click(object sender, EventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (this.trWBS.SelectedNode != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                string unitWorkId = string.Empty;
 | 
				
			||||||
 | 
					                var newUnitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(this.trWBS.SelectedNode.NodeID);
 | 
				
			||||||
 | 
					                if (newUnitWork != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    unitWorkId = newUnitWork.UnitWorkId;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var div = BLL.DivisionProjectService.GetDivisionProjectById(this.trWBS.SelectedNode.NodeID);
 | 
				
			||||||
 | 
					                    if (div != null)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        if (!string.IsNullOrEmpty(div.UnitWorkId))
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            unitWorkId = div.UnitWorkId;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        var div2 = (from x in Funs.DB.WBS_DivisionProject where x.CNProfessionalId != null && x.CNProfessionalId == this.trWBS.SelectedNodeID select x).FirstOrDefault();
 | 
				
			||||||
 | 
					                        if (div2 != null)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            if (!string.IsNullOrEmpty(div2.UnitWorkId))
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                unitWorkId = div2.UnitWorkId;
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        else
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            var nodeId = this.trWBS.SelectedNodeID.Split('|')[0];
 | 
				
			||||||
 | 
					                            var uw = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(nodeId);
 | 
				
			||||||
 | 
					                            if (uw != null)
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                unitWorkId = uw.UnitWorkId;
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                var unitWork = (from x in Funs.DB.WBS_UnitWork
 | 
				
			||||||
 | 
					                                where x.ProjectId == this.CurrUser.LoginProjectId
 | 
				
			||||||
 | 
					                                    && x.UnitWorkId != unitWorkId
 | 
				
			||||||
 | 
					                                select x).FirstOrDefault();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                var oldDivsionProject = (from x in Funs.DB.WBS_DivisionProject
 | 
				
			||||||
 | 
					                                         where x.ProjectId == this.CurrUser.LoginProjectId && x.IsSelected == true
 | 
				
			||||||
 | 
					                                         && x.UnitWorkId == unitWork.UnitWorkId
 | 
				
			||||||
 | 
					                                         select x).ToList();
 | 
				
			||||||
 | 
					                foreach (var item in oldDivsionProject)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var div = Funs.DB.WBS_DivisionProject.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == unitWorkId && x.DivisionCode == item.DivisionCode);
 | 
				
			||||||
 | 
					                    if (div != null)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        div.IsSelected = true;
 | 
				
			||||||
 | 
					                        Funs.DB.SubmitChanges();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        var breakdownProjects = (from x in Funs.DB.WBS_BreakdownProject
 | 
				
			||||||
 | 
					                                                 where x.ProjectId == this.CurrUser.LoginProjectId
 | 
				
			||||||
 | 
					                                                 && x.UnitWorkId == unitWorkId
 | 
				
			||||||
 | 
					                                                 && x.DivisionProjectId == div.DivisionProjectId
 | 
				
			||||||
 | 
					                                                 select x).ToList();
 | 
				
			||||||
 | 
					                        foreach (var b in breakdownProjects)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            b.IsSelected = true;
 | 
				
			||||||
 | 
					                            Funs.DB.SubmitChanges();
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                ShowNotify("拷贝成功", MessageBoxIcon.Success);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        #endregion
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -219,6 +219,15 @@ namespace FineUIPro.Web.CQMS.WBS {
 | 
				
			||||||
        /// </remarks>
 | 
					        /// </remarks>
 | 
				
			||||||
        protected global::FineUIPro.MenuButton btnMenuEdit;
 | 
					        protected global::FineUIPro.MenuButton btnMenuEdit;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// btnMenuCopy 控件。
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        /// <remarks>
 | 
				
			||||||
 | 
					        /// 自动生成的字段。
 | 
				
			||||||
 | 
					        /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
 | 
				
			||||||
 | 
					        /// </remarks>
 | 
				
			||||||
 | 
					        protected global::FineUIPro.MenuButton btnMenuCopy;
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// btnMenuDelete 控件。
 | 
					        /// btnMenuDelete 控件。
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue