本文整理汇总了C#中ServerValidateEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ServerValidateEventArgs类的具体用法?C# ServerValidateEventArgs怎么用?C# ServerValidateEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerValidateEventArgs类属于命名空间,在下文中一共展示了ServerValidateEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: pageValidation
public void pageValidation(object source, ServerValidateEventArgs args)
{
args.IsValid = true;
string ErrorMessage = "";
try
{
Type type;
decimal m;
int k;
DateTime dt;
if (!(Decimal.TryParse(txtBusinessSurplus.Value, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of businness surplus must be a decimal </p>"; }
if (!(Decimal.TryParse(txtIncome.Value, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of income must be a decimal </p>"; }
if (!(Decimal.TryParse(txtOtherIncome.Value, out m))) { args.IsValid = false; ErrorMessage += "<p>The value other income must be a decimal </p>"; }
if (!(Decimal.TryParse(txtRentUtil.Value, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of rent utilies must be a decimal </p>"; }
if (!(Decimal.TryParse(txtFood.Text, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of food must be a decimal </p>"; }
if (!(Decimal.TryParse(txtEducation.Text, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of education must be a decimal </p>"; }
if (!(Decimal.TryParse(txtStaff.Text, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of staff must be a decimal </p>"; }
if (!(Decimal.TryParse(txtTransport.Text, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of transport must be a decimal </p>"; }
if (!(Decimal.TryParse(txthealth.Text, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of health must be a decimal </p>"; }
if (!(Decimal.TryParse(txtClothing.Value, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of clothing must be a decimal </p>"; }
if (!(Decimal.TryParse(txtEntertainment.Value, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of Entertainment must be a decimal </p>"; }
if (!(Decimal.TryParse(txtCharity.Value, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of charity must be a decimal </p>"; }
if (!(Decimal.TryParse(txtPayment.Value, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of payment must be a decimal </p>"; }
if (!(Decimal.TryParse(txtOthers.Value, out m))) { args.IsValid = false; ErrorMessage += "<p>The value of others must be a decimal </p>"; }
// if (!(int.TryParse(txtDuration.Value, out k))) { args.IsValid = false; ErrorMessage += "<p> The Duration must be interger"; }
//if (!(Decimal.TryParse(txtLoanAmount.Value, out m))) { args.IsValid = false; ErrorMessage += "<p> The Loan Amount be a decimal </p>"; }
//if (!(DateTime.TryParse(txtFirstPaymentDate.Text, out dt))) { args.IsValid = false; ErrorMessage += "<p> The First Payment date is not in the correct format</p>"; }
//if (dt < DateTime.Now) { ErrorMessage += "<p>The First Payment date should not be less than today </p>"; args.IsValid = false; }
this.ErrMsg.InnerHtml = ErrorMessage;
}
catch (Exception ex) { args.IsValid = false; }
}
示例2: valTomTatVn_ServerValidate
protected void valTomTatVn_ServerValidate(object source, ServerValidateEventArgs args)
{
if (args.Value.Length > 300)
args.IsValid = false;
else
args.IsValid = true;
}
示例3: EmailCustomValidator_ServerValidate
protected void EmailCustomValidator_ServerValidate(object source, ServerValidateEventArgs args)
{
if (Customers.IsEmailExists(args.Value) || Membership.GetUser(args.Value) != null)
args.IsValid = false;
else
args.IsValid = true;
}
示例4: OnValidateEmail
protected void OnValidateEmail(object source, ServerValidateEventArgs args)
{
if (string.IsNullOrEmpty(args.Value))
return;
args.IsValid = Requester.FindByEmail(args.Value) == null;
}
示例5: OnValidateEmail
protected void OnValidateEmail(object source, ServerValidateEventArgs args)
{
if (string.IsNullOrEmpty(args.Value))
return;
args.IsValid = Requester.Logged.CanChangeEmailTo(args.Value);
}
示例6: RecipeCategoryValidator_ServerValidate
protected void RecipeCategoryValidator_ServerValidate(object source, ServerValidateEventArgs e)
{
if (RecipeCategory.SelectedItem.Value == "Empty")
{
e.IsValid = false;
}
}
示例7: CustomValidator1_ServerValidate
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
if (args.Value.Length>=6)
{
args.IsValid=true;
}
}
示例8: CustomValidator1_ServerValidate
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
DateTime datan = DateTime.Parse(TextBoxData.Text);
if (datan.AddYears(int.Parse(TextBoxVarsta.Text)).Year.CompareTo(DateTime.Today.Year) == 0)
args.IsValid = true;
else args.IsValid = false;
}
示例9: cusCustom_ServerValidate
//Validointi
protected void cusCustom_ServerValidate(object source, ServerValidateEventArgs args)
{
if (BLAutot.isValidRekkari(args.Value))
args.IsValid = true;
else
args.IsValid = false;
}
示例10: BiographyCustomValidator_ServerValidate
protected void BiographyCustomValidator_ServerValidate(object sender, ServerValidateEventArgs e)
{
if (hdnMain.Value.Length < 1)
{
e.IsValid = false;
}
}
示例11: ValidateNumeric
// AdminMenu CustomIncludes end
//-------------------------------
public void ValidateNumeric(object source, ServerValidateEventArgs args) {
try{
Decimal temp=Decimal.Parse(args.Value);
args.IsValid=true;
}catch{
args.IsValid=false; }
}
示例12: CV_ServerValidate
protected void CV_ServerValidate(object source, ServerValidateEventArgs args)
{
CustomValidator cv = (CustomValidator)source;
switch (cv.ID)
{
case "cvUom":
if (TheUomMgr.LoadUom(args.Value) == null)
{
ShowWarningMessage("MasterData.Bom.WarningMessage.UomInvalid", args.Value);
args.IsValid = false;
}
break;
case "cvRegion":
if (args.Value.Trim() != "")
{
if (TheRegionMgr.LoadRegion(args.Value) == null)
{
ShowWarningMessage("MasterData.Bom.WarningMessage.RegionInvalid", args.Value);
args.IsValid = false;
}
}
break;
default:
break;
}
}
示例13: vldCustomCustomerID_ServerValidate
protected void vldCustomCustomerID_ServerValidate(object source, ServerValidateEventArgs args)
{
if (this.IsValid)
{
args.IsValid = CustomerDB.CustomerIDExists(int.Parse(args.Value));
}
}
示例14: Save_ServerValidate
protected void Save_ServerValidate(object source, ServerValidateEventArgs args)
{
CustomValidator cv = (CustomValidator)source;
string region = ((Controls_TextBox)(this.FV_Workday.FindControl("tbRegion"))).Text.Trim();
string workcenter = ((Controls_TextBox)(this.FV_Workday.FindControl("tbWorkCenter"))).Text.Trim();
string dayOfWeek = ((DropDownList)(this.FV_Workday.FindControl("DayOfWeek_DDL"))).SelectedValue;
RadioButtonList rbType = (RadioButtonList)(this.FV_Workday.FindControl("rbType"));
switch (cv.ID)
{
case "cvRegion":
if (TheRegionMgr.LoadRegion(region) == null)
args.IsValid = false;
break;
case "cvWorkCenter":
if (TheWorkCenterMgr.LoadWorkCenter(workcenter) == null)
args.IsValid = false;
break;
case "cvWeek":
if (TheWorkdayMgr.GetWorkdayByDayofweek(dayOfWeek, region, workcenter).Count > 0)
args.IsValid = false;
break;
default:
break;
}
}
示例15: CustomValidator1_ServerValidate
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
if (Description.Text.Length > 200)
args.IsValid = false;
else
args.IsValid = true;
}