/// <summary>
        /// 绑定左边列表框
        /// </summary>
        private void BindLeftUser()
        {
            //得到人员
            ViewBase vbUser = null;

            lboxLeft.Items.Clear();
            if (this.tvDB.SelectedNode != null)
            {
                vbUser = OAUser.GetUserByDeptID(this.tvDB.SelectedNode.Value, ConstString.Grade.ZERO);
            }
            if (vbUser != null)
            {
                foreach (FounderSoftware.ADIM.OU.BLL.Busi.User user in vbUser.Ens)
                {
                    string   strPostName = string.Empty;
                    ViewBase vbDeptPost  = user.DeptPosts;
                    if (vbDeptPost != null && vbDeptPost.DtTable != null)
                    {
                        vbDeptPost.Condition = "a.FK_DeptID=" + this.tvDB.SelectedNode.Value;
                        strPostName          = vbDeptPost.DtTable.Rows[0]["PostName"] + " " + vbDeptPost.DtTable.Rows[0]["LeaderManager"];
                    }
                    string show = user.Name + "(" + user.UserID + ")" + " " + strPostName;
                    lboxLeft.Items.Add(new ListItem(show, user.DomainUserID));
                }
                for (int i = 0; i < lboxRight.Items.Count; i++)
                {
                    lboxLeft.Items.Remove(lboxLeft.Items.FindByValue(lboxRight.Items[i].Value));
                }
            }
            else
            {
                JScript.Alert("请点击部门树节点");
            }
        }
        /// <summary>
        /// 设置节点显示
        /// </summary>
        /// <param name="node"></param>
        /// <param name="dr"></param>
        /// <returns></returns>
        private TreeNode SetTreeNode(TreeNode node, DataRow dr)
        {
            TreeNode newNode    = new TreeNode();
            ViewBase vbDeptUser = OAUser.GetUserByDeptID(dr["ID"].ToString(), ConstString.Grade.ZERO);
            string   name       = dr["Name"].ToString();

            if (vbDeptUser != null)
            {
                name += "[" + vbDeptUser.Count.ToString() + "]";
            }

            if (UCDeptShowType != string.Empty)
            {
                string member = GetDeptMember(dr["ID"].ToString())[1];
                if (string.IsNullOrEmpty(member) == false && member.Length > 0)
                {
                    member = "(" + member + ")";
                }
                name += member;
                if (name.Length > 20)
                {
                    name = name.Substring(0, 20) + "...";
                }
                newNode = new TreeNode(name, dr["ID"].ToString());

                //鼠标移上去提示
                newNode.ToolTip = dr["Name"].ToString() + member;

                GetType1();

                if (type4 != "1")
                {
                    if (string.IsNullOrEmpty(member))
                    {
                        newNode.ShowCheckBox = false; //没有成员 不可选择
                    }
                    else
                    {
                        newNode.ShowCheckBox = true;
                    }
                }
            }
            //node.Value=部门主键ID
            else
            {
                newNode = new TreeNode(name, dr["ID"].ToString());
            }
            if (UCShowDeptID != string.Empty)
            {
                if (hasDeptID.Count > 0)
                {
                    if (hasDeptID.Contains(newNode.Value) == false)
                    {
                        newNode.SelectAction = TreeNodeSelectAction.None;//置灰
                        newNode.ShowCheckBox = false;
                    }
                }
            }
            return(newNode);
        }
