WFProjectAdjust.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:26k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using com.etong.Inform;
- using com.etong.BusinessRule.Zwf;
- using com.etong.Model;
- using com.etong.DAL.FC;
- using System.IO;
- using com.etong.Utility;
- using com.etong.DBUtility;
- using com.etong.DAL;
- using DocMergerComponent;
- using com.etong.Excel;
- public partial class Workflow_WFProjectAdjust : System.Web.UI.Page
- {
- protected int userid = -1;
- protected int wfid = -1;
- protected int MustChooseItem = -1;
- protected int ActivityID = -1;
- protected int WFInstanceID = -1;
- protected int ActID = -1; //活动实例ID
- protected int iEmpID = -1; //当前员工ID
- protected string sEmpName = "";
- protected void Page_Load(object sender, EventArgs e)
- {
- try
- {
- CheckUserInfo RoInfo = (CheckUserInfo)Session["checkuserinfo"];
- userid = RoInfo.UserID;
- iEmpID = RoInfo.EmpID;
- sEmpName = RoInfo.EmpName;
- }
- catch
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:您尚未登录或您登录已超时,请重新登录!');top.location.href='../login.aspx';", true);
- }
- string WFInstanceIDtxt = Request.QueryString["WFInstanceID"].ToString().Trim();
- string MustChooseItemtxt = Request.QueryString["MustChooseItem"].ToString().Trim();
- MustChooseItem = Convert.ToInt16(MustChooseItemtxt.Trim());
- string ActivityIDtxt = Request.QueryString["ActivityID"].ToString().Trim();
- ActivityID = Convert.ToInt32(ActivityIDtxt.Trim());
- string WFIDtxt = Request.QueryString["WFID"].ToString().Trim();
- ActID = Convert.ToInt32(Request.QueryString["ActID"].ToString().Trim());
- wfid = Convert.ToInt32(WFIDtxt.Trim());
- WFInstanceID = Convert.ToInt32(WFInstanceIDtxt.Trim());
- //if (!IsPostBack)
- //{
- // PrjGetAll(WFInstanceID);
- //}
- EtongZwf etongzwf = new EtongZwf();
- string path = Server.MapPath("doc").Replace("\", "\\"); //获取项目所在路径
-
- switch (MustChooseItem)
- {
- case 59: //基层单位
- Pn_Zg.Visible = false;
- Pn_Gcgl.Visible = false;
- Pn_Fg.Visible = false;
- Pn_Jc.Visible = false;
- PrjGetAll(WFInstanceID);
- break;
- case 60: //基层单位
- Pn_Zg.Visible = false;
- Pn_Gcgl.Visible = false;
- Pn_Fg.Visible = false;
- PrjGetAll(WFInstanceID);
- // TB_JcTransactor.Text = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
- this.BT_JC.Attributes.Add("onclick", "javascript:SetLinkUrl('DocTemplate/'+document.all('TB_JcFName').value);");
- this.BT_JC2.Attributes.Add("onclick", "javascript:SetLinkUrl('DocTemplate/'+document.all('TB_JcFName2').value);");
-
- if (!IsPostBack)
- {
- string FileName_JC = EtongZwf.GetDocumentFileName(this.ActivityID)[0].ToString();
- string FileName_JC2 = EtongZwf.GetDocumentFileName(this.ActivityID)[1].ToString();
- TB_JcFName.Text = EtongZwf.MakeNewFileNameWithDate(FileName_JC);
- TB_JcFName2.Text = EtongZwf.MakeNewFileNameWithDate(FileName_JC2);
- if ((!Util.Copyfile(path + "\" + FileName_JC, path + "\DocTemplate\" + this.TB_JcFName.Text.Trim())) || (!Util.Copyfile(path + "\" + FileName_JC2, path + "\DocTemplate\" + this.TB_JcFName2.Text.Trim())))
- {
- Common.RunScript(this.Page, "打开模板失败,请检查相关设置!");
- return;
- }
- }
- break;
- case 63: //主管部门审批
- BT_JC.Visible = false;
- BT_View_JC.Visible = true;
- BT_JC2.Visible = false;
- BT_View_JC2.Visible = true;
- Pn_Gcgl.Visible = false;
- Pn_Fg.Visible = false;
- IB_Collect.Visible = true;
- PrjGetAll(WFInstanceID);
- break;
- case 61: //工程管理办公室审批
- BT_JC.Visible = false;
- BT_View_JC.Visible = true;
- Pn_Jc.Visible = false;
- Pn_Zg.Visible=false;
- Pn_Fg.Visible = false;
- IB_Collect.Visible = true;
- BT_View_ZG2.Visible = true;
- PrjGetAll(WFInstanceID);
- break;
- case 62: //公司分管领导审批
- Pn_Jc.Visible = false;
- Pn_Zg.Visible = false;
- BT_Gcgl.Visible = false;
- BT_View_Gcgl.Visible = true;
- BT_Gcgl2.Visible = false;
- BT_View_Gcgl2.Visible = true;
- PrjGetAll(WFInstanceID);
- break;
- }
- }
- protected void PrjGetAll(int wfinstanceid)
- {
- EtongZwf etongzwf = new EtongZwf();
- DataView dv = etongzwf.GetPrjAlert(wfinstanceid);
- if (dv.Count == 0)
- {
- return;
- }
- ((HtmlInputHidden)this.FindControl("txt_ProjectID")).Value = dv[0]["AlertID"].ToString();
- TB_ProjectName.Text = dv[0]["AlertName"].ToString();
- // LB_BgFName.Text = dv[0]["BgFName"].ToString();
- EtongWord EWord = new EtongWord();
- EWord.sort = -1;
- // EWord.opSort = "99";
- EWord.XmlNodesNames = "XMLrecord";
- string path = Server.MapPath("doc").Replace("\", "\\");
- EWord.Address = path + "\\DocTemplate\\" + dv[0]["BgFName"].ToString().Trim();
- ArrayList alfn = new ArrayList();
- EtongXml alfn1 = new EtongXml();
- try
- {
- alfn = EWord.ReadXMLFName();
- LB_BgFName.Text = ((EtongXml)alfn[0]).DocFileName.ToString();
- LB_BgFName2.Text = ((EtongXml)alfn[1]).DocFileName.ToString();
- }
- catch
- {
- Common.RunScript(this.Page, "操作失败:未能找到文件!");
- return;
- }
- if (MustChooseItem != 59 && MustChooseItem != 60)
- {
- alfn.Clear();
- EWord.Address = path + "\\DocTemplate\\" + dv[0]["JcFName"].ToString().Trim();
- try
- {
- alfn = EWord.ReadXMLFName();
- TB_JcFName.Text = ((EtongXml)alfn[0]).DocFileName.ToString();
- TB_JcFName2.Text = ((EtongXml)alfn[1]).DocFileName.ToString();
- }
- catch
- {
- Common.RunScript(this.Page, "操作失败:未能找到文件!");
- return;
- }
- }
- if (MustChooseItem != 59 && MustChooseItem != 60 && MustChooseItem != 63 && MustChooseItem != 61)
- {
- alfn.Clear();
- EWord.Address = path + "\\DocTemplate\\" + dv[0]["GcglIdea"].ToString().Trim();
- try
- {
- alfn = EWord.ReadXMLFName();
- TB_Gcgl.Text = ((EtongXml)alfn[0]).DocFileName.ToString();
- TB_Gcgl2.Text = ((EtongXml)alfn[1]).DocFileName.ToString();
- }
- catch
- {
- Common.RunScript(this.Page, "操作失败:未能找到文件!");
- return;
- }
- }
- this.BT_View_ZG.Attributes.Add("onclick", "javascript:SetLinkUrl('DocTemplate/'+document.all('TB_ZG').value,false);");
- this.BT_ZG.Attributes.Add("onclick", "javascript:SetLinkUrl('DocTemplate/'+document.all('TB_ZG').value,false);");
- this.BT_View_ZG2.Attributes.Add("onclick", "javascript:SetLinkUrl('DocTemplate/'+document.all('TB_ZG2').value,false);");
- this.BT_ZG2.Attributes.Add("onclick", "javascript:SetLinkUrl('DocTemplate/'+document.all('TB_ZG2').value,false);");
- this.BT_View.Attributes.Add("onclick", "javascript:SetLinkUrl2('DocTemplate/'+document.all('LB_BgFName').value);");
- this.BT_View2.Attributes.Add("onclick", "javascript:SetLinkUrl2('DocTemplate/'+document.all('LB_BgFName2').value);");
-
- this.BT_View_JC.Attributes.Add("onclick", "javascript:SetLinkUrl2('DocTemplate/'+document.all('LB_BgFName').value);");
- this.BT_View_JC2.Attributes.Add("onclick", "javascript:SetLinkUrl2('DocTemplate/'+document.all('LB_BgFName2').value);");
- this.BT_Gcgl.Attributes.Add("onclick", "javascript:SetLinkUrl2('DocTemplate/'+document.all('TB_Gcgl').value);");
- this.BT_View_Gcgl.Attributes.Add("onclick", "javascript:SetLinkUrl2('DocTemplate/'+document.all('LB_BgFName2').value);");
- this.BT_Gcgl2.Attributes.Add("onclick", "javascript:SetLinkUrl2('DocTemplate/'+document.all('TB_Gcgl2').value);");
- this.BT_View_Gcgl2.Attributes.Add("onclick", "javascript:SetLinkUrl2('DocTemplate/'+document.all('TB_Gcgl2').value);");
- if (MustChooseItem != 62)
- {
- TB_FgIdea.Text = dv[0]["FgIdea"].ToString();
- }
- }
- protected void BT_Pass_Click(object sender, ImageClickEventArgs e)
- {
- int AlertID = Convert.ToInt32(((HtmlInputHidden)this.FindControl("txt_ProjectID")).Value.Trim());
- string path = Server.MapPath("doc").Replace("\", "\\"); //获取项目所在路径
- EtongZwf etongzwf = new EtongZwf();
- string Opsort = etongzwf.GetEmpType(iEmpID);
- //******************************************************启动*************************************************************
- if (MustChooseItem == 59)
- {
- WFInstADD();
- }
- //******************************************************基层部门审定*************************************************************
- if (MustChooseItem == 60)
- {
- string JCFName = TB_JcFName.Text;
- string JCFName2 = TB_JcFName2.Text;
- //判断上级活动实例是否产生
- string JCXMLFName = path + "\DocTemplate\";
- bool bl = true;
- bl = etongzwf.CheckUpActCompleteActIns(ActivityID, WFInstanceID, false, "");
- if (bl == false)
- {
- string NewFName = "";
- try
- {
- NewFName = etongzwf.PrjAlertGetAll(AlertID)[0]["JcFName"].ToString().Trim();
- }
- catch { NewFName = ""; }
- if (NewFName == "" || NewFName == null)
- {
- NewFName = EtongZwf.MakeNewFileNameWithDate("XML.xml");
- if (!Util.Copyfile(path + "\" + "XML.xml", path + "\DocTemplate\" + NewFName))
- {
- Common.RunScript(this.Page, "操作失败,请重试!");
- return;
- }
- etongzwf.PrjAlert_JC(AlertID, "", NewFName, 0); //.Project_JC(projectid, NewFName, 0);
- }
- JCXMLFName = JCXMLFName + NewFName;
- WFInstADD();
- }
- else
- {
- try
- {
- JCXMLFName = JCXMLFName + etongzwf.PrjAlertGetAll(AlertID)[0]["JcFName"].ToString().Trim();
- }
- catch
- {
- Common.RunScript(this.Page, "操作失败,请重试!");
- return;
- }
- //改变当前活动实例状态
- etongzwf.WFActInsUpdata(ActID, userid, 1);
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:操作成功,转到 主管部门 处理!');top.location.href='../Main.aspx';</script>");
- }
- //写入XML文档
- etongzwf.WriteXML(JCXMLFName, JCFName, sEmpName, Opsort, DateTime.Now.ToShortDateString());
- etongzwf.WriteXML(JCXMLFName, JCFName2, sEmpName, Opsort, DateTime.Now.ToShortDateString());
- }
- //******************************************************主管部门审定*************************************************************
- if (MustChooseItem == 63)
- {
- string ZgTransactor = ""; //sEmpName; //主管部门提交人和时间
- string ZgFName = ((HtmlInputHidden)this.FindControl("txt_ZgFname")).Value;
- if (ZgFName == "" || ZgFName == null)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:请先汇总!');</script>");
- return;
- }
- bool ReValue_Zg = false;
- etongzwf.PrjAlert_Zg(AlertID, ZgTransactor, ZgFName, 1);
- bool bl = true;
- bl = etongzwf.CheckUpActCompleteActIns(ActivityID, WFInstanceID, false, "");
- if (bl == false)
- {
- WFInstADD();
- }
- else
- {
- etongzwf.WFActInsUpdata(ActID, userid, 1);
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:操作成功,转到 工程管理办公室处理!');top.location.href='../Main.aspx';</script>");
- }
- }
- //******************************************************工程管理办公室审批*************************************************************
- if (MustChooseItem == 61)
- {
- string GcglTransactor = ""; // sEmpName;
- string GcglFName = ((HtmlInputHidden)this.FindControl("txt_FName")).Value; // TB_GcglIdea.Text + "【" + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + "】";
- bool ReValue_Gcgl = false;
- ReValue_Gcgl = etongzwf.PrjAlert_Gcgl(AlertID, GcglTransactor, GcglFName, 1);
- if (ReValue_Gcgl == true)
- WFInstADD();
- }
- //******************************************************分管领导审批*************************************************************
- if (MustChooseItem == 62)
- {
- string FgTransactor = sEmpName;
- string FgIdea = TB_FgIdea.Text + "【" + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + "】";
-
- bool ReValue_Fg = false;
- ReValue_Fg = etongzwf.PrjAlert_Fg(AlertID, FgTransactor, FgIdea, 2);
- //转到 工程项目实施流程
- string ProjectName= TB_ProjectName.Text;
- DataView dva=etongzwf.GetPrjAlert(WFInstanceID);
- string PrjSort = dva[0]["ConSort"].ToString(); //etongzwf.GetEmpType(iEmpID);
- string documentxml="";
- ConstructInfo constructinfo = new ConstructInfo(ProjectName, PrjSort, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1, documentxml);
- ProjectImplment projectimplment = new ProjectImplment();
- int revalue = 0;
- revalue= projectimplment.AddConstruct(constructinfo);
- if (revalue != 0)
- {
- int WorkFlowID = -1;
- WorkFlowID = etongzwf.GetConWfID();
- WFInstanceInfo wfinstanceinfo = new WFInstanceInfo(-1, Convert.ToDateTime(DateTime.Now.ToShortDateString()),
- userid, -1, -1, DateTime.Now,2, Convert.ToDateTime(DateTime.Now.ToShortDateString()), WorkFlowID, revalue);
- int ReInstanceValue = etongzwf.WFInstanceADD(wfinstanceinfo);
- //产生下一活动实例
- if (ReInstanceValue != 0)
- {
- WFInstADD();
- DataView dvCU = etongzwf.ActivityColony_User(4);
- int actid = Convert.ToInt16(dvCU[0]["ActivityID"].ToString().Trim());
- int roleid = Convert.ToInt16(dvCU[0]["RoleID"].ToString().Trim());
- NextColonyRole(actid, roleid, -1, ReInstanceValue); //转到 项目实施
- }
- }
-
- }
- }
- /// <summary>
- /// 改变工作流活动实例状态
- /// </summary>
- protected void WFInstADD()
- {
- if (WFInstanceID > 0)
- {
- //int ReActInsValue = 0;
- if (MustChooseItem == 0) //标记起始活动实例
- {
- ActID = Convert.ToInt16(((HtmlInputHidden)this.FindControl("txt_ActID")).Value.Trim()); //活动实例
- }
- else
- {
- string ActIDtxt = Request.QueryString["ActID"].ToString().Trim();
- ActID = Convert.ToInt32(ActIDtxt);
- }
- EtongZwf etongzwf = new EtongZwf();
- DataView dv = etongzwf.ColonyUserGetByActId(ActivityID);
- int CurrentRoleID = -1;
- int ParentActID = -1;
- int ParentRoleID = -1;
- string ReValueRole = "";
- if (dv.Count > 0)
- {
- for (int i = 0; i <= dv.Count - 1; i++)
- {
- string shuntflag = dv[i]["shuntflag"].ToString().Trim();
-
- CurrentRoleID = Convert.ToInt16(dv[i]["CurrentRoleID"].ToString().Trim());
- ParentActID = Convert.ToInt16(dv[i]["ParentActID"].ToString().Trim());
- ParentRoleID = Convert.ToInt16(dv[i]["ParentRoleID"].ToString().Trim()); //提交到下一活动 的 角色ID
- if (ParentActID != -1)
- {
- //产生下一个活动实例并提交到下一个角色的用户申核
- ReValueRole = ReValueRole + NextColonyRole(ParentActID, ParentRoleID, -1, WFInstanceID) + ",";
- }
- else
- { //工作流任务完成
- etongzwf.WFActInsUpdata(ActID, userid, 1);
- string projectid = ((HtmlInputHidden)this.FindControl("txt_ProjectID")).Value;
- bool re = etongzwf.WF_End("", "", -1, -1, wfid, 1, Convert.ToInt32(projectid.Trim()));
- if (re == true)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:项目申报完成!');top.location.href='../Main.aspx';</script>");
- return;
- }
- }
- }
- bool returnvalue = false;
- //更新当前活动实例状态
- etongzwf.WFActInsUpdata(ActID, userid, 1);
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:操作成功,转到: " + ReValueRole + " 申核处理!');top.location.href='../Main.aspx';</script>");
- }
- }
- }
- /// <summary>
- /// 提交到上级部门用户申核
- /// </summary>
- protected string NextColonyRole(int ParentActID, int ParentRoleID, int ParentEmp, int WFInsID)
- {
- string ReValue = "";
- //获取某业务角色对应的类型
- EtongZwf etongzwf = new EtongZwf();
- string Opsort;
- if (MustChooseItem == 11) //是否提交到主管
- Opsort = etongzwf.GetEmpType(iEmpID);
- else
- Opsort = EtongZwf.GetOpRole(ParentRoleID);
- WFActInsInfo wfactinsinfo = new WFActInsInfo(-1, ParentActID, Convert.ToDateTime(DateTime.Now.ToShortDateString()), Convert.ToDateTime(DateTime.Now.ToShortDateString()),
- 0, Convert.ToDateTime(DateTime.Now.ToShortDateString()), WFInsID, Opsort, ParentEmp, ParentRoleID);
- int ReActInsValue = etongzwf.WFActInsADD(wfactinsinfo);
- if (ReActInsValue > 0)
- {
- DataView dvRoleName = etongzwf.GetOrgzation(ParentRoleID);
- if (dvRoleName.Count != 0)
- {
- ReValue = dvRoleName[0][0].ToString();
- }
- }
- else
- ReValue = "";
- return ReValue;
- }
- protected void IB_Collect_Click(object sender, ImageClickEventArgs e) //汇总
- {
- MyDocMerger objMerger = new MyDocMerger();
- DocMerger docmerger = new DocMerger();
- EtongWord EWord = new EtongWord();
- EtongZwf etongzwf = new EtongZwf();
- string path = Server.MapPath("doc").Replace("\", "\\"); //获取项目所在路径
- int AlertID = Convert.ToInt32(txt_ProjectID.Value.Trim());
- DataView dvprj = etongzwf.PrjAlertGetAll(AlertID);
- string FName = "";
- string FName1 = "";
- string FName2 = "";
- //string opsort = etongzwf.ActInsSort(ActID)[0]["BlockReason"].ToString(); //类型
- string opsort = etongzwf.GetEmpType(iEmpID);
- //新建要存储汇总文件的XML文档
- FName1 = EtongZwf.MakeNewFileNameWithDate("项目预算表.doc"); //"芜湖供电公司工程项目预算表.doc"
- FName2 = EtongZwf.MakeNewFileNameWithDate("项目计划汇总表.xls"); //项目计划汇总表.xls
- string JCXMLFName = "";
- string NewFName = "";
- EtongFlyChouWFPrj etongflychouwfprj = new EtongFlyChouWFPrj();
- etongflychouwfprj.sID = ActID;
- etongflychouwfprj.iStatus = 4;
- etongflychouwfprj.sBlockReason = opsort;
- etongflychouwfprj.PrjID = AlertID;
- etongflychouwfprj.wID = wfid;
- if (MustChooseItem == 63) //主管汇总
- {
- EWord.opSort = opsort;
- FName = path + "\DocTemplate\" + dvprj[0]["JcFName"].ToString();
- //判断同类型的所有活动是否走完
- bool re = etongflychouwfprj.CheckUpActCompleteSort();
- if (re == false)
- {
- Common.RunScript(this.Page,"系统提示:基层单位同类型电子文档未全部提交,不能汇总!");
- return;
- }
- TB_ZG.Text = FName1;
- TB_ZG2.Text = FName2;
- try
- {
- NewFName = etongzwf.PrjAlertGetAll(AlertID)[0]["ZgFName"].ToString().Trim();
- }
- catch { NewFName = ""; }
- if (NewFName == "" || NewFName == null)
- {
- NewFName = EtongZwf.MakeNewFileNameWithDate("XML.xml");
- if (!Util.Copyfile(path + "\" + "XML.xml", path + "\DocTemplate\" + NewFName))
- {
- Common.RunScript(this.Page, "操作失败,请重试!");
- return;
- }
- }
- ((HtmlInputHidden)this.FindControl("txt_ZgFname")).Value = NewFName;
- }
- if (MustChooseItem == 61) //工程管理办公室汇总
- {
- //判断所有活动是否走完
- bool re = etongflychouwfprj.CheckUpActComplete();
- if (re == false)
- {
- Common.RunScript(this.Page, "系统提示:主管部门电子文档未全部提交,不能汇总!");
- return;
- }
- FName = path + "\DocTemplate\" + dvprj[0]["ZgFName"].ToString();
- EWord.sort = -1;
- TB_Gcgl.Text = FName1;
- TB_Gcgl2.Text = FName2;
- NewFName = EtongZwf.MakeNewFileNameWithDate("XML.xml");
- ((HtmlInputHidden)this.FindControl("txt_FName")).Value = NewFName;
- if (!Util.Copyfile(path + "\" + "XML.xml", path + "\DocTemplate\" + NewFName))
- {
- Common.RunScript(this.Page, "操作失败,请重试!");
- return;
- }
- }
- EWord.XmlNodesNames = "XMLrecord";
- EWord.Address = FName;
- ArrayList alfn = new ArrayList();
- try
- {
- alfn = EWord.ReadXMLFName();
- }
- catch
- {
- Common.RunScript(this.Page, "操作失败:未能找到文件!");
- return;
- }
- int count = alfn.Count;
- string[] fname = new string[count];
- ArrayList aldoc = new ArrayList();
- ArrayList alxls = new ArrayList();
- for (int k = 0; k < count; k++)
- {
- EtongXml alfn1 = new EtongXml();
- alfn1 = alfn[k] as EtongXml;
- fname[k] = path + "\\DocTemplate\\" + alfn1.DocFileName.ToString();
- string[] a = fname[k].ToString().Split('.');
- if (a[1].ToString().Trim() == "doc")
- aldoc.Add(fname[k]);
- if (a[1].ToString().Trim() == "xls")
- alxls.Add(fname[k]);
- }
- int count_doc = aldoc.Count;
- string[] Docfname = new string[count_doc];
- for (int i = 0; i < count_doc; i++)
- Docfname[i] = aldoc[i].ToString().Trim();
- if (!Util.Copyfile(path + "\" + "项目预算表.doc", path + "\DocTemplate\" + FName1))
- {
- Common.RunScript(this.Page, "文件拷贝失败,请检查相关设置!");
- return;
- }
- string filename = path + "\\DocTemplate\\" + FName1;
- JCXMLFName = path + "\DocTemplate\" + NewFName;
- try
- {
- objMerger.MergeDocArray(filename, Docfname, filename); //汇总Doc文档
- EtongExcel EExcel = new EtongExcel(Server.MapPath("doc\\项目计划汇总表.xls"), Server.MapPath("doc\\DocTemplate\\") + FName2);
- EExcel.RangeCellSet(alxls, 3, 10);
- EExcel.SaveAsFile();
- //将汇总的文件写入XML文档中
- etongzwf.WriteXML(JCXMLFName, FName1, sEmpName, opsort, DateTime.Now.ToShortDateString());
- etongzwf.WriteXML(JCXMLFName, FName2, sEmpName, opsort, DateTime.Now.ToShortDateString());
- Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('系统提示:汇总成功!');</script>");
- }
- catch (Exception ex)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "errorMessage", "<script>alert('" + ex.Message.Replace("'", "").Replace("rn", "") + "');</script>");
- }
- }
- }