示例#1
0
    //资产审批的删除和批阅
    protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.Item.FindControl("seldoc") != null)
        {
            string id = (e.Item.FindControl("seldoc") as Label).Text.Trim();
            if (e.CommandName == "delete")
            {
                U_ZCSPBU sp1 = new U_ZCSPBU();
                sp1.DelSp(id);
                this.BindSP(sp1);
                sp1.Close();
            }
            else
            {
                Context.Items["zcid"] = Request.QueryString["id"];
                Context.Items["id"]   = id;
                Context.Items["kind"] = (e.Item.FindControl("kind") as Label).Text.Trim();
                Context.Items["czid"] = this.zcczid.Text;

                //检测【审核委员会主席】和【决策委员会主席】能否审批
                U_ZCSPBU sp2       = new U_ZCSPBU();
                int      nospcount = sp2.GetNoEndSPCount(Request.QueryString["id"]);
                sp2.Close();

                bool   check1   = false;
                string rolename = "";
                if (this.status.Text == (int)SP.审核委员会审批 + "")
                {
                    rolename = "审核委员会主席";
                }
                if (this.status.Text == (int)SP.决策委员会审批 + "")
                {
                    rolename = "决策委员会主席";
                }
                if (rolename != "")
                {
                    check1 = PubComm.IsRole(rolename);
                }

                if (check1 && nospcount > 1)
                {
                    Util.alert(this.Page, "抱歉,您是【" + rolename + "】,请等其他委员审批结束后,才能审批");
                }
                else
                {
                    if (check1)
                    {
                        Context.Items["zhuxi"] = "1";
                    }
                    Server.Transfer("PiYue" + (e.Item.FindControl("kind") as Label).Text.Trim() + ".aspx?bkind=0", false);
                }
            }
        }
    }