Ejemplo n.º 1
0
    void Repeater3_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        DataRow   dr    = (e.Item.DataItem as DataRowView).Row;
        HyperLink hyer1 = e.Item.FindControl("hyper1") as HyperLink;
        HyperLink hyer2 = e.Item.FindControl("hyper2") as HyperLink;

        if (dr != null)
        {
            String ajnum    = dr["ajnum"].ToString();
            bool   iscanSee = DangAnBU.isCanSeeFile(ajnum);
            if (iscanSee == false)
            {
                hyer1.Visible     = false;
                hyer2.Visible     = true;
                hyer2.NavigateUrl = "borrow.aspx?ajnum=" + ajnum;
            }
            else
            {
                hyer1.Visible     = true;
                hyer2.Visible     = false;
                hyer1.NavigateUrl = "~/SeeDAFile.aspx?fileName=" + dr["ajtruefile"].ToString();
                hyer1.Target      = "_blank";
            }
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Comm.SetDepart(this.depart, "");
            DataRow dr1 = null;
            if (Request["id"] != null)
            {
                dr1 = DangAnBU.GetAdmin(Request["id"]);
                if (dr1 != null)
                {
                    this.num.Text = dr1["num"].ToString().Trim();
                    if (this.depart.Items.FindByValue(dr1["depart"].ToString().Trim()) != null)
                    {
                        this.depart.SelectedValue = dr1["depart"].ToString().Trim();
                    }
                }
            }

            this.SetUserList();
            if (dr1 != null)
            {
                if (this.sname.Items.FindByValue(dr1["sname"].ToString().Trim()) != null)
                {
                    this.sname.SelectedValue = dr1["sname"].ToString().Trim();
                }
            }
        }
    }
    //delete data
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string id = this.GridView1.DataKeys[e.RowIndex].Value.ToString();

        DangAnBU.DeleteAdmin(id);
        this.BindData();
    }
    //bind data1
    private void BindData()
    {
        DataSet ds1 = DangAnBU.GetAdminList();

        this.GridView1.DataSource = ds1;
        this.GridView1.DataBind();
    }
Ejemplo n.º 5
0
    //处理数据的绑定
    void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        DataRowView dv = e.Row.DataItem as DataRowView;

        if (dv != null)
        {
            DataRow    dr    = dv.Row;
            LinkButton link1 = e.Row.FindControl("link1") as LinkButton;
            LinkButton link2 = e.Row.FindControl("link2") as LinkButton;
            if (dr != null && link1 != null && link2 != null)
            {
                String checktime = dr["CheckTime"].ToString();
                if (checktime != String.Empty)   //表示是已审批过的档案列表
                {
                    link1.Visible = false;
                    link2.Visible = false;
                }
                else
                {
                    bool isAdmin = DangAnBU.IsAdminForDAByID(dr["ajnum"].ToString().Trim());
                    if (isAdmin == false)
                    {
                        link2.Visible = false;
                        link1.Visible = false;
                    }
                    else
                    {
                        link2.Visible = true;
                        link1.Visible = true;
                    }
                }
            }
        }
    }
Ejemplo n.º 6
0
    //提交确定按钮
    void Button1_Click(object sender, EventArgs e)
    {
        String result = DangAnBU.BorrorAnJuan(this.ajnum.Text, this.time0.Text, this.borrow.Text, this.remark.Text);

        if (String.IsNullOrEmpty(result))
        {
            Util.alert(this.Page, "提示:档案借阅申请操作成功!", "BorrowList.aspx");
        }
        else
        {
            Util.alert(this.Page, result);
        }
    }
Ejemplo n.º 7
0
    //处理档案数据的处理
    void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        bool   flag = false;
        String do1  = e.CommandName;
        String arg  = e.CommandArgument.ToString();

        if (do1 == "agree")
        {
            flag = true;
        }
        DangAnBU.ShenPiDangAn(arg, flag);
        this.BindData();
    }
Ejemplo n.º 8
0
    //提交保存数据
    void Button1_Click(object sender, EventArgs e)
    {
        String num1    = this.num.Text.Trim();
        String depart1 = this.depart.SelectedValue;
        String sname1  = this.sname.SelectedValue;
        String id1     = Request.QueryString["id"];

        if (String.IsNullOrEmpty(id1))
        {
            id1 = "-1";
        }

        DangAnBU.UpdateAdmin(id1, num1, depart1, sname1);
        Util.alert(this.Page, "提示:操作成功!", "DangAnDepartManageList.aspx");
    }
Ejemplo n.º 9
0
 /// <summary>
 /// 档案申请单的查询范围
 /// 1、admin可以查询所有,并可处理所有
 /// 2、可以查询自己申请
 /// 3、可以查询自己负责审批的所有单据
 /// </summary>
 /// <param name="curpage"></param>
 /// <param name="totalRow"></param>
 /// <returns></returns>
 private DataSet GetData(int curpage, out int totalRow)
 {
     return(DangAnBU.GetBorrowList(curpage, this.PageNavigator1.PageSize,
                                   out totalRow, this.ajnum.Text, this.domen.Text));
 }