protected void FormView1_DataBound(object sender, EventArgs e) { switch (this.FormView1.CurrentMode) { case FormViewMode.Edit: HtmlInputControl TemplateNameHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateName"); HtmlInputControl TemplateHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateCode"); TemplateNameHIC.Value = RmsDM.BFL.FileTemplateBFL.GetTemplateName(TemplateHIC.Value); HtmlInputHidden tbxUnitCode = (HtmlInputHidden)this.FormView1.Row.FindControl("txtUnit"); HtmlInputText tbxUnitName = (HtmlInputText)this.FormView1.Row.FindControl("txtUnitName"); tbxUnitName.Value = RmsPM.BLL.SystemRule.GetUnitName(tbxUnitCode.Value); break; case FormViewMode.Insert: RmsDM.BFL.DocumentDirectoryBFL docDirBFL = new RmsDM.BFL.DocumentDirectoryBFL(); RmsDM.MODEL.DocumentDirectoryModel ddModel = docDirBFL.GetDocumentDirectory(int.Parse(Request["DirectorCode"])); int FileTemplateCode = ddModel.FileTemplateCode; string DepartmentCode = ddModel.DepartmentCode; Label labFileTemplateCode = (Label)this.FormView1.Row.FindControl("FileTemplateCodeLabel"); labFileTemplateCode.Text = RmsDM.BFL.FileTemplateBFL.GetTemplateName(Convert.ToString(FileTemplateCode)); Label labDepartmentCode = (Label)this.FormView1.Row.FindControl("ApplyDepartmentCodeLabel"); labDepartmentCode.Text = RmsPM.BLL.SystemRule.GetUnitName(DepartmentCode); TextBox txtCounts = (TextBox)this.FormView1.Row.FindControl("txtCounts"); txtCounts.Text = "1"; TextBox txtLeaves = (TextBox)this.FormView1.Row.FindControl("txtLeaves"); txtLeaves.Text = "1"; break; case FormViewMode.ReadOnly: Label tbxUnit = (Label)this.FormView1.Row.FindControl("ApplyDepartmentCodeLabel"); tbxUnit.Text = RmsPM.BLL.SystemRule.GetUnitName(tbxUnit.Text); Label labUser = (Label)this.FormView1.Row.FindControl("ApplyUserCodeLabel"); labUser.Text = WebFunctionRule.GetUserNameByCode(labUser.Text); Label labGreateUser = (Label)this.FormView1.Row.FindControl("CreateUserCodeLabel"); labGreateUser.Text = WebFunctionRule.GetUserNameByCode(labGreateUser.Text); Label labLastModifyUser = (Label)this.FormView1.Row.FindControl("LastModifyByUserCodeLabel"); labLastModifyUser.Text = WebFunctionRule.GetUserNameByCode(labLastModifyUser.Text); break; } }
protected void FormView1_DataBound(object sender, EventArgs e) { Label PCLabel = (Label)this.FormView1.Row.FindControl("ParentCodeLabel"); HiddenField PCHiddenField = (HiddenField)this.FormView1.Row.FindControl("ParentCodeHiddenField"); HtmlInputControl UnitNameHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtUnitName"); HtmlInputControl UnitHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtUnit"); switch (this.FormView1.CurrentMode) { case FormViewMode.Edit: PCLabel.Text = WebFunctionRule.GetTreeViewFullPath(PCHiddenField.Value + "/" + this.DocDirCode); UnitNameHIC.Value = RmsPM.BLL.SystemRule.GetUnitName(UnitHIC.Value); HtmlInputControl TemplateNameHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateName"); HtmlInputControl TemplateHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateCode"); TemplateNameHIC.Value = FileTemplateBFL.GetTemplateName(TemplateHIC.Value); if (TemplateNameHIC.Value != "") { LinkButton lb = (LinkButton)this.FormView1.Row.FindControl("LinkButton1"); lb.Visible = true; } break; case FormViewMode.Insert: if (this.ParentCode != "" && this.ParentCode != null) { PCLabel.Text = WebFunctionRule.GetTreeViewFullPath(this.FullPath); PCHiddenField.Value = this.ParentCode; DocumentDirectoryBFL DDBFL = new DocumentDirectoryBFL(); UnitHIC.Value = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).DepartmentCode; UnitNameHIC.Value = RmsPM.BLL.SystemRule.GetUnitName(UnitHIC.Value); } else { PCLabel.Text = "此目录为一级目录!"; PCHiddenField.Value = "0"; } break; case FormViewMode.ReadOnly: if (!user.HasRight("3602")) { this.FormView1.Row.FindControl("EditButton").Visible = false; } break; } }
protected void DocumentFileFormView_DataBound(object sender, EventArgs e) { HiddenField UserCodeHiddenField = (HiddenField)this.DocumentFileFormView.Row.FindControl("ApplyUserCodeHiddenField"); Label UserCodeLabel = (Label)this.DocumentFileFormView.Row.FindControl("ApplyUserCodeLabel"); switch (this.DocumentFileFormView.CurrentMode) { case FormViewMode.Edit: UserCodeLabel.Text = WebFunctionRule.GetUserNameByCode(UserCodeHiddenField.Value); Label AppDepLabel = (Label)this.DocumentFileFormView.Row.FindControl("ApplyDepartmentCodeLabel"); HiddenField AppDepHiddenField = (HiddenField)this.DocumentFileFormView.Row.FindControl("ApplyDepartmentCodeHiddenField"); AppDepLabel.Text = RmsPM.BLL.SystemRule.GetUnitName(AppDepHiddenField.Value); break; case FormViewMode.Insert: User u = (User)Session["User"]; UserCodeHiddenField.Value = u.UserCode; UserCodeLabel.Text = WebFunctionRule.GetUserNameByCode(u.UserCode); string SortCode = ""; string MarkingSNCode = ""; if (!string.IsNullOrEmpty(FileTemplateCode)) { FileTemplateModel template = FTBFL.GetFileTemplate(int.Parse(FileTemplateCode)); if (template != null) { SortCode = template.SortCode; Web.SelectBox_SelectSessionUserUnit Unitddl = (Web.SelectBox_SelectSessionUserUnit) this.DocumentFileFormView.Row.FindControl("SelectSessionUserUnit"); MarkingSNCode = GetTempMarkingSN(Unitddl.SelectedValue, this.FileTemplateCode); } } Label SCLabel = (Label)this.DocumentFileFormView.Row.FindControl("SortCodeLabel"); //质量分类号 SCLabel.Text = SortCode; TextBox DMSN = (TextBox)this.DocumentFileFormView.Row.FindControl("DoucmentMarkingSNLabel"); //标识序列号 DMSN.Text = MarkingSNCode; break; } }