示例#3
0
        /// <summary>
        /// 绑定左边列表框
        /// </summary>
        private void LoadDeptUser()
        {
            //得到人员
            ViewBase vbUser = null;

            if (this.tvDeptList.SelectedNode != null)
            {
                this.lbxLeft.Items.Clear();
                vbUser = OAUser.GetUserByDeptID(this.tvDeptList.SelectedNode.Value, ConstString.Grade.ALL);
                if (vbUser != null && vbUser.DtTable != null)
                {
                    foreach (FounderSoftware.ADIM.OU.BLL.Busi.User user in vbUser.Ens)
                    {
                        String   strPostName = String.Empty;
                        ViewBase vbDeptPost  = user.DeptPosts;
                        if (vbDeptPost != null && vbDeptPost.DtTable != null)
                        {
                            String strpost = String.Empty;
                            vbDeptPost.Condition = "a.FK_DeptID=" + this.tvDeptList.SelectedNode.Value;
                            foreach (DataRow dr in vbDeptPost.DtTable.Rows)
                            {
                                strpost += dr["PostName"] + " ";
                            }
                            if (vbDeptPost.DtTable.Rows.Count > 0)
                            {
                                strPostName = strpost + " " + vbDeptPost.DtTable.Rows[0]["LeaderManager"];
                            }
                        }
                        String   show = user.Name + "(" + user.UserID + ")" + " " + strPostName;
                        ListItem item = new ListItem(show, user.DomainUserID);
                        if (this.lbxLeft.Items.Contains(item) == false)
                        {
                            this.lbxLeft.Items.Add(item);
                        }
                    }
                    for (int i = 0; i < this.lbxRight.Items.Count; i++)
                    {
                        this.lbxLeft.Items.Remove(this.lbxLeft.Items.FindByValue(this.lbxRight.Items[i].Value));
                    }
                }
            }
        }
        /// <summary>
        /// 实体填充控件
        /// </summary>
        protected override void EntityToControl()
        {
            B_MergeReceiveBase l_objReceiveBase = null;

            //收文登记号
            this.RegisterID = Request.QueryString[ConstString.QueryString.REGISTER_ID];

            if (!String.IsNullOrEmpty(this.RegisterID))
            {
                B_ReceiveEdit l_BusReceiveEdit = new B_ReceiveEdit();
                l_BusReceiveEdit.ID = Convert.ToInt32(this.RegisterID);
                if (l_BusReceiveEdit == null)
                {
                    JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "当前选择的收文登记信息不存在或者已经被删除,无法继续操作", "Container.aspx?ClassName=FS.ADIM.OA.WebUI.WorkflowMenu.ToDoTask.PG_WaitHandle");
                    return;
                }

                //附件列表
                this.ucAttachment.UCDataList = XmlUtility.DeSerializeXml <List <CFuJian> >(l_BusReceiveEdit.FileData);

                //收文号
                this.txtReceiveNo.Text = l_BusReceiveEdit.ReceiveNo;

                //收文日期
                this.txtReceiveDate.Text = l_BusReceiveEdit.ReceiveDate.ToString(ConstString.DateFormat.Normal);

                //原文号
                this.txtSendLetterNo.Text = l_BusReceiveEdit.SendLetterNo;

                //来文单位
                this.txtCommunicationUnit.Text = l_BusReceiveEdit.ReceiveUnit;

                //卷号
                this.txtPreVolumeNo.Text = l_BusReceiveEdit.PreVolumeNo;

                //文件名称
                this.txtDocumentTitle.Text = l_BusReceiveEdit.DocumentTitle;

                //紧急程度
                this.txtUrgentDegree.Text = l_BusReceiveEdit.UrgentDegree;

                //步骤名称
                base.StepName = ProcessConstString.StepName.ReceiveStepName.STEP_INITIAL;

                this.SubTemplateName = l_BusReceiveEdit.ProcessName;

                //党群工作处处长
                OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR);
            }
            else
            {
                l_objReceiveBase = base.EntityData as B_MergeReceiveBase;

                this.SubTemplateName = l_objReceiveBase.TemplateName;

                this.RegisterID = l_objReceiveBase.RegisterID;

                //党群工作处处长
                OAUser.GetUserByRole(this.ddlPoliticalOfficer, OUConstString.RoleName.PARTYS_DIRECTOR);

                ddlPoliticalOfficer.SelectedValue = l_objReceiveBase.Officer;
                txtPoliticalOfficerComment.Text   = l_objReceiveBase.Officer_Comment;

                //附件列表
                this.ucAttachment.UCDataList = l_objReceiveBase.FileList;

                //收文号
                this.txtReceiveNo.Text = l_objReceiveBase.DocumentNo;

                //收文日期
                this.txtReceiveDate.Text = l_objReceiveBase.DocumentReceiveDate.ToString(ConstString.DateFormat.Normal);

                //原文号
                this.txtSendLetterNo.Text = l_objReceiveBase.SendNo;

                //来文单位
                this.txtCommunicationUnit.Text = l_objReceiveBase.CommunicationUnit;

                //卷号
                this.txtPreVolumeNo.Text = l_objReceiveBase.VolumeNo;

                //文件名称
                this.txtDocumentTitle.Text = l_objReceiveBase.DocumentTitle;

                //紧急程度
                this.txtUrgentDegree.Text = l_objReceiveBase.UrgentDegree;

                //发起人ID
                this.txtDrafter.Text = l_objReceiveBase.DrafterID;

                //发起日期
                this.txtDraftDate.Text = l_objReceiveBase.DraftDate.ToString();

                //公司领导
                this.ddlLeadShip.SelectedValue = l_objReceiveBase.LeaderShip;

                //公司批示意见
                this.txtLeadCommentView.Text = l_objReceiveBase.LS_Comment;
                if (base.StepName == ProcessConstString.StepName.ReceiveStepName.STEP_INSTRUCTION)
                {
                    this.txtLeadCommentEdit.Text = l_objReceiveBase.LS_Comment;
                }

                switch (base.StepName)
                {
                case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_DIRECTOR:
                    //获取处室下属科室
                    OADept.GetChildDept(this.ddlUnderTakeSection, l_objReceiveBase.UnderTakeDept, 2);

                    //获取处室下属人员
                    OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeDept, -1);
                    break;

                case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_CHIEF:
                    //获取科室下属人员
                    OAUser.GetUserByDeptID(this.ddlUnderTakePeople, l_objReceiveBase.UnderTakeChief, -1);
                    break;

                case ProcessConstString.StepName.ReceiveStepName.STEP_SECTION_MEMBER:
                    break;
                }

                //承办部门
                this.txtUnderTakeDeptID.Text   = l_objReceiveBase.UnderTakeDept;
                this.txtUnderTakeDeptName.Text = l_objReceiveBase.UnderTakeDeptName;

                //承办科室
                this.ddlUnderTakeSection.SelectedValue = l_objReceiveBase.UnderTakeChief;

                //承办人员
                this.ddlUnderTakePeople.SelectedValue = l_objReceiveBase.UnderTakePeople;

                //承办意见
                this.txtUnderTakeCommentEdit.Text = l_objReceiveBase.UnderTake_Comment;
                this.txtCirculatePeopleName.Text  = l_objReceiveBase.CPeopleName;
                this.txtCirculatePeopleID.Text    = l_objReceiveBase.CPeopleID;
                this.txtCirculateDeptName.Text    = l_objReceiveBase.CDeptName;
                this.txtCirculateDeptID.Text      = l_objReceiveBase.CDeptID;

                //党群工作处处长处理后显示label形式的处长姓名与时间
                if (l_objReceiveBase.DraftDate == DateTime.MinValue)
                {
                    this.ddlPoliticalOfficer.Visible = false;
                    this.lbParty.Visible             = true;
                    this.lbParty.Text = l_objReceiveBase.Officer + strNewLine + l_objReceiveBase.Officer_Date;
                }

                //领导;批示处理后显示label形式的领导人姓名与时间
                if (l_objReceiveBase.LS_Date != "" && l_objReceiveBase.LS_Date != null)
                {
                    this.ddlLeadShip.Visible = false;
                    this.lbLeadShip.Visible  = true;
                    this.lbLeadShip.Text     = l_objReceiveBase.LeaderShipName + strNewLine + l_objReceiveBase.LS_Date;
                }

                //提示信息
                this.txtPrompt.Text = l_objReceiveBase.Prompt;
                if (l_objReceiveBase.IsFormSave)
                {
                    this.txtPromptEdit.Text = l_objReceiveBase.PromptEdit;
                }
            }
        }