protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["Type"])) { if (Request.QueryString["Type"].Equals("Add")) { this.EquipmentFormView.ChangeMode(FormViewMode.Insert); } } if (EquipmentFormView.CurrentMode == FormViewMode.ReadOnly) { //如果单据不是申请状态,则控制修改/删除/提交/作废等按钮 RmsOA.BFL.GK_OA_EquipmentMaintainApplyBFL bfl = new RmsOA.BFL.GK_OA_EquipmentMaintainApplyBFL(); RmsOA.MODEL.GK_OA_EquipmentMaintainApplyModel model = new RmsOA.MODEL.GK_OA_EquipmentMaintainApplyModel(); model = bfl.GetGK_OA_EquipmentMaintainApply(Convert.ToInt32(Request["Code"])); if (model.State != "0") { HtmlInputButton btnRequisition = ((HtmlInputButton)this.EquipmentFormView.Row.FindControl("btnRequisition")); btnRequisition.Visible = false; this.EquipmentFormView.Row.FindControl("EditButton").Visible = false; this.EquipmentFormView.Row.FindControl("DeleteButton").Visible = false; this.EquipmentFormView.Row.FindControl("btnBankOut").Visible = false; } } } }
protected void ObjectDataSource1_Selected(object sender, ObjectDataSourceStatusEventArgs e) { RmsOA.MODEL.GK_OA_EquipmentMaintainApplyModel manpowerneedModel = bfl.GetGK_OA_EquipmentMaintainApply(int.Parse(Request.QueryString["Code"])); this.ApplicationTitle = "设备维护申请"; this.UnitCode = manpowerneedModel.Dept; }