protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["Code"] + "" == "")
            {
                FormView1.ChangeMode(FormViewMode.Insert);
            }

            if (FormView1.CurrentMode == FormViewMode.ReadOnly)
            {
                if (user.HasRight("050103"))
                {
                    this.FormView1.Row.FindControl("EditButton").Visible = true;
                }
                else
                {
                    this.FormView1.Row.FindControl("EditButton").Visible = false;
                }
                if (user.HasRight("050103"))
                {
                    this.FormView1.Row.FindControl("DeleteButton").Visible = true;
                }
                else
                {
                    this.FormView1.Row.FindControl("DeleteButton").Visible = false;
                }
                WorkFlowControl_WorkFlowList work = (WorkFlowControl_WorkFlowList)this.FormView1.Row.FindControl("WorkFlowList1");
                work.ProcedureNameAndApplicationCodeList = "'文件承办单审批" + this.FormView1.DataKey.Value.ToString() + "'";
                work.DataBound();
            }
        }
    }
 protected void AccountFormView_DataBound(object sender, EventArgs e)
 {
     if (this.AccountFormView.CurrentMode == FormViewMode.ReadOnly)
     {
         if (!user.HasRight("330302"))
         {
             Button btEdit = (Button)(this.AccountFormView.Row.FindControl("EditButton"));
             btEdit.Visible = false;
         }
         if (!user.HasRight("320303"))
         {
             Button btDelete = (Button)(this.AccountFormView.Row.FindControl("DeleteButton"));
             btDelete.Visible = false;
         }
         if (!user.HasRight("320304"))
         {
             HtmlInputButton btSubmit = (HtmlInputButton)(this.AccountFormView.Row.FindControl("btnRequisition"));
             btSubmit.Visible = false;
         }
         if (!user.HasRight("320305"))
         {
             Button btBankOut = (Button)(this.AccountFormView.Row.FindControl("btnBankOut"));
             btBankOut.Visible = false;
         }
         WorkFlowControl_WorkFlowList work = (WorkFlowControl_WorkFlowList)this.AccountFormView.Row.FindControl("WorkFlowList1");
         work.ProcedureNameAndApplicationCodeList = "'固定资产台帐" + this.AccountFormView.DataKey.Value.ToString() + "'";
         work.DataBound();
     }
 }
