private bool CheckValue() { if (string.IsNullOrEmpty(TxtName.Text)) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('会议名称不能为空!');", true); TxtName.Focus(); return(false); } if (string.IsNullOrEmpty(TxtTheme.Text)) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('主题不能为空!');", true); TxtTheme.Focus(); return(false); } if (string.IsNullOrEmpty(TxtStartTime.Text)) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('开始时间不能为空!');", true); TxtStartTime.Focus(); return(false); } if (string.IsNullOrEmpty(TxtEndTime.Text)) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('结束时间不能为空!');", true); TxtEndTime.Focus(); return(false); } if (string.IsNullOrEmpty(TxtCity.Text)) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('所在城市不能为空!');", true); TxtCity.Focus(); return(false); } if (string.IsNullOrEmpty(TxtStreet.Text)) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('街道不能为空!');", true); TxtStreet.Focus(); return(false); } if (string.IsNullOrEmpty(TxtNumber.Text)) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('门牌号不能为空!');", true); TxtNumber.Focus(); return(false); } if (string.IsNullOrEmpty(TxtDept.Text)) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('所属部门不能为空!');", true); TxtDept.Focus(); return(false); } return(true); }
/// <summary> /// actually clears each textbox in the form /// </summary> private void ClearNewEmpForm() { EpForm.Clear(); TxtID.Clear(); TxtFirstName.Clear(); TxtLastName.Clear(); TxtAddress.Clear(); TxtCity.Clear(); CBxState.SelectedIndex = -1; CBxEmpType.SelectedIndex = -1; TxtZip.Clear(); TxtHireDate.Clear(); CBxMarriageStatus.SelectedIndex = -1; TxtDept.Clear(); TxtJobTitle.Clear(); LblAfterSubmitMsg.Text = ""; TxtPayAmount.Visible = false; LblPayAmount.Visible = false; LblSecondInput.Visible = false; TxtSecondInput.Visible = false; }