Пример #1
0
        protected override string AddData()
        {
            RDFNew.Module.Admin.Flow.Flow_ToDoM obj = new RDFNew.Module.Admin.Flow.Flow_ToDoM();
            DataTable dt = RDFNew.Module.DALHelper.GetMasterEmpty(null, "Flow_ToDoM");
            DataRow dr;
            dr = dt.NewRow();
            dr["ToDoMID"] = App_Com.Helper.InputText(this.txtToDoMID.Text, 500);
            dr["Description"] = App_Com.Helper.InputText(this.txtDescription.Text, 500);

            dr["CrtBy"] = App_Com.Sys_User.GetUserInfo("UserID");
            dr["CrtOn"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dt.Rows.Add(dr);

            DS.XBPM.API.ProcessInstance instance = App_Com.FlowHelper.Engine.GetExecutionService().StartProcessInstance(
                "2013080212371201280139547");
            if (instance == null)
            {
                throw new Exception("流程实例创建失败.");
            }
            else
            {
                dr["InstanceID"] = instance.InstanceId;
            }

            object[] data = obj.ApplyMaster(dt.GetChanges(DataRowState.Added),
                                        App_Com.Helper.BuildLog("Flow_ToDoM", "add"));
            if (data[0].ToString() != "0") //正常
                throw data[1] as Exception;
            else
                return data[1].ToString();
        }
Пример #2
0
        protected override string UpdateData()
        {
            RDFNew.Module.Admin.Flow.Flow_ToDoM obj = new RDFNew.Module.Admin.Flow.Flow_ToDoM();
            object[] data = obj.GetMaster(B_Keyword);
            if (data[0].ToString() == "0") //正常
            {
                DataTable dt = data[1] as DataTable;
                if (dt.Rows.Count > 0)
                {
                    DataRow dr;
                    dr = dt.Rows[0];

                    Boolean success = false;
                    DS.XBPM.API.ProcessInstance ins = App_Com.FlowHelper.Engine.GetExecutionService().FindProcessInstance(dr["InstanceID"].ToString());
                    if (ins != null)
                    {
                        RDFNew.Module.Admin.Flow.Flow_DeployD dal = new RDFNew.Module.Admin.Flow.Flow_DeployD();
                        string[] curActNames = ins.FindActiveExecutionNames();
                        for (int j = 0; j < curActNames.Length; j++)
                        {
                            string act = curActNames[j];
                            string owner = dal.GetActivityOwner(ins.DeploymentId, ins.ProcessName, act);
                            if ((owner.ToUpper() == "APPLICANT" && dr["CrtBy"].ToString() == App_Com.Sys_User.GetUserInfo("UserID"))||
                                owner == App_Com.Sys_User.GetUserInfo("UserID"))
                            {
                                DS.XBPM.API.ProcessAction action = new DS.XBPM.API.ProcessAction();
                                action.SetVariable("GoBack", 0);
                                success = ins.SignalExecution(act, action);
                                //FineUI.Alert.ShowInParent(success ? "流程提交成功" : "流程提交失败");
                                break;
                            }
                        }
                    }
                    if (!success)
                        throw new Exception("流程提交败.");

                    dr["ModBy"] = App_Com.Sys_User.GetUserInfo("UserID");
                    dr["ModOn"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                    data = obj.ApplyMaster(dt.GetChanges(DataRowState.Modified),GetDetail(), null,
                                            App_Com.Helper.BuildLog("Flow_ToDoM", "edit"));
                    if (data[0].ToString() != "0") //正常
                        throw data[1] as Exception;
                    else
                        return data[1].ToString();
                }
                else
                {
                    throw new Exception("需要修改的记录已不存在,请刷新后再试.");
                }
            }
            else
            {
                throw data[1] as Exception;
            }
        }
Пример #3
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            B_ModuleID = "Flow_ToDoM";
            B_ModuleName = "流程列表";
            B_ToolBar1 = this.Toolbar1;
            B_IDAL = new RDFNew.Module.Admin.Flow.Flow_ToDoM();

            B_Window1 = this.Window1;

            B_DetailSessionKey = "Flow_ToDoDAdd";
        }
Пример #4
0
        protected override string UpdateData()
        {
            RDFNew.Module.Admin.Flow.Flow_ToDoM obj = new RDFNew.Module.Admin.Flow.Flow_ToDoM();
            object[] data = obj.GetMaster(B_Keyword);
            if (data[0].ToString() == "0") //正常
            {
                DataTable dt = data[1] as DataTable;
                if (dt.Rows.Count > 0)
                {
                    DataRow dr;
                    dr = dt.Rows[0];

                    dr["Description"] = App_Com.Helper.InputText(this.txtDescription.Text, 500);

                    dr["ModBy"] = App_Com.Sys_User.GetUserInfo("UserID");
                    dr["ModOn"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                    BuildDetail();
                    DataTable dtDetail = App_Com.Helper.GetSession(B_DetailSessionKey, false) as DataTable;
                    data = obj.ApplyMaster(dt.GetChanges(DataRowState.Modified),dtDetail,null,
                                            App_Com.Helper.BuildLog("Flow_ToDoM", "edit"));
                    if (data[0].ToString() != "0") //正常
                        throw data[1] as Exception;
                    else
                        return data[1].ToString();
                }
                else
                {
                    throw new Exception("需要修改的记录已不存在,请刷新后再试.");
                }
            }
            else
            {
                throw data[1] as Exception;
            }
        }
Пример #5
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     B_ModuleID = "Flow_ToDoM";
     B_ModuleName = "流程列表";
     B_PageDetail = "Flow_ToDoM.aspx";
     B_ToolBar1 = this.Toolbar1;
     B_Window1 = this.Window1;
     B_Grid1 = this.Grid1;
     B_IDAL = new RDFNew.Module.Admin.Flow.Flow_ToDoM();
     B_TableKey = "Flow_ToDoM.ToDoMID";
     B_OrderBy = " Flow_ToDoM.ToDoMID Desc ";
 }