protected void Gv_Task_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["style"] = "Cursor:pointer"; int itemp = e.Row.Cells.Count; for (int i = 1; i < itemp; i++) { e.Row.Cells[i].Attributes.Add("OnDblClick", "window.location.href='AppTask.aspx?ID=" + Gv_Task.DataKeys[Gv_Task.DataKeys.Count - 1].Value.ToString() + " '"); } int code = e.Row.RowIndex + 1; e.Row.Cells[0].Text = code.ToString(); ExtendBLL.ApplicationAndItem Application = new ExtendBLL.ApplicationAndItem(); int ID=0; bool visible = false; if (int.TryParse(Gv_Task.DataKeys[e.Row.RowIndex].Value.ToString(), out ID)) { if (ID > 0) { if (Application.CoutAttachmentItem(ID,"2") > 0) { visible = true; } } } Button btn = (Button)e.Row.FindControl("Build"); if (btn != null) { if (e.Row.Cells[10].Text == "��֤ͨ��" && visible) { btn.Visible = true; } else { btn.Visible = false; } } } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("JSXMRWS"); strPagePrivilege.Add("mana"); if (!Page.IsPostBack) { if (Request.QueryString["ID"] != null) { int ID = 0; if (int.TryParse(Request.QueryString["ID"], out ID)) { if (ID > 0) { HF_QueryString = ID; DataBinds(); AttachItemDataBind(); ExtendBLL.ApplicationAndItem Application = new ExtendBLL.ApplicationAndItem(); LabMS.BLL.ProjectApp application=new LabMS.BLL.ProjectApp(); LabMS.Model.ProjectApp model=application.GetModel(ID); if(model!=null) { if (model.App_State == "Approved"&&Application.CoutAttachmentItem(ID,"2")>0) { Build.Visible = true; } else { Build.Visible = false; } if (model.App_State == "Approved") { edit.Visible = true; } else { edit.Visible = false; } } } } } else { LabMS.Common.JShelper.JSAlert(this, "��ѯ�ַ�������", "��ѯ�ַ�������Ϊ��"); return; } } }