public void SetPrintBeginExport(UC_Print ucPrint, B_MergeReceiveBase cEntity) { switch (ucPrint.FileName) { case "党纪工团收文表单": ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>文件名称:|right</col> ucPrint.ExportData.Add(cEntity.DocumentNo); //<col>收文编号:|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DocumentReceiveDate.ToShortDateString())); //<col>收文日期:|right</col> ucPrint.ExportData.Add(cEntity.SendNo); //<col>原文号:|right</col> //ucPrint.ExportData.Add(cEntity.VolumeNo); //<col>卷号:|right</col> //ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.Officer)); //<col>党群工作处处长|right</col> ucPrint.ExportData.Add(cEntity.Officer_Comment); //<col>党群工作处处长意见意见:|right</col> ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.LeaderShip)); //<col>公司领导:|right</col> ucPrint.ExportData.Add(cEntity.LS_Comment); //<col>领导批示:|right</col> ucPrint.ExportData.Add(GetValueByColName("DeptName", cEntity.UnderTakeList)); //ucPrint.ExportData.Add(sDept);//<col>承办部门:|right</col> ucPrint.ExportData.Add(GetValueByColName("Content", cEntity.UnderTakeList)); //<col>承办意见:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("ReceiveUserName", cEntity.CirculateList)); //<col>传阅人员:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("Comment", cEntity.CirculateList)); //<col>传阅意见:|right</col> ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList)); //<col>附件:|down</col> //ucPrint.AttachFileList = cEntity.FileList; //ucPrint.Position = "提示信息:";//(string)ucPrint.ExportData[2]; //ucPrint.Mode = WriteMode.Down; break; } }
/// <summary> /// 全加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddAll_Click(object sender, EventArgs e) { for (int i = 0; i < lboxLeft.Items.Count; i++) { lboxRight.Items.Add(new ListItem(OAUser.GetUserName(lboxLeft.Items[i].Value), lboxLeft.Items[i].Value)); } lboxLeft.ClearSelection(); lboxRight.ClearSelection(); BindLeftUser(); }
/// <summary> /// 绑定到右边列表框 /// </summary> private void BindRight() { if (hUCDeptUserID.Value != String.Empty) { String[] sArrUserID = hUCDeptUserID.Value.Split(';'); foreach (String item in sArrUserID) { this.lbxRight.Items.Add(new ListItem(OAUser.GetUserName(item), item)); } } }
/// <summary> /// 全加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddAll_Click(object sender, EventArgs e) { for (int i = 0; i < lbxLeft.Items.Count; i++) { this.lbxRight.Items.Add(new ListItem(OAUser.GetUserName(this.lbxLeft.Items[i].Value), this.lbxLeft.Items[i].Value)); } this.lbxLeft.ClearSelection(); this.lbxRight.ClearSelection(); this.LoadDeptUser(); this.LoadRoleUser(); }
/// <summary> /// 加选中的人 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddOne_Click(object sender, EventArgs e) { if (UCIsSingle)//如果是单选 { this.lbxRight.Items.Clear(); } int[] iSelected = this.lbxLeft.GetSelectedIndices(); for (int i = 0; i < iSelected.Length; i++) { this.lbxRight.Items.Add(new ListItem(OAUser.GetUserName(this.lbxLeft.Items[iSelected[i]].Value), this.lbxLeft.Items[iSelected[i]].Value)); } this.lbxLeft.ClearSelection(); this.lbxRight.ClearSelection(); this.LoadDeptUser(); this.LoadRoleUser(); }
/// <summary> /// 获取用户状态 /// </summary> /// <param name="userID"></param> /// <param name="status"></param> /// <returns></returns> protected String GetUserSatus(String userID, String status) { if (userID.Contains(@"\")) { userID = userID.Substring(userID.IndexOf(@"\") + 1, userID.Length - userID.IndexOf(@"\") - 1); if (userID.LastIndexOf(":") > -1) { userID = userID.Substring(0, userID.Length - 1); } } String userName = ""; userName = OAUser.GetUserName(userID); return(userName + " " + GetCNStatus(status)); }
private void SetBaseExportData(UC_Print ucPrint, EntitySend cEntity) { //ucPrint.AttachFileList = cEntity.FileList; //ucPrint.Position = "抄送:";//(string)ucPrint.ExportData[2]; //ucPrint.Mode = WriteMode.Right; ucPrint.ExportData.Add(cEntity.UrgentDegree); //<col>紧急程度:|right</col> ucPrint.ExportData.Add(cEntity.DocumentNo); //<col>发文号:|right</col> ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.Signer)); //<col>签发:|right</col> ucPrint.ExportData.Add(cEntity.LeadSigners); //<col>会签人:|right</col> ucPrint.ExportData.Add(cEntity.DeptSigners); //<col>会签人: |right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.SignDate.ToShortDateString())); //<col>日期:|right</col> ucPrint.ExportData.Add(cEntity.Verifier); //<col>秘书:|right</col> if (ucPrint.UCStepName == "审稿") { ucPrint.ExportData.Add(""); } else { ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.VerifyDate.ToShortDateString())); //<col>日期: |right</col> } ucPrint.ExportData.Add(cEntity.ZhuRenSigner); //<col>主任:|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ZhuRenSignDate.ToShortDateString())); //<col>日期: |right</col> ucPrint.ExportData.Add(cEntity.CheckDrafterName); //<col>审稿人:|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.CheckDate.ToShortDateString())); //<col>审稿日期:|right</col> ucPrint.ExportData.Add(/*OADept.GetDeptName(*/ cEntity.HostDeptName /*)*/); //<col>主办部门:|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString())); //<col>拟稿日期:|right</col> ucPrint.ExportData.Add(cEntity.Drafter); //<col>拟稿人:|right</col> ucPrint.ExportData.Add(cEntity.PhoneNum); //<col>电话:|right</col> ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>标题:|right</col> ucPrint.ExportData.Add(cEntity.SubjectWord); //<col>主题词:|right</col> ucPrint.ExportData.Add(cEntity.MainSenders); //<col>主送:|right</col> ucPrint.ExportData.Add(cEntity.CopySenders); //<col>抄送:|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString())); //<col>发文日期:|right</col> ucPrint.ExportData.Add(Convert.ToString(cEntity.ShareCount > 0 ? cEntity.ShareCount : 0)); //<col>共印|right</col> ucPrint.ExportData.Add(Convert.ToString(cEntity.SheetCount > 0 ? cEntity.SheetCount : 0)); //<col>份,每份|right</col> ucPrint.ExportData.Add(cEntity.Typist); //<col>打字:|right</col> ucPrint.ExportData.Add(cEntity.Checker); //<col>校对:|right</col> ucPrint.ExportData.Add(cEntity.ReChecker); //<col>复核:|right</col> //ucPrint.ExportData.Add(cEntity.Prompt);//<col>提示信息:|right</col> //ucPrint.ExportData.Add(cEntity.Prompt);//<col>添加|right</col> }
public void SetPrintBeginExport(UC_Print ucPrint, B_GS_WorkItems cEntity) { switch (ucPrint.FileName) { case "公文处理单": ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>收文标题:|right</col>chen ucPrint.ExportData.Add(cEntity.DocumentNo); //<col>收文编号|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ReceiveDateTime.ToShortDateString())); //<col>收文日期|right</col> ucPrint.ExportData.Add(cEntity.SendNo); //<col>原文号|right</col> string sName = OAUser.GetUserName(cEntity.OfficerName); string sResult = (string.IsNullOrEmpty(sName) ? cEntity.OfficerName : sName); ucPrint.ExportData.Add((string.IsNullOrEmpty(sResult) ? "" : "[" + sResult + "]") + cEntity.Officer_Date.ToString() + cEntity.Officer_Comment); //<col>公司办拟办意见:|right</col> sName = OAUser.GetUserName(cEntity.LeaderShipName); sResult = (string.IsNullOrEmpty(sName) ? cEntity.LeaderShipName : sName); ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.LeaderShip)); //<col>公司领导:|right</col> ucPrint.ExportData.Add((string.IsNullOrEmpty(sResult) ? "" : "[" + sResult + "]") + cEntity.LS_Date.ToString() + cEntity.LS_Comment); //<col>领导批示|right</col> //string[] sUnderTakeList = GetValueByColName("Content", cEntity.UnderTakeList).Split(new char[] { ';' }); ucPrint.ExportData.Add(GetValueByColName("DeptName", cEntity.UnderTakeList)); //<col>承办部门:|right</col> ucPrint.ExportData.Add(GetValueByColName("Content", cEntity.UnderTakeList)); //<col>承办情况:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("ReceiveUserName", cEntity.CirculateList)); //<col>传阅人员:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("Comment", cEntity.CirculateList)); //<col>传阅意见:|right</col> //if (sUnderTakeList.Length > 0) //{ // ucPrint.ExportData.Add(sUnderTakeList[0]); //<col>承办情况|right</col> //} //else //{ // ucPrint.ExportData.Add(GetValueByColName("Content", cEntity.UnderTakeList)); //} //<col>传阅签名|right</col> //<col>日期|right</col> //<col>传阅签名 |right</col> //<col>日期 |right</col> //ucPrint.ExportData.Add(cEntity.); //ucPrint.ExportData.Add(cEntity.Content); //ucPrint.ExportData.Add(cEntity.UndertakeCircs); //ucPrint.ExportData.Add(cEntity.DeptPrincipal); //ucPrint.ExportData.Add(cEntity.DeptPrincipal); //ucPrint.ExportData.Add(cEntity.Department); //ucPrint.ExportData.Add("共" + "()" + "页"); //ucPrint.ExportData.Add("第" + "()" + "页"); //ucPrint.AttachFileList = cEntity.FileList;//chen ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList)); //<col>附件:|down</col> //ucPrint.Position = "日期 ";//(string)ucPrint.ExportData[2]; //ucPrint.Mode = WriteMode.Down; break; case "公司收文表单": ucPrint.ExportData.Add(cEntity.DocumentNo); //<col>收文编号:|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DocumentReceiveDate.ToShortDateString())); //<col>收文日期:|right</col> ucPrint.ExportData.Add(cEntity.SendNo); //<col>原文号:|right</col> ucPrint.ExportData.Add(cEntity.VolumeNo); //<col>卷号:|right</col> ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>文件名称:|right</col> ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.Officer)); //<col>公司办主任|right</col> ucPrint.ExportData.Add(cEntity.Officer_Comment); //<col>意见:|right</col> ucPrint.ExportData.Add(OAUser.GetUserName(cEntity.LeaderShip)); //<col>公司领导:|right</col> ucPrint.ExportData.Add(cEntity.LS_Comment); //<col>意见:|right</col> ucPrint.ExportData.Add(GetValueByColName("DeptName", cEntity.UnderTakeList)); //ucPrint.ExportData.Add(sDept);//<col>承办部门:|right</col> ucPrint.ExportData.Add(GetValueByColName("Content", cEntity.UnderTakeList)); //<col>承办意见:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("ReceiveUserName", cEntity.CirculateList)); //<col>传阅人员:|right</col> ucPrint.ExportData.Add(GetValueByColNameEx("Comment", cEntity.CirculateList)); //<col>传阅意见:|right</col> ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList)); //ucPrint.AttachFileList = cEntity.FileList; //ucPrint.Position = "提示信息:";//(string)ucPrint.ExportData[2]; //ucPrint.Mode = WriteMode.Down; break; } }
/// <summary> /// 控件填充实体 /// </summary> /// <param name="IsSave">是否保存</param> /// <returns>EntityBase</returns> protected override EntityBase ControlToEntity(bool IsSave) { EntityLetterSend entity = null; entity = base.EntityData != null ? base.EntityData as EntityLetterSend : new EntityLetterSend(); entity.DocumentTitle = txtSubject.Text; entity.ccCompany = txtccCompany.Text; entity.company = txtCompany.Text; entity.company1 = txtCompany.Text; //entity.content = SysString.TextToHtmlCode(txtContent.Text); entity.content = txtContent.Text; entity.pages = txtPages.Text; entity.subject = txtSubject.Text; entity.title = txtTitle.Text; entity.to = txtTo.Text; entity.yourRef = txtYourRef.Text; entity.jinJi = chkJinJi.Checked; entity.UrgentDegree = chkJinJi.Checked ? ConstString.CommonStr.Urgent : ConstString.CommonStr.Normal; entity.huiZhi = chkHuiZhi.Checked; entity.ccDept = txtccDept.Text; entity.ccDeptIDs = this.txtccDeptIDs.Text; entity.ccLeader = txtccLeader.Text; entity.companyID = txtCompanyID.Text; //流程数据和隐藏数据 entity.deptLeaderIDs = txtDeptLeaderIDs.Text; entity.ccLeaderIDs = txtccLeaderIDs.Text; entity.wfChuanYueRenIDs = wfChuanYueRenIDs.Text; if (wfChuanYueRenIDs.Text != "") { string[] strCYarr = wfChuanYueRenIDs.Text.Split(';'); for (int i = 0; i < strCYarr.Length; i++) { ChuanYues cy = new ChuanYues(); bool isHas = false; for (int j = 0; j < entity.chuanyues.Count; j++) { if (entity.chuanyues[j].UserID.ToLower() == strCYarr[i].ToLower()) { isHas = true; } } if (!isHas) { cy.UserID = strCYarr[i]; cy.UserName = OAUser.GetUserName(strCYarr[i]); cy.Date = DateTime.Now.ToShortDateString(); entity.chuanyues.Add(cy); } } } //附件数据绑定 entity.FileList = this.ucAttachment.UCDataList; //函件类型 entity.hanJian1 = drpHanJian.SelectedItem == null ? "" : drpHanJian.SelectedItem.Text; entity.hanJianID1 = drpHanJian.SelectedValue == null ? "" : drpHanJian.SelectedValue; //add entity.equipmentCode1 = this.txtEquipmentCode.Text; entity.contractNo1 = this.txtContractNo.Text; //意见 if (IsSave == false) { entity.isSave = false; CYiJian so = new CYiJian(); so.UserID = entity.ReceiveUserID == string.Empty ? CurrentUserInfo.UserName : entity.ReceiveUserID; so.UserName = entity.ReceiveUserName == string.Empty ? CurrentUserInfo.DisplayName : entity.ReceiveUserName; so.ViewName = base.StepName; so.FinishTime = DateTime.Now.ToString(); so.Content = "(" + base.SubAction + ")" + txtComment.Text; entity.yiJian.Add(so); } else { entity.isSave = true; entity.syiJian = txtComment.Text; } switch (base.StepName) { case ProcessConstString.StepName.LetterSend.发起函件: //核稿 entity.heGaoRen = txtHeGaoRen.Text; entity.wfHeGaoRenID = wfHeGaoRenID.Text; //会签 entity.huiQianRen = txtHuiQianRen.Text; entity.wfHuiQianRenIDs = wfHuiQianRenIDs.Text; //签发 entity.qianFaRen = txtQianFaRen.Text; entity.wfQianFaRenID = wfQianFaRenID.Text; if (txtNiGaoRenDate.Text.Trim() == "") //不是第一次 { //发起人 if (IsSave == false) { entity.UserDate = DateTime.Now.ToString(); entity.niGaoRenDate = (entity.niGaoRenDate == string.Empty ? CurrentUserInfo.DisplayName : entity.ReceiveUserName) + " " + entity.UserDate; entity.DraftDate = SysConvert.ToDateTime(entity.UserDate); } if (entity.Drafter == string.Empty) { entity.Drafter = CurrentUserInfo.DisplayName; entity.DrafterID = CurrentUserInfo.UserName; entity.wfFaQiRenID = CurrentUserInfo.UserName; } } if (base.SubAction == "提交会签" || base.SubAction == "提交签发") //如果是被退回的 再次提交会签 不经过核稿 则清空核稿人和核稿日期 { if (IsSave == false && base.WorkItemID != "" && base.IsFromDraft == false) { entity.heGaoRen = ""; entity.heGaoRenDate = ""; entity.wfHeGaoRenID = ""; entity.heGaoYiJian = ""; } else { entity.heGaoRen = txtHeGaoRen.Text; entity.wfHeGaoRenID = wfHeGaoRenID.Text; } } if (base.SubAction == "提交签发") //如果是被退回的 再次提交签发 不经过会签 则清空会签人和会签日期 { if (IsSave == false && base.WorkItemID != "" && base.IsFromDraft == false) { entity.huiqianDates = ""; entity.huiQianRen = ""; entity.huiQian.Clear(); } } //发文部门 entity.sendDept1 = drpSendDept.SelectedItem == null ? "" : drpSendDept.SelectedItem.Text; entity.sendDeptID1 = drpSendDept.SelectedValue; //是否会签驳回 entity.isHuiQianBoHui = false; if (base.SubAction == "提交会签") { entity.iHuiQianCount = entity.iHuiQianCount + 1; } break; case ProcessConstString.StepName.LetterSend.核稿: //核稿 entity.heGaoRen = entity.ReceiveUserName; if (IsSave == false) { entity.heGaoRenDate = DateTime.Now.ToString(); } entity.heGaoYiJian = txtComment.Text; //会签 entity.huiQianRen = txtHuiQianRen.Text; entity.wfHuiQianRenIDs = wfHuiQianRenIDs.Text; //签发 entity.qianFaRen = txtQianFaRen.Text; entity.wfQianFaRenID = wfQianFaRenID.Text; if (base.SubAction == "提交会签") { entity.iHuiQianCount = entity.iHuiQianCount + 1; } if (base.SubAction == "提交签发") //如果是被核稿退回的 再次提交签发 不经过会签 则清空会签人和会签日期 { if (IsSave == false && base.WorkItemID != "" && base.IsFromDraft == false) { entity.huiqianDates = ""; entity.huiQianRen = ""; entity.huiQian.Clear(); } } break; case ProcessConstString.StepName.LetterSend.会签: if (IsSave == false) { if (entity.huiqianDates == "") { entity.huiqianDates = entity.ReceiveUserName + " " + DateTime.Now.ToString(DateFormat); } else { entity.huiqianDates = entity.huiqianDates + ";" + entity.ReceiveUserName + " " + DateTime.Now.ToString(DateFormat); } HanJianHuiQian hjhq = new HanJianHuiQian(); hjhq.UserID = entity.ReceiveUserID; hjhq.UserName = entity.ReceiveUserName; hjhq.Date = DateTime.Now; hjhq.YiJian = txtComment.Text; hjhq.ICount = entity.iHuiQianCount; entity.huiQian.Add(hjhq); } //签发 entity.qianFaRen = txtQianFaRen.Text; entity.wfQianFaRenID = wfQianFaRenID.Text; if (base.SubAction == "退回") { entity.isHuiQianBoHui = true; } break; case ProcessConstString.StepName.LetterSend.签发: if (IsSave == false) { if (base.SubAction != "退回") { entity.signDate = DateTime.Now.ToString(DateFormat); } } entity.HanJianAdminID = OAUser.GetUserByRoleName("函件管理员")[0]; entity.HanJianAdmin = OAUser.GetUserByRoleName("函件管理员")[1]; break; case ProcessConstString.StepName.LetterSend.函件分发: entity.ourRef = txtOurRef.Text; entity.DocumentNo = txtOurRef.Text; break; case ProcessConstString.StepName.LetterSend.二次分发: break; default: break; } return(entity); }
private string GetUserName(string userID) { return(OAUser.GetUserName(userID) + " " + userID); }
/// <summary> /// 确定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOK_Click(object sender, EventArgs e) { #region 获得部门ID和Name String deptID = String.Empty; String deptName = String.Empty; ArrayList arrCheckedDeptID = new ArrayList(); foreach (TreeNode node in this.tvDeptList.CheckedNodes) { arrCheckedDeptID.Add(node.Value); } if (arrCheckedDeptID.Count > 0) { foreach (object o in arrCheckedDeptID) { if (o.ToString() != String.Empty) { deptID += ";" + o.ToString(); deptName += ";" + OADept.GetDeptName(o.ToString()); } } if (deptID.Length > 0) { deptID = deptID.Substring(1); } if (deptName.Length > 0) { deptName = deptName.Substring(1); } } #endregion #region 获得部门成员ID和Name String deptUserID = String.Empty; String deptUserName = String.Empty; ArrayList arrDeptUserName = new ArrayList(); ArrayList arrDeptUserID = new ArrayList(); foreach (ListItem item in lbxRight.Items) { arrDeptUserID.Add(item.Value); arrDeptUserName.Add(OAUser.GetUserName(item.Value)); } //帐号 deptUserID = base.GetStringText(arrDeptUserID).Replace(@"\", @"\\"); //姓名 deptUserName = base.GetStringText(arrDeptUserName); #endregion #region 获得角色成员ID和Name String roleUserID = String.Empty; String roleUserName = String.Empty; ArrayList arrRoleUserName = new ArrayList(); ArrayList arrRoleUserID = new ArrayList(); foreach (ListItem item in chkRole.Items) { if (item.Selected) { arrRoleUserID.Add(item.Value); arrRoleUserName.Add(item.Text); } } //帐号 roleUserID = base.GetStringText(arrRoleUserID).Replace(@"\", @"\\"); //姓名 roleUserName = base.GetStringText(arrRoleUserName); #endregion #region 获得部门树上成员ID和Name String deptTreeUserID = String.Empty; String deptTreeUserName = String.Empty;//用户名字 String[] strUsers = new String[2]; GetType1(); if (UCDeptTreeUserIDControl != String.Empty || UCDeptTreeUserNameControl != String.Empty) { if (this.type1 == "1" || this.type2 == "1" || this.type3 == "1") { foreach (String deptid in arrCheckedDeptID) { strUsers = this.GetDeptMember(deptid); if (strUsers[0] != null && strUsers[1] != null) { deptTreeUserID += ";" + strUsers[0]; deptTreeUserName += ";" + strUsers[1]; } } if (deptTreeUserName.Length > 0) { deptTreeUserName = FormsMethod.FilterRepeat(deptTreeUserName.Substring(1)); } if (deptTreeUserID.Length > 0) { deptTreeUserID = FormsMethod.FilterRepeat(deptTreeUserID.Substring(1)).Replace(@"\", @"\\"); } } } #endregion #region 获得角色组的名称 string strGroupName = string.Empty; foreach (TreeNode node in this.tvRoleList.CheckedNodes) { strGroupName += ";" + node.Text; } if (strGroupName.Length > 0) { strGroupName = strGroupName.Substring(1); } #endregion #region 获得回传脚本 String script = String.Empty; if (UCDeptIDControl != String.Empty) { script += base.GetJSscriptValue(UCDeptIDControl, deptID); } if (UCDeptNameControl != String.Empty) { script += base.GetJSscriptValue(UCDeptNameControl, deptName); script += base.GetJSscriptTitle(UCDeptNameControl, deptID); } if (UCDeptUserIDControl != String.Empty) { script += base.GetJSscriptValue(UCDeptUserIDControl, deptUserID); } if (UCDeptUserNameControl != String.Empty) { script += base.GetJSscriptValue(UCDeptUserNameControl, deptUserName); script += base.GetJSscriptTitle(UCDeptUserNameControl, deptUserID); } if (UCRoleUserIDControl != String.Empty) { script += base.GetJSscriptValue(UCRoleUserIDControl, roleUserID); } if (UCRoleUserNameControl != String.Empty) { script += base.GetJSscriptValue(UCRoleUserNameControl, roleUserName); script += base.GetJSscriptTitle(UCRoleUserNameControl, roleUserID); } if (UCDeptTreeUserIDControl != String.Empty) { script += base.GetJSscriptValue(UCDeptTreeUserIDControl, deptTreeUserID); } if (UCDeptTreeUserNameControl != String.Empty) { script += base.GetJSscriptValue(UCDeptTreeUserNameControl, deptTreeUserName); script += base.GetJSscriptTitle(UCDeptTreeUserNameControl, deptTreeUserID); } //如果是部门和人员选到一个文本框上 if (this.UCDeptAndUserControl != String.Empty) { String strDeptAndUser = String.Empty; if (deptName != String.Empty) { strDeptAndUser += deptName; } if (deptUserName != String.Empty) { if (strDeptAndUser != String.Empty) { strDeptAndUser += ";"; } strDeptAndUser += deptUserName; } if (strGroupName != string.Empty) { if (strDeptAndUser != string.Empty) { strDeptAndUser += ";"; } strDeptAndUser += strGroupName; } script += base.GetJSscriptValue(UCDeptAndUserControl, strDeptAndUser); } script += String.Format("parent.ClosePopDiv('{0}')", base.divPopDivID + base.UCID); #endregion //组成一整条js后运行 ClientScriptM.ResponseScript(this, script); }
/// <summary> /// 确定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOK_Click(object sender, EventArgs e) { #region 获得部门ID和Name string deptID = string.Empty; //部门id string deptName = string.Empty; ArrayList arrCheckedDeptID = new ArrayList(); foreach (TreeNode node in tvDB.CheckedNodes) { arrCheckedDeptID.Add(node.Value); } if (arrCheckedDeptID.Count > 0) { foreach (object o in arrCheckedDeptID) { if (o.ToString() != string.Empty) { deptID += ";" + o.ToString(); deptName += ";" + OADept.GetDeptName(o.ToString()); } } if (deptID.Length > 0) { deptID = deptID.Substring(1); } if (deptName.Length > 0) { deptName = deptName.Substring(1); } } #endregion #region 获得部门成员ID和Name string deptUserID = string.Empty; string deptUserName = string.Empty;//用户名字 ArrayList arrDeptUserName = new ArrayList(); ArrayList arrDeptUserID = new ArrayList(); foreach (ListItem item in lboxRight.Items) { arrDeptUserID.Add(item.Value); arrDeptUserName.Add(OAUser.GetUserName(item.Value)); } //帐号 deptUserID = GetStringText(arrDeptUserID).Replace(@"\", @"\\"); //姓名 deptUserName = GetStringText(arrDeptUserName); #endregion //#region 获得角色成员ID和Name //string roleUserID = string.Empty; //string roleUserName = string.Empty; //角色用户名 //ArrayList arrRoleUserName = new ArrayList(); //ArrayList arrRoleUserID = new ArrayList(); //foreach (ListItem item in chkRole.Items) //{ // if (item.Selected) // { // arrRoleUserID.Add(item.Value); // arrRoleUserName.Add(item.Text); // } //} ////帐号 //roleUserID = base.GetStringText(arrRoleUserID).Replace(@"\", @"\\"); ////姓名 //roleUserName = base.GetStringText(arrRoleUserName); //#endregion #region 获得部门树上成员ID和Name string deptTreeUserID = string.Empty; string deptTreeUserName = string.Empty;//用户名字 string[] strUsers = new string[2]; GetType1(); if (UCDeptTreeUserIDControl != string.Empty || UCDeptTreeUserNameControl != string.Empty) { foreach (string deptid in arrCheckedDeptID) { strUsers = this.GetDeptMember(deptid); deptTreeUserID += ";" + strUsers[0]; deptTreeUserName += ";" + strUsers[1]; } if (deptTreeUserName.Length > 0) { deptTreeUserName = deptTreeUserName.Substring(1); } if (deptTreeUserID.Length > 0) { deptTreeUserID = deptTreeUserID.Substring(1).Replace(@"\", @"\\"); } } #endregion #region 获得回传脚本 string script = string.Empty; ////1 //if (UCDeptIDControl != string.Empty) //{ // script += base.GetJSscriptValue(UCDeptIDControl, deptID); //} //if (UCDeptNameControl != string.Empty) //{ // script += base.GetJSscriptValue(UCDeptNameControl, deptName); // script += base.GetJSscriptTitle(UCDeptNameControl, deptID); //} //2 if (UCDeptUserIDControl != string.Empty) { //script += base.GetJSscriptValue(UCDeptUserIDControl, deptUserID); } if (UCDeptUserNameControl != string.Empty) { //script += base.GetJSscriptValue(UCDeptUserNameControl, deptUserName); //script += base.GetJSscriptTitle(UCDeptUserNameControl, deptUserID); } ////3 //if (UCRoleUserIDControl != string.Empty) //{ // script += base.GetJSscriptValue(UCRoleUserIDControl, roleUserID); //} //if (UCRoleUserNameControl != string.Empty) //{ // script += base.GetJSscriptValue(UCRoleUserNameControl, roleUserName); // script += base.GetJSscriptTitle(UCRoleUserNameControl, roleUserID); //} if (UCDeptTreeUserIDControl != string.Empty) { //script += base.GetJSscriptValue(UCDeptTreeUserIDControl, deptTreeUserID); } if (UCDeptTreeUserNameControl != string.Empty) { //script += base.GetJSscriptValue(UCDeptTreeUserNameControl, deptTreeUserName); //script += base.GetJSscriptTitle(UCDeptTreeUserNameControl, deptTreeUserID); } //如果是部门和人员选到一个文本框上 if (this.UCDeptAndUserControl != string.Empty) { string strDeptAndUser = string.Empty; if (deptName != string.Empty) { strDeptAndUser += deptName; } if (deptUserName != string.Empty) { if (strDeptAndUser != string.Empty) { strDeptAndUser += ";"; } strDeptAndUser += deptUserName; } //script += base.GetJSscriptValue(this.UCDeptAndUserControl, strDeptAndUser); } //script += string.Format("parent.ClosePopDiv('{0}')", base.divPopDivID + base.UCID); #endregion //组成一整条js后运行 //ClientScriptM.ResponseScript(this, script); JScript.Alert(deptUserID + "," + deptUserName, true); }
/// <summary> /// 加选中的人 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddOne_Click(object sender, EventArgs e) { int[] iSelected = lboxLeft.GetSelectedIndices(); List <B_WFAgent> enList2 = new List <B_WFAgent>(); if (iSelected.Length == 0) { JScript.Alert("请选择人员。", true); return; } else { for (int i = 0; i < iSelected.Length; i++) { if (lboxLeft.Items[iSelected[i]].Value == CurrentUserInfo.UserName) { JScript.Alert("不能选择自己为代理人。", true); return; } if (B_WFAgent.IsUse(lboxLeft.Items[iSelected[i]].Value, CurrentUserInfo.UserName)) { JScript.Alert(lboxLeft.Items[iSelected[i]].Text + " 已被他人设为代理人,请选择其他人员进行代理。", true); return; } } foreach (ListItem itm in this.lboxRight.Items) { B_WFAgent entity = new B_WFAgent(); entity.AgentUserID = itm.Value; entity.OperateUserID = CurrentUserInfo.UserName; enList2.Add(entity); } if (UCIsSingle)//如果是单选 { lboxRight.Items.Clear(); } } List <B_WFAgent> enList = new List <B_WFAgent>(); for (int i = 0; i < iSelected.Length; i++) { lboxRight.Items.Add(new ListItem(OAUser.GetUserName(lboxLeft.Items[iSelected[i]].Value), lboxLeft.Items[iSelected[i]].Value)); B_WFAgent entity = new B_WFAgent(); entity.AgentUserID = lboxLeft.Items[iSelected[i]].Value; entity.OperateUserID = CurrentUserInfo.UserName; enList.Add(entity); } if (enList.Count > 0) { B_WFAgent bllAgent = new B_WFAgent(); if (!bllAgent.IsAddAgentSuc(enList, enList2)) { JScript.Alert(ConstString.PromptInfo.ACTION_OPERATE_FAIL, true); return; } else { lboxLeft.ClearSelection(); lboxRight.ClearSelection(); BindLeftUser(); JScript.Alert("添加成功。", true); } } }