/// <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 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); }
public void SetPrintBeginExport(UC_Print ucPrint, B_PF cEntity) { switch (ucPrint.FileName) { case "程序文件表单": SetBaseExportData(ucPrint, cEntity); ucPrint.ExportData.Add(cEntity.CirculateSignDept); //<col>部门:|inner</col> ucPrint.ExportData.Add(cEntity.CirculateSignUserName); //<col>人员:|inner</col> ucPrint.ExportData.Add(cEntity.CirculateDeptName); //<col>部门: |inner</col> ucPrint.ExportData.Add(cEntity.CirculateName); //<col>人员: |inner</col> ucPrint.ExportData.Add(cEntity.CirculateComment); //<col>意见:|right</col> ucPrint.ExportData.Add(ucPrint.AttachFilesList(cEntity.FileList)); //<col>附件:|down</col> break; case "管理程序变更申请表": if (cEntity.ProgramSort == "管理程序") { ucPrint.ExportData.Add("管理程序变更申请表"); //<col>管理程序变更申请表|shift</col> ucPrint.ExportData.Add("HN-LL431"); //<col>HN-LL431|shift</col> } if (cEntity.ProgramSort == "工作程序") { ucPrint.ExportData.Add("工作程序变更申请表"); //<col>管理程序变更申请表|shift</col> ucPrint.ExportData.Add("HN-LL432"); //<col>HN-LL431|shift</col> } if (cEntity.ProgramSort == "部门级管理程序") { ucPrint.ExportData.Add("管理程序变更申请表"); //<col>管理程序变更申请表|shift</col> ucPrint.ExportData.Add("HN-LL433"); //<col>HN-LL431|shift</col> } ucPrint.ExportData.Add(string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year); //<col>年份|shift</col> /*待定*/ ucPrint.ExportData.Add(cEntity.SerialID); //<col>序号|shift</col> ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>文件名称|right</col> ucPrint.ExportData.Add(cEntity.ProgramCode + " , " + cEntity.Edition); //<col>编码版本|right</col> ucPrint.ExportData.Add(OADept.GetDeptName(cEntity.SendDeptID)); //<col>申请部门|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString())); //<col>申请日期|right</col> ucPrint.ExportData.Add(cEntity.ApplyStyle); //<col>申请类型|right</col> //ucPrint.ExportData.Add(cEntity.ApplyReason); //<col>原因:|inner</col> //ucPrint.ExportData.Add(cEntity.RelationProgram/*RelationDemand*/); //<col>可能受到影响的程序:|inner</col> ucPrint.ExportData.Add(cEntity.Drafter); //<col>申请人姓名|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString())); //<col>日期|right</col> ucPrint.ExportData.Add(OAUser.GetDeptManager(cEntity.SendDeptID, ConstString.Grade.ZERO)); //<col>编制部门负责人姓名|right</col> //M_20100414 huangqi des:编写时间改为FirstDraftDate //begin if (cEntity.FirstDraftDate != DateTime.MinValue) { ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.FirstDraftDate.ToShortDateString())); //<col>日期 |right</col> } else { ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString())); } //end //ucPrint.ExportData.Add(cEntity.QualityApproveComment //PF.GetNotionComment(cEntity.ProcessID, ConstString.ProcessStepName.PROGRAM_QUALITY)*/); //<col>意见:|inner</col> ucPrint.ExportData.Add(cEntity.AuditName); //<col>审核人姓名|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.AuditDate.ToShortDateString())); //<col>日期 |right</col> ucPrint.ExportData.Add(cEntity.QualityNames); //<col>质保处负责人姓名|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.QualityDate.ToShortDateString())); //<col>日期 |right</col> ucPrint.ExportData.Add("该程序已经更新发布"); //<col>网页更新结果:|inner</col> /*待定*/ ucPrint.ExportData.Add("" /*OAList.GetUserNameByWorkItemID(cEntity.WorkItemID)*/); //<col>信息文档处操作人姓名|right</col> //ucPrint.ExportData.Add(string.IsNullOrEmpty(cEntity.SendDate.ToShortDateString()) ? // DateTime.Now.ToShortDateString() : ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString()) // ); //<col>日期 |right</col> ucPrint.ExportData.Add(string.IsNullOrEmpty(ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString())) ? DateTime.Now.ToShortDateString() : ucPrint.CheckDateTime(cEntity.SendDate.ToShortDateString())); //<col>日期 |right</col> ucPrint.AttachFileList = cEntity.FileList; ucPrint.Position = "可能受到影响的程序:";//(string)ucPrint.ExportData[2]; ucPrint.Mode = WriteMode.Up; break; case "管理程序封面模板": if (cEntity.ProgramSort == "管理程序") { ucPrint.ExportData.Add("管理程序"); //<col>管理程序|shift</col> //ucPrint.ExportData.Add("HN-LL431-" + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID); //<col>HN编码:|right</col> } if (cEntity.ProgramSort == "工作程序") { ucPrint.ExportData.Add("工作程序"); //<col>管理程序|shift</col> //ucPrint.ExportData.Add("HN-LL432-" + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID); //<col>HN编码:|right</col> cEntity.QualityNames = ""; } if (cEntity.ProgramSort == "部门级管理程序") { ucPrint.ExportData.Add("管理程序"); //<col>管理程序|shift</col> //ucPrint.ExportData.Add("HN-LL433-" + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID); //<col>HN编码:|right</col> } ucPrint.ExportData.Add(cEntity.ProgramCode); ucPrint.ExportData.Add(cEntity.Edition); //<col>版次:|right</col> ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>程序名称|shift</col> if (cEntity.ApproveDate.ToShortDateString() == DateTime.MinValue.ToShortDateString()) { ucPrint.ExportData.Add(""); ucPrint.ExportData.Add(""); } else { ucPrint.ExportData.Add(cEntity.ApproveName); //<col>批准实施:|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.ApproveDate.ToShortDateString())); //<col>生效日期:|right</col> } ucPrint.ExportData.Add(cEntity.WriteName); //<col>编制姓名|shift</col> //M_20100414 huangqi des:编写时间改为FirstDraftDate //begin if (cEntity.FirstDraftDate != DateTime.MinValue) { ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.FirstDraftDate.ToShortDateString())); //<col>日期 |shift</col> } else { ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString())); } //end ucPrint.ExportData.Add(cEntity.CheckName); //<col>校核姓名|shift</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.CheckDate.ToShortDateString())); //<col>校核日期|shift</col> ucPrint.ExportData.Add(cEntity.AuditName); //<col>审核姓名|shift</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.AuditDate.ToShortDateString())); //<col>审核日期|shift</col> ucPrint.ExportData.Add(cEntity.QualityNames); //<col>质保姓名|shift</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.QualityDate.ToShortDateString())); //<col>质保日期|shift</col> ucPrint.ExportData.Add(OADept.GetDeptName(cEntity.SendDeptID)); //<col>程序编制部门:|shift</col> ucPrint.AttachFileList = cEntity.FileList; //ucPrint.Position = "";//(string)ucPrint.ExportData[2]; //ucPrint.Mode = WriteMode.Up; break; case "程序审查意见落实表": //string num = ""; //if (cEntity.ProgramSort == "管理程序") //{ // num = "HN-LL431-"; //} //if (cEntity.ProgramSort == "工作程序") //{ // num = "HN-LL432-"; //} //if (cEntity.ProgramSort == "部门级管理程序") //{ // num = "HN-LL433-"; //} //ucPrint.ExportData.Add(num + (string.IsNullOrEmpty(cEntity.Year) ? DateTime.Now.Year.ToString() : cEntity.Year) + "-" + cEntity.SerialID); //<col>年份|shift</col> ucPrint.ExportData.Add(cEntity.ProgramCode); ///*待定*/ ucPrint.ExportData.Add(""); //<col>第|right</col> ucPrint.ExportData.Add(cEntity.DocumentTitle); //<col>程序名称:|inner</col> ucPrint.ExportData.Add(cEntity.ProgramCode + " " + cEntity.Edition); //<col>程序编码和版本:|inner</col> //renjinquan+ //if (cEntity.ProgramSort == "管理程序") //{ // //ucPrint.ExportData.Add("管理程序"); //<col>管理程序|shift</col> // ucPrint.ExportData.Add("HN-LL431"+" " + cEntity.Edition); //<col>HN编码:|right</col> //} //if (cEntity.ProgramSort == "工作程序") //{ // //ucPrint.ExportData.Add("工作程序"); //<col>管理程序|shift</col> // ucPrint.ExportData.Add("HN-LL432"+" " + cEntity.Edition); //<col>HN编码:|right</col> //} //if (cEntity.ProgramSort == "部门级管理程序") //{ // //ucPrint.ExportData.Add("管理程序"); //<col>管理程序|shift</col> // ucPrint.ExportData.Add("HN-LL433"+" " + cEntity.Edition); //<col>HN编码:|right</col> //} //ucPrint.ExportData.Add(cEntity.RelationDemand); //<col>对相关程序修订要求或建议:|inner</col> //ucPrint.ExportData.Add(cEntity.RelationProgram/*cEntity.DocumentTitle + "" + cEntity.ProgramCode*/); //<col>相关程序名称和编码:|inner</col> //ucPrint.ExportData.Add(cEntity.ApproveName); //<col>批准|right</col> //ucPrint.ExportData.Add(cEntity.ApproveDate.ToShortDateString()); //<col>日期|right</col> ucPrint.ExportData.Add(cEntity.AuditName); //<col>审核|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.AuditDate.ToShortDateString())); //<col>日期 |right</col> ucPrint.ExportData.Add(cEntity.CheckName); //<col>校核|right</col> ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.CheckDate.ToShortDateString())); //<col>日期 |right</col> ucPrint.ExportData.Add(cEntity.WriteName); //<col>编制|right</col> //M_20100414 huangqi des:编写时间改为FirstDraftDate //begin if (cEntity.FirstDraftDate != DateTime.MinValue) { ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.FirstDraftDate.ToShortDateString())); //<col>日期 |right</col> } else { ucPrint.ExportData.Add(ucPrint.CheckDateTime(cEntity.DraftDate.ToShortDateString())); } //end ucPrint.AttachFileList = cEntity.FileList; //ucPrint.Position = "";//(string)ucPrint.ExportData[2]; //ucPrint.Mode = WriteMode.Up; break; } }