当前位置: 首页>>代码示例>>C#>>正文


C# ServerValidateEventArgs类代码示例

本文整理汇总了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; }
 }
开发者ID:infosystemproject2014,项目名称:microfinance,代码行数:32,代码来源:IncomeExpeditures.ascx.cs

示例2: valTomTatVn_ServerValidate

 protected void valTomTatVn_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (args.Value.Length > 300)
         args.IsValid = false;
     else
         args.IsValid = true;
 }
开发者ID:hoanghcmus,项目名称:benhvien,代码行数:7,代码来源:EditVanban.aspx.cs

示例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;
 }
开发者ID:BritishBuddha87,项目名称:shopAlott,代码行数:7,代码来源:Register.aspx.cs

示例4: OnValidateEmail

    protected void OnValidateEmail(object source, ServerValidateEventArgs args)
    {
        if (string.IsNullOrEmpty(args.Value))
            return;

        args.IsValid = Requester.FindByEmail(args.Value) == null;
    }
开发者ID:jeremiahredekop,项目名称:Tp.HelpDesk,代码行数:7,代码来源:Register.aspx.cs

示例5: OnValidateEmail

	protected void OnValidateEmail(object source, ServerValidateEventArgs args)
	{
	 	if (string.IsNullOrEmpty(args.Value))
			return;

		args.IsValid = Requester.Logged.CanChangeEmailTo(args.Value); 
	}
开发者ID:jeremiahredekop,项目名称:Tp.HelpDesk,代码行数:7,代码来源:UserProfile.aspx.cs

示例6: RecipeCategoryValidator_ServerValidate

 protected void RecipeCategoryValidator_ServerValidate(object source, ServerValidateEventArgs e)
 {
     if (RecipeCategory.SelectedItem.Value == "Empty")
     {
         e.IsValid = false;
     }
 }
开发者ID:karandevgan,项目名称:MyRecipes,代码行数:7,代码来源:addrecipe.aspx.cs

示例7: CustomValidator1_ServerValidate

 protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (args.Value.Length>=6)
     {
         args.IsValid=true;
     }
 }
开发者ID:MaheshSinghSawant,项目名称:AirlinesWebApplication,代码行数:7,代码来源:Register.aspx.cs

示例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;
 }
开发者ID:OniciBianca,项目名称:DAW,代码行数:7,代码来源:StudentForm.aspx.cs

示例9: cusCustom_ServerValidate

 //Validointi
 protected void cusCustom_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (BLAutot.isValidRekkari(args.Value))
             args.IsValid = true;
         else
             args.IsValid = false;
 }
开发者ID:G2559,项目名称:viikkotehtava-1,代码行数:8,代码来源:G2559_WanhatAutotMuokkaus.aspx.cs

示例10: BiographyCustomValidator_ServerValidate

 protected void BiographyCustomValidator_ServerValidate(object sender, ServerValidateEventArgs e)
 {
     if (hdnMain.Value.Length < 1)
     {
         e.IsValid = false;
     }
 }
开发者ID:IdeaFortune,项目名称:Monaco,代码行数:7,代码来源:CreateInstructorDialog.ascx.cs

示例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;	}
		}
开发者ID:cxehud,项目名称:AmitAndEhud,代码行数:11,代码来源:AdminMenu.cs

示例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;
        }
    }
开发者ID:Novthirteen,项目名称:yfkey-scms,代码行数:27,代码来源:Edit.ascx.cs

示例13: vldCustomCustomerID_ServerValidate

 protected void vldCustomCustomerID_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (this.IsValid)
     {
         args.IsValid = CustomerDB.CustomerIDExists(int.Parse(args.Value));
     }
 }
开发者ID:anneilb,项目名称:ce-dev,代码行数:7,代码来源:ProductRegistration.aspx.cs

示例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;
        }
    }
开发者ID:Novthirteen,项目名称:yfkey-scms,代码行数:27,代码来源:New.ascx.cs

示例15: CustomValidator1_ServerValidate

 protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (Description.Text.Length > 200)
         args.IsValid = false;
     else
         args.IsValid = true;
 }
开发者ID:Quad0ngit,项目名称:TimeTracker,代码行数:7,代码来源:TimeEntry.aspx.cs


注:本文中的ServerValidateEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。