protected void btnEdit_ServerClick(object sender, EventArgs e)
 {
     Model.WorkFlow workflows = new Model.WorkFlow
     {
         ID     = id.Trim(),
         Name   = this.txtName.Value.Trim(),
         URL    = this.uploadurl.Value.Trim(),
         State  = this.isState.Value.ToString(),
         Remark = this.txtReMark.Value.Trim(),
     };
     if (((workflows.Name.Length == 0) || (workflows.URL.Length == 0)) || (workflows.State.Length == 0))
     {
         MessageBox.Show(this, "请您填写完整的信息");
     }
     else
     {
         if (BLL.WorkFlow.WorkFlowUpdate(workflows) == 1)
         {
             UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "工作流管理", "编辑工作流" + workflows.Name + "的信息成功");
             MessageBox.ShowAndRedirect(this, "编辑工作流成功,请继续分配权限!", "/workflow/AuthorizeWorkFlow.aspx?wid=" + id);
         }
         else
         {
             UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "工作流管理", "编辑工作流" + workflows.Name + "的信息失败");
             MessageBox.Show(this, "编辑工作流失败");
         }
     }
 }
Пример #2
0
    //end

    protected void btnEdit_ServerClick(object sender, EventArgs e)
    {
        if (((this.txtName.Value.Length == 0) || (this.uploadurl.Value.Length == 0)) || (this.selWorkFlow.SelectedValue.Length == 0))
        {
            MessageBox.Show(this, "请您填写完整的信息");
        }
        else
        {
            Model.SelectRecord selectRecord = new Model.SelectRecord("WorkFlow", "", "*", "where id='" + this.selWorkFlow.SelectedValue + "'");
            DataTable          table        = BLL.SelectRecord.SelectRecordData(selectRecord).Tables[0];
            string             content      = File.ReadAllText(System.Web.HttpContext.Current.Request.MapPath("../") + table.Rows[0]["URL"].ToString());

            //ziyunhx add 2013-8-5 workflow Persistence
            //old code
            //WorkFlowTracking.instance = engineManager.createInstance(content, null, null);
            //WorkFlowTracking.instance.Run();
            //new code
            instance = engineManager.createInstance(content, null, null);
            if (instanceStore == null)
            {
                instanceStore = new SqlWorkflowInstanceStore(SqlHelper.strconn);
                view          = instanceStore.Execute(instanceStore.CreateInstanceHandle(), new CreateWorkflowOwnerCommand(), TimeSpan.FromSeconds(30));
                instanceStore.DefaultInstanceOwner = view.InstanceOwner;
            }
            instance.InstanceStore = instanceStore;
            instance.Run();
            //end

            Model.Document documents = new Model.Document
            {
                ID     = id.Trim(),
                Name   = this.txtName.Value.Trim(),
                URL    = this.uploadurl.Value.Trim(),
                Remark = this.txtReMark.Value.Trim(),
                WID    = this.selWorkFlow.SelectedValue,
                WStep  = "0",
                Result = "0",
                UID    = this.Session["admin"].ToString(),
                //ziyunhx add 2013-8-5 workflow Persistence
                //old code
                //FlowInstranceID = WorkFlowTracking.instance.Id,
                //new code
                FlowInstranceID = instance.Id,
                //end
            };

            if (BLL.Document.DocumentUpdate(documents) == 1)
            {
                UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "工作流管理", "编辑工作流" + documents.Name + "的信息成功");
                MessageBox.ShowAndRedirect(this, "编辑公文成功!", "/document/DocumentList.aspx");
            }
            else
            {
                UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "工作流管理", "编辑工作流" + documents.Name + "的信息失败");
                MessageBox.Show(this, "编辑工作流失败");
            }
        }
    }
