OldMaterialCollect.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:31k
- 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.BusinessRule.Zwf;
- using com.etong.Inform;
- using com.etong.DBUtility;
- using com.etong.DAL;
- using com.etong.Model;
- public partial class Workflow_OldMaterialCollect : System.Web.UI.Page
- {
- protected int userid = -1;//用户ID
- protected int wfid = -1;//当前工作流ID
- protected int MustChooseItem = -1;//必选项
- protected int ActivityID = -1;//活动ID
- protected int WFInstanceID = -1;//工作流实例ID
- protected int actinstanceid = -1;//活动实例ID
- protected int ActID = -1;//活动实例ID
- protected bool IsUntread = true;//是否回退
- protected int shuntFlag = 0;//分流标志(0、不分流;1、小件;2、大件;)
- protected int MatHZID = -1;//当前物资汇总ID
- protected string rolestr()
- {
- string rolestr = "";
- if (userid != -1)
- {
- EtongZwf etongzwf = new EtongZwf();
- DataView dvrole = etongzwf.RoleGetByID(userid);
- for (int i = 0; i < dvrole.Count; i++)
- {
- rolestr = rolestr + dvrole[i][0].ToString().Trim() + ",";
- }
- }
- return rolestr;
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- //------------------------------------------变量定义-----------------------------------------------
- DataView dv = null;
- CheckUserInfo cui = null;
- //-----------------------------------------获取参数值----------------------------------------------
- if (Request.QueryString["MustChooseItem"] != null)
- {
- string MustChooseItemtxt = "";
- MustChooseItemtxt = Request.QueryString["MustChooseItem"].ToString().Trim();
- MustChooseItem = Convert.ToInt16(MustChooseItemtxt);
- }
- string ActivityIDtxt = "";
- if (Request.QueryString["ActivityID"] != null)
- {
- ActivityIDtxt = Request.QueryString["ActivityID"].ToString().Trim();
- ActivityID = Convert.ToInt32(ActivityIDtxt);
- }
- string WFInstanceIDtxt = "";
- if (Request.QueryString["WFInstanceID"] != null)
- {
- WFInstanceIDtxt = Request.QueryString["WFInstanceID"].ToString().Trim();
- }
- string WFIDtxt = "";
- if (Request.QueryString["WFID"] != null)
- {
- WFIDtxt = Request.QueryString["WFID"].ToString().Trim();
- wfid = Convert.ToInt16(WFIDtxt);
- }
- if (Request.QueryString["ActID"] != null)
- {
- actinstanceid = Convert.ToInt32(Request.QueryString["ActID"].ToString());
- }
- //----------------------------------------对象定义--------------------------------------------------
- if (Session["checkuserinfo"] != null)
- {
- cui = (CheckUserInfo)Session["checkuserinfo"];
- userid = cui.UserID;
- }
- if (ActivityIDtxt != "" && WFInstanceIDtxt != "")
- {
- if (Convert.ToInt32(ActivityIDtxt) != -1 && Convert.ToInt32(WFInstanceIDtxt) != -1)
- {
- WFInstanceID = Convert.ToInt32(WFInstanceIDtxt);
- string sql = "select * from [tb_WF_Instance] where [WFInstanceID]=" + WFInstanceID;
- dv = SqlServer.GetDataView(sql);
- if (dv.Count > 0)
- {
- wfid = Convert.ToInt32(dv[0][8].ToString().Trim());
- this.MatHZID = Convert.ToInt32(dv[0][9].ToString().Trim());
- }
- }
- }
- if (!this.Page.IsPostBack)
- {
- CreateYearToBindDropDownList_Year();
- string path = Server.MapPath("doc").Replace("\", "\\");//获取项目所在路径
- int tempStatus = WorkFolw.GetCurrentActivityInstanceStatus(this.actinstanceid);//当前活动实例状态
- switch (MustChooseItem)
- {
- /*==============================================================================================
- *
- * 物资公司获取并确认废旧物资汇总表
- *
- *=============================================================================================*/
- case 80:
- SetAllPanelsVisibility(true, false, false, false, true);
- this.IsUntread = false;//起始活动不可回退
- BindPrjOldMatHZInfoToPageControls();
- break;
- /*==============================================================================================
- *
- * 工程管理办公室审核
- *
- *=============================================================================================*/
- case 81:
- SetAllPanelsVisibility(true, true, false, false, true);
- BindPrjOldMatHZInfoToPageControls();
- break;
- /*==============================================================================================
- *
- * 分管领导审核
- *
- *=============================================================================================*/
- case 82:
- SetAllPanelsVisibility(true, true, true, false, true);
- BindPrjOldMatHZInfoToPageControls();
- break;
- /*==============================================================================================
- *
- * 基层单位获取所有反馈的汇总物资
- *
- *=============================================================================================*/
- case 83:
- SetAllPanelsVisibility(true, true, true, true, true);
- BindPrjOldMatHZInfoToPageControls();
- break;
- }
- }
- }
- //-------------------------------------------------根据MatHZID得到表记录信息--------------------------------------------------
- private DataView GetPrjOldMatHZInfo(int mathzid)
- {
- string sql = "select * from [tb_PrjOldMatHZ] where [MatHZID]=" + mathzid;
- DataView dv = SqlServer.GetDataView(sql);
- return dv;
- }
- //-------------------------------------------绑定由MatHZID得到的表记录信息到页面控件-------------------------------------------
- private void BindPrjOldMatHZInfoToPageControls()
- {
- DataView dv = GetPrjOldMatHZInfo(this.MatHZID);
- CheckUserInfo cui = null;
- if (Session["checkuserinfo"] != null)
- {
- cui = (CheckUserInfo)Session["checkuserinfo"];
- }
- if (dv.Count > 0 && cui != null)
- {
- if (this.Panel_OldMaterialCollect.Visible == true)
- {
- this.DDL_Year.SelectedValue = dv[0]["nf"].ToString();
- this.DDL_Year.Enabled = false;
- this.DDL_Quarter.SelectedValue = dv[0]["jd"].ToString();
- this.DDL_Quarter.Enabled = false;
- this.TB_MatHzName.Text = dv[0]["MatHzName"].ToString();
- this.RadioButtonList2.SelectedValue = dv[0]["HZ"].ToString();
- this.txt_OldMaterialCollect.Value = dv[0]["HzFName"].ToString();
- this.BT_OpenDocument_OldMaterialCollect.Attributes.Add("onclick", "javascript:SetLinkUrl('DocTemplateMat/'+document.all('txt_OldMaterialCollect').value,'" + cui.EmpName + "');");
- }
- if (this.Panel_ProjectManagementOffice.Visible == true)
- {
- this.ShowOperatorAndTime_OldMaterialCollect.InnerHtml = "<div align='center'>汇总人/汇总时间:<font color='red'> " + dv[0]["WzTransactor"].ToString() + "</font></div>";
- this.RadioButtonList2.Enabled = false;
- }
- if (this.Panel_Separate_Management_Leader.Visible == true)
- {
- this.ShowOperatorAndTime_ProjectManagementOfficee.InnerHtml = "<div align='center'>审核人/审核时间:<font color='red'> " + dv[0]["GcglTransactor"].ToString() + "</font></div>";
- this.TB_GcglIdea.Text = dv[0]["GcglIdea"].ToString();
- this.TB_GcglIdea.Enabled = false;
- }
- if (this.Panel_GetFeedbackOldMaterial.Visible == true)
- {
- this.ShowOperatorAndTime_Separate_Management_Leader.InnerHtml = "<div align='center'>审核人/审核时间:<font color='red'> " + dv[0]["FgTransactor"].ToString() + "</font></div>";
- this.TB_FgIdea.Text = dv[0]["FgIdea"].ToString();
- this.TB_FgIdea.Enabled = false;
- }
- }
- }
- //-----------------------------------------------------生成DropDownList的下拉项------------------------------------------------------
- private void CreateYearToBindDropDownList_Year()
- {
- int year = DateTime.Now.Year;
- for (int i = year; i >= year - 10; i--)
- {
- this.DDL_Year.Items.Add(new ListItem(i.ToString(), i.ToString()));
- }
- }
- //-------------------------------------------------------设定各项面板的可见性--------------------------------------------------------
- private void SetAllPanelsVisibility(bool flag_OldMaterialCollect, bool flag_ProjectManagementOffice, bool flag_Separate_Management_Leader,
- bool flag_GetFeedbackOldMaterial,bool flag_Button)
- {
- this.Panel_OldMaterialCollect.Visible = flag_OldMaterialCollect;
- this.Panel_ProjectManagementOffice.Visible = flag_ProjectManagementOffice;
- this.Panel_Separate_Management_Leader.Visible = flag_Separate_Management_Leader;
- this.Panel_GetFeedbackOldMaterial.Visible = flag_GetFeedbackOldMaterial;
- this.Panel_Button.Visible = flag_Button;
- }
- protected void BT_Pass_Click(object sender, ImageClickEventArgs e)
- {
- if (Request.QueryString["MustChooseItem"] != null)
- {
- string MustChooseItemtxt = "";
- MustChooseItemtxt = Request.QueryString["MustChooseItem"].ToString().Trim();
- MustChooseItem = Convert.ToInt16(MustChooseItemtxt);
- }
- string path = Server.MapPath("doc").Replace("\", "\\"); //获取项目所在路径
- CheckUserInfo cui = null;
- if (Session["checkuserinfo"] != null)
- cui = (CheckUserInfo)Session["checkuserinfo"];
- string sql = "";
- switch (MustChooseItem)
- {
- /*==============================================================================================
- *
- * 废旧物资汇总(审核通过code)
- *
- *=============================================================================================*/
- case 80:
- int tempStatus = WorkFolw.GetCurrentActivityInstanceStatus(this.actinstanceid);//当前活动实例状态
- if (tempStatus == 2)
- {
- WFInstADD("您已审核通过!");
- }
- else
- {
- string hz = this.RadioButtonList2.SelectedValue;
- string wzTransactor = cui.EmpName + " " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute;
- sql = "update [tb_PrjOldMatHZ] set [HZ]='" + hz + "',[WzTransactor]='" + wzTransactor + "' where [MatHzID]=" + this.MatHZID;
- if (SqlServer.RunSql(sql))
- {
- WFInstADD("您已审核通过!");
- }
- else
- {
- Common.RunScript(this.Page, "操作失败,请检查数据!");
- }
- }
- break;
- /*==============================================================================================
- *
- * 工程管理办公室审核(审核通过code)
- *
- *=============================================================================================*/
- case 81:
- string gcglIdea = this.TB_GcglIdea.Text.Trim();
- string gcglTransactor = cui.EmpName + " " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute;
- sql = "update [tb_PrjOldMatHZ] set [GcglTransactor]='" + gcglTransactor + "',[GcglIdea]='" + gcglIdea + "' where [MatHzID]=" + this.MatHZID;
- if (SqlServer.RunSql(sql))
- {
- WFInstADD("您已审核通过!");
- }
- else
- {
- Common.RunScript(this.Page, "操作失败,请检查数据!");
- }
- break;
- /*==============================================================================================
- *
- * 分管领导审核(审核通过code)
- *
- *=============================================================================================*/
- case 82:
- string fgIdea = this.TB_FgIdea.Text.Trim();
- string fgTransactor = cui.EmpName + " " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute;
- sql = "update [tb_PrjOldMatHZ] set [FgTransactor]='" + fgTransactor + "',[FgIdea]='" + fgIdea + "' where [MatHzID]=" + this.MatHZID;
- if (SqlServer.RunSql(sql))
- {
- WFInstADD("您已审核通过!");
- }
- else
- {
- Common.RunScript(this.Page, "操作失败,请检查数据!");
- }
- break;
- /*==============================================================================================
- *
- * 获取反馈汇总废旧物资(审核通过code)
- *
- *=============================================================================================*/
- case 83:
- string jcoIdea = this.TB_JcoIdea.Text.Trim();
- string jcoTransactor = cui.EmpName + " " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute;
- sql = "update [tb_PrjOldMatHZ] set [JcoTransactor]='" + jcoTransactor + "',[JcoIdea]='" + jcoIdea + "',[status]=2 where [MatHzID]=" + this.MatHZID;
- if (SqlServer.RunSql(sql))
- {
- string script = "<script>alert('系统提示:您已审核通过,废旧物资汇总工作完成!');top.location.href='../Main.aspx';</script>";
- Common.RunScriptString(this.Page, script);
- }
- else
- {
- Common.RunScript(this.Page, "操作失败,请检查数据!");
- }
- break;
- }
- }
- protected void BT_Untread_Click(object sender, ImageClickEventArgs e)
- {
- if (IsUntread == false)
- {
- Common.RunScript(this.Page, "起始活动不可回退!");
- return;
- }
- else
- {
- EtongZwf etongzwf = new EtongZwf();
- bool ReActInsValue = false;
- string ActIDtxt = Request.QueryString["ActID"].ToString().Trim();
- ActID = Convert.ToInt32(ActIDtxt);
- //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + ActID.ToString() + "');</script>");
- //return;
- ReActInsValue = etongzwf.WFActInsUpdata(ActID, userid, 3);
- if (ReActInsValue == true)
- {
- //产生回退活动事例
- // 注:Status状态(0、正常;1、完成;2、回退;3、回退并完成;4、作废)
- int ReActInsValue2 = 0;
- DataView dvAct = etongzwf.ActivityGetByActInsId(ActID);
- // DataView dvAct = etongzwf.ColonyUserGetByAct(ActivityID);
- int PreviousActID = -1;
- int PreviousUserID = -1;
- int PreviousRoleID = -1;
- if (dvAct != null)
- {
- PreviousActID = Convert.ToInt16(dvAct[0]["PreviousActID"].ToString().Trim());
- PreviousUserID = Convert.ToInt16(dvAct[0]["PreviousUserID"].ToString().Trim());
- PreviousRoleID = Convert.ToInt16(dvAct[0]["PreviousRoleID"].ToString().Trim());
- }
- WFActInsInfo wfactinsinfo2 = new WFActInsInfo(-1, PreviousActID, Convert.ToDateTime(DateTime.Now.ToShortDateString()), Convert.ToDateTime(DateTime.Now.ToShortDateString()),
- 2, Convert.ToDateTime(DateTime.Now.ToShortDateString()), WFInstanceID, "", PreviousUserID, PreviousRoleID);
- ReActInsValue2 = etongzwf.WFActInsADD(wfactinsinfo2);
- if (ReActInsValue2 != 0)
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:回退成功!');top.location.href='../Main.aspx';</script>");
- else
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:回退失败!');top.location.href='../Main.aspx';</script>");
- }
- }
- }
- protected void BT_Revoke_Click(object sender, ImageClickEventArgs e)
- {
- string sql = "update tb_WF_ACtIns set Status=4 where [WfInstanceID]=" + this.WFInstanceID + " and [ActivityID]=" + this.ActivityID;
- //string sql1 = "update [tb_PrjOldMat] set [Status]=3 where [MatID]=" + this.MatID;
- if (SqlServer.RunSql(sql)) //&& SqlServer.RunSql(sql1))
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:作废操作成功!');top.location.href='../Main.aspx';</script>");
- }
- else
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:作废操作失败!');top.location.href='../Main.aspx';</script>");
- }
- }
- /*===========================================================================================================================
- *
- * 工作流操作,分3步
- * 1.产生工作流实例纪录,注意constructid必须真实存在
- * 2.更新当前活动实例状态 由WFInstADD中的WFActInsUpdata执行
- * 3.产生新的工作流实例纪录,即产生下一个活动实例并提交到下一个部门的用户申核,由NextColonyRole操作完成
- *
- *==========================================================================================================================*/
- protected void WorkFlowOperation(int matid, string showmessage)
- {
- EtongZwf etongzwf = new EtongZwf();
- ProjectImplment projectImplment = new ProjectImplment();
- DataView dv = etongzwf.ColonyUserGetByActId(ActivityID);
- if (dv.Count > 0)
- {
- //int ParentRoleID = Convert.ToInt32(dv[0]["ParentRoleID"].ToString().Trim());
- ////DataView dvRoleName = etongzwf.RoleGetName(ParentRoleID);
- //DataTable dt = projectImplment.GetDepartmentByID(ParentRoleID);
- //if (dt.Rows.Count == 0)
- //{
- // ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:项目施工停滞,没有上级申核人!(请联系相关部门或系统管理员)');</script>");
- // return;
- //}
- DateTime SuccessDate = Convert.ToDateTime(DateTime.Now.ToShortDateString().Trim());
- //添加工作流实例 (将添加成功的constructid添加到工作流实例表里,注意是加到该表的PrjID字段中)
- WFInstanceInfo wfinstanceinfo = new WFInstanceInfo(-1, Convert.ToDateTime(DateTime.Now.ToShortDateString()),
- userid, -1, -1, DateTime.Now, 5, SuccessDate, wfid, matid);
- int ReInstanceValue = etongzwf.WFInstanceADD(wfinstanceinfo);
- //产生当前工作流实例ID
- WFInstanceID = ReInstanceValue;
- //获取当前工作流启始活动 为什么要获取当前工作流启始活动?
- //DataView dvActID = etongzwf.GetActivityByWFID(wfid);
- //ActivityID = Convert.ToInt32(dvActID[0][0].ToString().Trim());
- if (WFInstanceID > 0)
- {
- WFInstADD(showmessage);
- }
- }
- }
- /// <summary>
- /// 改变工作流活动实例状态
- /// </summary>
- ///
- protected void WFInstADD(string showMessage)
- {
- if (WFInstanceID > 0)
- {
- com.etong.DAL.WorkFolw workflow = new com.etong.DAL.WorkFolw();
- DateTime SuccessDate = Convert.ToDateTime(DateTime.Now.ToShortDateString().Trim());
- EtongZwf etongzwf = new EtongZwf();
- DataView dv = etongzwf.ColonyUserGetByActId(ActivityID);
- // int CurrentActID = -1;
- int CurrentRoleID = -1;
- int ParentActID = -1;
- int ParentRoleID = -1;
- string nextCheckDepartment = null;
- if (dv.Count > 0)
- {
- if (dv.Count == 1)//不分流
- {
- CurrentRoleID = Convert.ToInt32(dv[0]["CurrentRoleID"].ToString().Trim());
- ParentActID = Convert.ToInt32(dv[0]["ParentActID"].ToString().Trim());
- ParentRoleID = Convert.ToInt32(dv[0]["ParentRoleID"].ToString().Trim());
- }
- else//分流
- {
- for (int i = 0; i < dv.Count; i++)
- {
- if (Convert.ToInt32(dv[i]["shuntflag"]) == shuntFlag)
- {
- CurrentRoleID = Convert.ToInt32(dv[i]["CurrentRoleID"].ToString().Trim());
- ParentActID = Convert.ToInt32(dv[i]["ParentActID"].ToString().Trim());
- ParentRoleID = Convert.ToInt32(dv[i]["ParentRoleID"].ToString().Trim());
- }
- }
- }
- }
- //产生当前活动实例 如果是不是第一个活动,只需 修改 UserID 和 Status
- int ReActInsValue = 0;
- int tempStatus = WorkFolw.GetCurrentActivityInstanceStatus(this.actinstanceid);//当前活动实例状态
- if (MustChooseItem == 80)//对起始活动的操作
- {
- if (tempStatus == 2)//回退活动
- {
- string ActIDtxt = Request.QueryString["ActID"].ToString().Trim();
- ActID = Convert.ToInt32(ActIDtxt);
- bool returnvalue = false;
- //returnvalue = etongzwf.WFActInsUpdata(ActID, userid, 1);
- returnvalue = workflow.WFActInsUpdata(ActID, 1, userid);
- if (returnvalue == true)
- ReActInsValue = ActID;
- if (ReActInsValue > 0)
- {
- if (ParentActID != -1)
- {
- ProjectImplment pi = new ProjectImplment();
- //DataTable dt = pi.GetDepartmentByID(ParentRoleID);
- DataTable dt = pi.GetNextOperatorRole(ParentRoleID);
- nextCheckDepartment = dt.Rows[0]["OpName"].ToString();
- NextColonyRole(ParentActID, ParentRoleID, showMessage, nextCheckDepartment); //(ReActInsValue); //产生下一个活动实例并提交到下一个角色的用户申核
- }
- else//不存在上级活动,将 活动状态(Status) 改为 "完成" 注:Status状态(0、正常;1、完成;2、回退;3、回退并完成;4、作废)
- {
- bool ReValueAIUpdata = false;
- //ReValueAIUpdata = etongzwf.WFActInsUpdata(ReActInsValue, userid, 1);
- ReValueAIUpdata = workflow.WFActInsUpdata(ReActInsValue, 1, userid);
- if (ReValueAIUpdata == true)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:项目施工完成!');top.location.href='../Main.aspx';</script>");
- }
- else
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:操作失败!');top.location.href='../Main.aspx';</script>");
- }
- }
- }
- }
- else
- {
- WFActInsInfo wfactinsinfo = new WFActInsInfo(-1, ActivityID, Convert.ToDateTime(DateTime.Now.ToShortDateString()), Convert.ToDateTime(DateTime.Now.ToShortDateString()),
- 1, SuccessDate, WFInstanceID, "", userid, CurrentRoleID);
- ReActInsValue = etongzwf.WFActInsADD(wfactinsinfo);
- ProjectImplment pi = new ProjectImplment();
- //DataTable dt = pi.GetDepartmentByID(ParentRoleID);
- DataTable dt = pi.GetNextOperatorRole(ParentRoleID);
- if (dt.Rows.Count > 0)
- {
- nextCheckDepartment = dt.Rows[0]["OpName"].ToString();
- //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:计划下达成功,转到『" + nextCheckDepartment + "』申核处理!');top.location.href='../Main.aspx';</script>");
- }
- NextColonyRole(ParentActID, ParentRoleID, showMessage, nextCheckDepartment);//提交给下一部门用户审核
- }
- }
- else//对不是起始活动的操作
- {
- string ActIDtxt = Request.QueryString["ActID"].ToString().Trim();
- ActID = Convert.ToInt32(ActIDtxt);
- bool returnvalue = false;
- //returnvalue = etongzwf.WFActInsUpdata(ActID, userid, 1);
- returnvalue = workflow.WFActInsUpdata(ActID, 1, userid);
- if (returnvalue == true)
- ReActInsValue = ActID;
- if (ReActInsValue > 0)
- {
- if (ParentActID != -1)
- {
- ProjectImplment pi = new ProjectImplment();
- //DataTable dt = pi.GetDepartmentByID(ParentRoleID);
- DataTable dt = pi.GetNextOperatorRole(ParentRoleID);
- nextCheckDepartment = dt.Rows[0]["OpName"].ToString();
- NextColonyRole(ParentActID, ParentRoleID, showMessage, nextCheckDepartment); //(ReActInsValue); //产生下一个活动实例并提交到下一个角色的用户申核
- }
- else // 不存在上级活动,将 活动状态(Status) 改为 "完成" 注:Status状态(0、正常;1、完成;2、回退;3、回退并完成;4、作废)
- {
- bool ReValueAIUpdata = false;
- //ReValueAIUpdata = etongzwf.WFActInsUpdata(ReActInsValue, userid, 1);
- ReValueAIUpdata = workflow.WFActInsUpdata(ReActInsValue, 1, userid);
- if (ReValueAIUpdata == true)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:项目施工完成!');top.location.href='../Main.aspx';</script>");
- }
- else
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:操作失败!');top.location.href='../Main.aspx';</script>");
- }
- }
- }
- }
- }
- }
- /// <summary>
- /// 起始活动.
- /// </summary>
- protected int ActivityIDGetByWFID(int WfId)
- {
- EtongZwf etongzwf = new EtongZwf();
- DataView dvActivity = etongzwf.GetActivityByWFID(WfId);
- if (dvActivity.Count != 0)
- {
- int activity = Convert.ToInt32(dvActivity[0][0].ToString().Trim());
- return activity;
- }
- else
- return 0;
- }
- /// <summary>
- /// 提交到上级部门用户申核
- /// </summary>
- protected void NextColonyRole(int ParentActID, int ParentRoleID, string showMessage, string nextCheckDepartment)
- {
- EtongZwf etongzwf = new EtongZwf();
- WFActInsInfo wfactinsinfo = new WFActInsInfo(-1, ParentActID, Convert.ToDateTime(DateTime.Now.ToShortDateString()), Convert.ToDateTime(DateTime.Now.ToShortDateString()),
- 0, Convert.ToDateTime(DateTime.Now.ToShortDateString()), WFInstanceID, "", -1, ParentRoleID);
- int ReActInsValue = etongzwf.WFActInsADD(wfactinsinfo);
- if (ReActInsValue > 0)
- {
- //DataView dvRoleName = etongzwf.RoleGetName(ParentRoleID);
- //if (dvRoleName.Count != 0)
- //{
- //InitializePage(); //初始化当前页面
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:" + showMessage + ",转到『" + nextCheckDepartment + "』申核处理!');top.location.href='../Main.aspx';</script>");
- //}
- //else
- //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:项目施工停滞,没有上级申核人!');</script>");
- }
- else
- {
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:操作失败!');top.location.href='../Main.aspx';</script>");
- }
- }
- }