Esempio n. 3
0
 protected void MeetFormView_DataBound(object sender, EventArgs e)
 {
     if (this.MeetFormView.CurrentMode == FormViewMode.ReadOnly)
     {
         if (!user.HasRight("320202"))
         {
             Button btEdit = (Button)(this.MeetFormView.Row.FindControl("EditButton"));
             btEdit.Visible = false;
         }
         if (!user.HasRight("320203"))
         {
             Button btDelete = (Button)(this.MeetFormView.Row.FindControl("DeleteButton"));
             btDelete.Visible = false;
         }
         if (!user.HasRight("320204"))
         {
             HtmlInputButton btSubmit = (HtmlInputButton)(this.MeetFormView.Row.FindControl("btnRequisition"));
             btSubmit.Visible = false;
         }
         if (!user.HasRight("320205"))
         {
             Button btBankOut = (Button)(this.MeetFormView.Row.FindControl("btnBankOut"));
             btBankOut.Visible = false;
         }
         AttendPersonLabel.Text      = ChangeCodeToName(HidAttendPerson.Value);
         OtherAttendPersonLabel.Text = ChangeCodeToName(HidOtherAttend.Value);
         WorkFlowControl_WorkFlowList work = (WorkFlowControl_WorkFlowList)this.MeetFormView.Row.FindControl("WorkFlowList1");
         work.ProcedureNameAndApplicationCodeList = "'会议纪要审批" + this.MeetFormView.DataKey.Value.ToString() + "'";
         work.DataBound();
     }
 }
    protected void EquipmentFormView_DataBound(object sender, EventArgs e)
    {
        if (this.EquipmentFormView.CurrentMode == FormViewMode.ReadOnly)
        {
            if (!user.HasRight("330102"))
            {
                Button btEdit = (Button)(this.EquipmentFormView.Row.FindControl("EditButton"));
                btEdit.Visible = false;
            }
            if (!user.HasRight("330103"))
            {
                Button btDelete = (Button)(this.EquipmentFormView.Row.FindControl("DeleteButton"));
                btDelete.Visible = false;
            }
            if (!user.HasRight("330104"))
            {
                HtmlInputButton btSubmit = (HtmlInputButton)(this.EquipmentFormView.Row.FindControl("btnRequisition"));
                btSubmit.Visible = false;
            }
            if (!user.HasRight("330105"))
            {
                Button btBankOut = (Button)(this.EquipmentFormView.Row.FindControl("btnBankOut"));
                btBankOut.Visible = false;
            }
            WorkFlowControl_WorkFlowList work = (WorkFlowControl_WorkFlowList)this.EquipmentFormView.Row.FindControl("WorkFlowList1");
            work.ProcedureNameAndApplicationCodeList = "'设备维护申请" + this.EquipmentFormView.DataKey.Value.ToString() + "'";
            work.DataBound();


            HiddenField userHF      = (HiddenField)this.EquipmentFormView.Row.FindControl("UserHiddenField");
            Label       labUserCode = (Label)this.EquipmentFormView.Row.FindControl("UserCodeLabel");
            labUserCode.Text = RmsPM.BLL.SystemRule.GetUserName(userHF.Value);
        }

        if (this.EquipmentFormView.CurrentMode == FormViewMode.Edit)
        {
            HiddenField ruhf = (HiddenField)this.EquipmentFormView.Row.FindControl("UserHiddenField");
            Label       rulb = (Label)this.EquipmentFormView.Row.FindControl("UserCodeLabel");
            rulb.Text = RmsPM.BLL.SystemRule.GetUserName(ruhf.Value);
        }

        if (this.EquipmentFormView.CurrentMode == FormViewMode.Insert)
        {
            HiddenField hfUser  = (HiddenField)this.EquipmentFormView.Row.FindControl("UserHiddenField");
            Label       lblUser = (Label)this.EquipmentFormView.Row.FindControl("UserCodeLabel");

            User u = (User)Session["User"];
            hfUser.Value = u.UserCode;
            lblUser.Text = RmsPM.BLL.SystemRule.GetUserName(u.UserCode);
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["Code"] + "" == "")
            {
                FormView1.ChangeMode(FormViewMode.Insert);
            }

            if (FormView1.CurrentMode == FormViewMode.ReadOnly)
            {
                if (user.HasRight("320302"))
                {
                    this.FormView1.Row.FindControl("EditButton").Visible = true;
                }
                else
                {
                    this.FormView1.Row.FindControl("EditButton").Visible = false;
                }
                if (user.HasRight("320303"))
                {
                    this.FormView1.Row.FindControl("DeleteButton").Visible = true;
                }
                else
                {
                    this.FormView1.Row.FindControl("DeleteButton").Visible = false;
                }

                if (user.HasRight("320304"))
                {
                    this.FormView1.Row.FindControl("btnRequisition").Visible = true;
                }
                else
                {
                    this.FormView1.Row.FindControl("btnRequisition").Visible = false;
                }

                if (user.HasRight("320305"))
                {
                    this.FormView1.Row.FindControl("btnBankOut").Visible = true;
                }
                else
                {
                    this.FormView1.Row.FindControl("btnBankOut").Visible = false;
                }
                WorkFlowControl_WorkFlowList work = (WorkFlowControl_WorkFlowList)this.FormView1.Row.FindControl("WorkFlowList1");
                work.ProcedureNameAndApplicationCodeList = "'文件更改审批" + this.FormView1.DataKey.Value.ToString() + "'";
                work.DataBound();


                //如果单据不是申请状态,则控制修改/删除/提交/作废等按钮

                RmsOA.BFL.GK_OA_FileChangeBFL     bfl   = new RmsOA.BFL.GK_OA_FileChangeBFL();
                RmsOA.MODEL.GK_OA_FileChangeModel model = new RmsOA.MODEL.GK_OA_FileChangeModel();
                model = bfl.GetGK_OA_FileChange(Convert.ToInt32(Request["Code"]));
                if (model.Status != "0")
                {
                    HtmlInputButton btnRequisition = ((HtmlInputButton)this.FormView1.Row.FindControl("btnRequisition"));
                    btnRequisition.Visible = false;

                    this.FormView1.Row.FindControl("EditButton").Visible   = false;
                    this.FormView1.Row.FindControl("DeleteButton").Visible = false;
                    this.FormView1.Row.FindControl("btnBankOut").Visible   = false;
                }
            }
        }
    }