Пример #3
0
    protected void btnEdit_ServerClick(object sender, EventArgs e)
    {
        string s = "";

        for (int j = 0; j < List_Organ.Items.Count; j++)
        {
            if (List_Organ.Items[j].Selected == true)
            {
                s += List_Organ.Items[j].Value.ToString() + ",";
            }
        }
        s = s.TrimEnd(',');

        Model.Users userInfo = new Model.Users
        {
            UserID    = this.txtUserID.Value,
            ID        = id,
            UserName  = this.txtUserName.Value,
            Telephone = this.txtTelephone.Value,
            QQ        = this.TextBox1.Value,
            Email     = this.txtEmail.Value,
            OID       = s
        };
        if (this.txtPassword.Value.Trim().Length > 0)
        {
            if (this.Password1.Value != this.txtPassword.Value)
            {
                MessageBox.Show(this, "您两次输入的密码不一样,请重新输入");
                return;
            }
            userInfo.Password = Security.Encrypt(this.txtPassword.Value, "12345678");
        }
        if (((userInfo.UserID.Length == 0) || (userInfo.Email.Length == 0)))
        {
            MessageBox.Show(this, "请您填写完整的信息");
        }
        else
        {
            if (BLL.Users.UserUpdate(userInfo) == 1)
            {
                BLL.Users.UserRoleEdit(id, this.selIsState.SelectedValue);
                UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "会员管理", "编辑会员" + userInfo.UserID + "信息成功");
                MessageBox.ShowAndRedirect(this, "编辑成功!", "/account/UserList.aspx");
            }
            else
            {
                UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "会员管理", "编辑会员" + userInfo.UserID + "信息失败");
                MessageBox.Show(this, "编辑失败!");
            }
        }
    }
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     Model.Organizational Organ = new Model.Organizational
     {
         ID   = id,
         Name = this.txtClassName.Text,
         PID  = this.ddlRootID.SelectedValue.ToString(),
     };
     if (BLL.Organizational.OrganUpdate(Organ) == 1)
     {
         UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "组织架构管理", "修改ID为" + id + "的岗位信息");
         MessageBox.ResponseScript(this, "alert('编辑岗位信息成功!');parent.location.href='/system/OrganList.aspx'");
     }
     else
     {
         MessageBox.Show(this, "编辑岗位信息有误,请您重新操作");
     }
 }
    protected void btnAdd_ServerClick(object sender, EventArgs e)
    {
        string s = "";

        for (int j = 0; j < List_Organ.Items.Count; j++)
        {
            if (List_Organ.Items[j].Selected == true)
            {
                s += List_Organ.Items[j].Value.ToString() + ",";
            }
        }
        s = s.TrimEnd(',');

        Model.Users userInfo = new Model.Users
        {
            UserID    = this.txtUserID.Value.Trim(),
            UserName  = this.txtUserName.Value.Trim(),
            Telephone = this.txtTelephone.Text.Trim(),
            QQ        = this.TextBox1.Text.Trim(),
            Password  = Security.Encrypt(this.txtPassword.Value, "12345678"),
            IsState   = "2",
            Email     = this.txtEmail.Value,
            OID       = s
        };
        if (((userInfo.UserID.Length == 0) || (userInfo.UserName.Length == 0)) || ((userInfo.QQ.Length == 0) || (userInfo.Email.Length == 0)))
        {
            MessageBox.Show(this, "请您填写完整的信息");
        }
        else
        {
            int i = BLL.Users.UserAdd(userInfo);
            if (i > 0)
            {
                BLL.Users.UserRoleAdd(i.ToString(), this.selIsState.SelectedValue);
                UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "会员管理", "创建会员" + userInfo.UserID + "用户名为" + userInfo.UserName + "的信息成功");
                MessageBox.ShowAndRedirect(this, "创建用户成功", "/account/UserList.aspx");
            }
            else
            {
                UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "会员管理", "创建会员" + userInfo.UserID + "用户名为" + userInfo.UserName + "的信息失败");
                MessageBox.Show(this, "创建用户失败");
            }
        }
    }
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     if (this.txtClassName.Text.Length == 0)
     {
         MessageBox.Show(this, "请填写完整的网站类别信息");
     }
     else
     {
         Model.Organizational Organ = new Model.Organizational
         {
             Name = this.txtClassName.Text,
             PID  = this.ddlRootID.SelectedValue.ToString(),
         };
         if (BLL.Organizational.OrganAdd(Organ) > 0)
         {
             UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "组织结构管理", "添加了一个新的岗位,名称为:" + this.txtClassName.Text);
             MessageBox.ResponseScript(this, "alert('添加岗位信息成功!');parent.location.href='/system/OrganList.aspx'");
         }
         else
         {
             MessageBox.Show(this, "创建岗位信息有误,请您重新操作");
         }
     }
 }
    //end

    protected void btnEdit_ServerClick(object sender, EventArgs e)
    {
        if (this.DropDown_sp.SelectedValue.Length == 0)
        {
            MessageBox.Show(this, "请您选择审核结果");
        }
        else
        {
            Model.SelectRecord selectRecords = new Model.SelectRecord("view_DocumentInfo", "", "*", "where id='" + id + "'");
            DataTable          dt            = BLL.SelectRecord.SelectRecordData(selectRecords).Tables[0];
            //ziyunhx add 2013-8-5 workflow Persistence
            if (dt == null)
            {
                return;
            }
            Model.SelectRecord selectRecord = new Model.SelectRecord("WorkFlow", "", "*", "where id='" + dt.Rows[0]["WorkFlowID"].ToString() + "'");
            DataTable          table        = BLL.SelectRecord.SelectRecordData(selectRecord).Tables[0];

            string content = File.ReadAllText(System.Web.HttpContext.Current.Request.MapPath("../") + table.Rows[0]["URL"].ToString());

            instance = engineManager.createInstance(content, null, null);
            if (instanceStore == null)
            {
                instanceStore = new SqlWorkflowInstanceStore(SqlHelper.strconn);
                view          = instanceStore.Execute(instanceStore.CreateInstanceHandle(), new CreateWorkflowOwnerCommand(), TimeSpan.FromSeconds(30));
                instanceStore.DefaultInstanceOwner = view.InstanceOwner;
            }
            instance.InstanceStore = instanceStore;
            Guid guid = new Guid(dt.Rows[0]["FlowInstranceID"].ToString());
            instance.Load(guid);
            //end


            if (this.DropDown_sp.SelectedValue == "true")
            {
                string[] s = dt.Rows[0]["OID"].ToString().Split(new char[] { ',' });
                if (s[s.Length - 1] == "1")
                {
                    Model.SelectRecord selectExecut = new Model.SelectRecord("WorkFlowExecution", "", "*", "where DID='" + id + "' and step ='" + dt.Rows[0]["WStep"].ToString() + "' and UID='" + this.Session["admin"].ToString() + "'");
                    DataTable          executdt     = BLL.SelectRecord.SelectRecordData(selectExecut).Tables[0];
                    if (executdt.Rows.Count > 0)
                    {
                        MessageBox.ShowAndRedirect(this, "该公文您已审核,请等待其他人审核!", "/document/DocumentList.aspx");
                    }
                    else
                    {
                        Model.SelectRecord selectExecutCount = new Model.SelectRecord("WorkFlowExecution", "", "distinct UID", "where DID='" + id + "' and step ='" + dt.Rows[0]["WStep"].ToString() + "'");
                        DataTable          dtcount           = BLL.SelectRecord.SelectRecordData(selectExecutCount).Tables[0];

                        string where = "where IsState=2 AND (1=2 ";

                        string[] str = dt.Rows[0]["OID"].ToString().Split(new char[] { ',' });
                        for (int j = 1; j < str.Length - 1; j++)
                        {
                            where += "OR OID like '%" + str[j].ToString() + "%' ";
                        }
                        where += ") order by id desc";

                        Model.SelectRecord selectUserCount = new Model.SelectRecord("Users", "", "ID", where);
                        DataTable          usercount       = BLL.SelectRecord.SelectRecordData(selectUserCount).Tables[0];

                        if (dtcount.Rows.Count + 1 == usercount.Rows.Count)
                        {
                            if (instance.GetBookmarks().Count(p => p.BookmarkName == dt.Rows[0]["value"].ToString()) == 1)
                            {
                                instance.ResumeBookmark(dt.Rows[0]["value"].ToString(), this.DropDown_sp.SelectedValue.ToString());
                            }
                        }
                    }
                }
                else
                {
                    //一旦审批未通过,删除该公文当前流转步骤信息
                    BLL.GeneralMethods.GeneralDelDB("WorkFlowExecution", "where DID ='" + id + "' and step='" + dt.Rows[0]["WStep"].ToString() + "'");
                    if (instance.GetBookmarks().Count(p => p.BookmarkName == dt.Rows[0]["value"].ToString()) == 1)
                    {
                        instance.ResumeBookmark(dt.Rows[0]["value"].ToString(), this.DropDown_sp.SelectedValue.ToString());
                    }
                }

                Model.WorkFlowExecution workexe = new Model.WorkFlowExecution
                {
                    DID    = dt.Rows[0]["ID"].ToString(),
                    UID    = this.Session["admin"].ToString(),
                    step   = dt.Rows[0]["WStep"].ToString(),
                    Remark = this.txtSP.Value.Trim(),
                    Result = "1",
                };

                BLL.WorkFlowExecution.Add(workexe);
            }
            else
            {
                Model.WorkFlowExecution workexe = new Model.WorkFlowExecution
                {
                    DID    = dt.Rows[0]["ID"].ToString(),
                    UID    = this.Session["admin"].ToString(),
                    step   = dt.Rows[0]["WStep"].ToString(),
                    Remark = this.txtSP.Value.Trim(),
                    Result = "2",
                };

                BLL.WorkFlowExecution.Add(workexe);

                if (instance.GetBookmarks().Count(p => p.BookmarkName == dt.Rows[0]["value"].ToString()) == 1)
                {
                    instance.ResumeBookmark(dt.Rows[0]["value"].ToString(), this.DropDown_sp.SelectedValue.ToString());
                }
            }
            UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "公文管理", "公文审核" + dt.Rows[0]["Name"].ToString() + "的信息成功");
            MessageBox.ShowAndRedirect(this, "审核公文成功!", "/document/DocumentList.aspx");

            instance.Unload();
        }
    }
    protected void btnAdd_ServerClick(object sender, EventArgs e)
    {
        //创建公文授权
        string addorgan = ",";

        for (int a1 = 0; a1 < this.List_ADDOrgan.Items.Count; a1++)
        {
            if (List_ADDOrgan.Items[a1].Selected == true)
            {
                addorgan += List_ADDOrgan.Items[a1].Value + ",";
            }
        }
        Model.WorkFlowRole addwork = new Model.WorkFlowRole
        {
            OID   = addorgan,
            WID   = id,
            WSTEP = "0",
            State = "1",
            name  = "创建公文",
            value = "0",
        };
        BLL.WorkFlowRole.WorkFlowRoleAdd(addwork);

        //公文流转授权
        string qx = Request.Form["options"].ToString();

        string[] s = qx.Split(new char[] { ';' });
        for (int i = 0; i < s.Length - 1; i++)
        {
            ArrayList          temp     = (ArrayList)str[i];
            Model.WorkFlowRole workrole = new Model.WorkFlowRole {
                OID   = "," + s[i].ToString(),
                WID   = id,
                WSTEP = temp[1].ToString(),
                State = "1",
                name  = temp[0].ToString(),
                value = temp[2].ToString(),
            };
            BLL.WorkFlowRole.WorkFlowRoleAdd(workrole);
        }

        //发布公文授权
        string publicorgan = ",";

        for (int a2 = 0; a2 < this.List_PublicOrgan.Items.Count; a2++)
        {
            if (List_PublicOrgan.Items[a2].Selected == true)
            {
                publicorgan += List_PublicOrgan.Items[a2].Value + ",";
            }
        }
        Model.WorkFlowRole publicwork = new Model.WorkFlowRole
        {
            OID   = publicorgan,
            WID   = id,
            WSTEP = "999",
            State = "1",
            name  = "发布公文",
            value = "0",
        };
        BLL.WorkFlowRole.WorkFlowRoleAdd(publicwork);

        //查阅公文授权
        string readorgan = ",";

        for (int a3 = 0; a3 < this.List_Read.Items.Count; a3++)
        {
            if (List_Read.Items[a3].Selected == true)
            {
                readorgan += List_Read.Items[a3].Value + ",";
            }
        }
        Model.WorkFlowRole readwork = new Model.WorkFlowRole
        {
            OID   = readorgan,
            WID   = id,
            WSTEP = "1000",
            State = "1",
            name  = "查阅公文",
            value = "0",
        };
        BLL.WorkFlowRole.WorkFlowRoleAdd(readwork);

        UserOperatingManager.InputUserOperating(this.Session["admin"].ToString(), "工作流管理", "工作流授权" + "成功");
        MessageBox.ShowAndRedirect(this, "工作流活动授权成功!", "/workflow/WorkFlowList.aspx");
    }