protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (!String.IsNullOrEmpty(Request.QueryString["Type"]))
            {
                if (Request.QueryString["Type"].Equals("Add"))
                {
                    this.AccountFormView.ChangeMode(FormViewMode.Insert);
                    return;
                }
            }
        }

        if (AccountFormView.CurrentMode == FormViewMode.ReadOnly)
        {
            //如果单据不是申请状态,则控制修改/删除/提交/作废等按钮
            RmsOA.BFL.GK_OA_CapitalAssertAcountBFL     bfl   = new RmsOA.BFL.GK_OA_CapitalAssertAcountBFL();
            RmsOA.MODEL.GK_OA_CapitalAssertAcountModel model = new RmsOA.MODEL.GK_OA_CapitalAssertAcountModel();
            model = bfl.GetGK_OA_CapitalAssertAcount(Convert.ToInt32(Request["Code"]));
            if (model.Status != "0")
            {
                HtmlInputButton btnRequisition = ((HtmlInputButton)this.AccountFormView.Row.FindControl("btnRequisition"));
                btnRequisition.Visible = false;

                this.AccountFormView.Row.FindControl("EditButton").Visible   = false;
                this.AccountFormView.Row.FindControl("DeleteButton").Visible = false;
                this.AccountFormView.Row.FindControl("btnBankOut").Visible   = false;
            }
        }
    }
Beispiel #2
0
 protected void ObjectDataSource1_Selected(object sender, ObjectDataSourceStatusEventArgs e)
 {
     RmsOA.MODEL.GK_OA_CapitalAssertAcountModel manpowerneedModel = ((List <RmsOA.MODEL.GK_OA_CapitalAssertAcountModel>)e.ReturnValue)[0];
     this.ApplicationTitle = "固定资产台帐";
     this.UnitCode         = manpowerneedModel.Dept;
 }