//



        protected void Page_Load(object sender, System.EventArgs e)
        {
            AttachMentAdd1.AttachMentType = "WorkFlowActOpinion";
            AttachMentAdd1.MasterCode     = Request["ActCode"] + "";
            if (!IsPostBack)
            {
                IniPage();
                LoadData();

                BLL.TemplateOpinion to = new BLL.TemplateOpinion();
                to.UserCode = ((User)Session["User"]).UserCode;
                DataTable dt = to.GetTemplateOpinions();
                if (dt.Rows.Count == 0)
                {
                    this.sltTemplateOpinion.Visible = false;
                }
                else
                {
                    this.sltTemplateOpinion.Visible        = true;
                    this.sltTemplateOpinion.DataSource     = dt;
                    this.sltTemplateOpinion.DataTextField  = "Name";
                    this.sltTemplateOpinion.DataValueField = "Center";
                    this.sltTemplateOpinion.DataBind();
                    ListItem li = new ListItem();
                    li.Text     = "--常用意见--";
                    li.Value    = "";
                    li.Selected = true;
                    this.sltTemplateOpinion.Items.Add(li);
                    this.sltTemplateOpinion.Attributes["onchange"] = "javascript:document.all('FlowOpinion').value = this.value;";
                }
            }
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                ///////////////////////////////////////////////////
                string code          = Request["ApplicationCode"] + "";
                string caseCode      = Request["CaseCode"] + "";
                string procedureCode = Request["ProcedureCode"] + "";
                string procedureName = Request["ProcedureName"] + "";
                string userCode      = Request["UserCode"] + "";
                string unitCode      = Request["UnitCodeCode"] + "";
                this.ProjectCode = Request["ProjectCode"] + "";
                //if (procedureCode == "")
                //    procedureCode = BLL.WorkFlowRule.GetProcedureCodeByName(procedureName);
                bool      isNew          = (caseCode == "");
                Procedure procedure      = DefinitionManager.GetProcedureDifinition(procedureCode, true);
                string    currentActCode = Request["ActCode"] + "";
                Act       currentAct     = null;
                string    actCode        = "";
                WorkCase  workCase       = null;
                if (isNew)
                {
                    workCase   = Rms.WorkFlow.WorkCaseManager.StartNewWorkCase(code, procedureCode, userCode, unitCode, ref actCode, "", "");
                    currentAct = (Act)(WorkCaseManager.GetActivityAct(workCase)[0]);
                }
                else
                {
                    workCase   = Rms.WorkFlow.WorkCaseManager.GetWorkCase(caseCode);
                    currentAct = workCase.GetAct(Request["ActCode"] + "");
                }
                this.txtCurrentActCode.Value = currentAct.ActCode;
                Task currentTask = procedure.GetTask(currentAct.ToTaskCode);
                ///////////////////////////////////////////////////

                if (currentTask.CanManual == 1)
                {
                    this.SendTable.Visible    = false;
                    this.SendTitle.Visible    = false;
                    this.CopyTable.Visible    = false;
                    this.CopyTitle.Visible    = false;
                    this.OpinionTitle.Visible = false;
                    this.OpinionTable.Visible = false;
                    this.MessageTitle.Visible = false;
                    this.MessageTable.Visible = false;
                    this.ButtonTable.Visible  = false;
                    this.pwdcheckdiv.Visible  = true;
                }
                else
                {
                    InitPageState();
                }
                BLL.TemplateOpinion to = new BLL.TemplateOpinion();
                to.UserCode = ((User)Session["User"]).UserCode;
                DataTable dt = to.GetTemplateOpinions();
                if (dt.Rows.Count == 0)
                {
                    this.sltTemplateOpinion.Visible = false;
                }
                else
                {
                    this.sltTemplateOpinion.Visible        = true;
                    this.sltTemplateOpinion.DataSource     = dt;
                    this.sltTemplateOpinion.DataTextField  = "Name";
                    this.sltTemplateOpinion.DataValueField = "Center";
                    this.sltTemplateOpinion.DataBind();
                    ListItem li = new ListItem();
                    li.Text     = "--常用意见--";
                    li.Value    = "";
                    li.Selected = true;
                    this.sltTemplateOpinion.Items.Add(li);
                    this.sltTemplateOpinion.Attributes["onchange"] = "javascript:document.all('FlowOpinion').value = this.value;";
                }
                this.rdoCheck.Visible = (Request["IsAudit"] + "" == "1");
            }
        }
        /// <summary>
        /// 编辑状态加载
        /// </summary>
        /// <param name="OpinionText"></param>
        /// <param name="OpinionUser"></param>
        /// <param name="OpinionDate"></param>
        private void EditBound(string OpinionTextValue, string OpinionUserValue, string OpinionDateValue)
        {
            this.OpinionLabel.Visible       = false;
            this.OpinionTextAreaDiv.Visible = false;
            if (this.ControlType == "Text")
            {
                this.OpinionText.Value          = OpinionTextValue;
                this.OpinionText.Visible        = true;
                this.OpinionNum.Visible         = false;
                this.OpinionDiv.Visible         = false;
                this.OpinionTextArea.Visible    = false;
                this.OpinionUserAndDate.Visible = false;
            }
            else if (this.ControlType == "TextArea")
            {
                this.OpinionTextArea.Value = OpinionTextValue;
                if (OpinionUserValue == "")
                {
                    string UserName = RmsPM.BLL.SystemRule.GetUserNameByProjectCode(this.ProjectCode, ((User)Session["User"]).UserName, ((User)Session["User"]).UserShortName, null);
                    this.OpinionUser.InnerHtml = UserName;

                    this.OpinionDate.InnerHtml = DateTime.Now.ToShortDateString();
                }
                else
                {
                    this.OpinionUser.InnerHtml = OpinionUserValue;
                    this.OpinionDate.InnerHtml = OpinionDateValue;
                }
                this.OpinionText.Visible        = false;
                this.OpinionNum.Visible         = false;
                this.OpinionDiv.Visible         = true;
                this.OpinionTextArea.Visible    = true;
                this.OpinionUserAndDate.Visible = true;

                BLL.TemplateOpinion to = new BLL.TemplateOpinion();
                to.UserCode = ((User)Session["User"]).UserCode;
                DataTable dt = to.GetTemplateOpinions();
                if (dt.Rows.Count == 0)
                {
                    this.sltTemplateOpinion.Visible = false;
                }
                else
                {
                    this.sltTemplateOpinion.Visible        = true;
                    this.sltTemplateOpinion.DataSource     = dt;
                    this.sltTemplateOpinion.DataTextField  = "Name";
                    this.sltTemplateOpinion.DataValueField = "Center";
                    this.sltTemplateOpinion.DataBind();
                    ListItem li = new ListItem();
                    li.Text     = "--常用意见--";
                    li.Value    = "";
                    li.Selected = true;
                    this.sltTemplateOpinion.Items.Add(li);
                    this.sltTemplateOpinion.Attributes["onchange"] = "javascript:document.all('" + this.ClientID + "_OpinionTextArea').value = this.value;";
                }
            }
            else if (this.ControlType == "TextAreaEsay")
            {
                this.OpinionTextArea.Value      = OpinionTextValue;
                this.OpinionText.Visible        = false;
                this.OpinionNum.Visible         = false;
                this.OpinionDiv.Visible         = true;
                this.OpinionTextArea.Visible    = true;
                this.OpinionUserAndDate.Visible = false;
            }
            else if (this.ControlType == "TextNum")
            {
                this.OpinionNum.Value           = OpinionTextValue;
                this.OpinionText.Visible        = false;
                this.OpinionNum.Visible         = true;
                this.OpinionDiv.Visible         = false;
                this.OpinionTextArea.Visible    = false;
                this.OpinionUserAndDate.Visible = false;
            }
        }