/// <summary> /// 验证页面数据 /// </summary> private bool CheckData() { if (this.CurOperation == (int)OperationEnum.INSERT) { if (fuPicture.PostedFile.ContentLength == 0) { hidInfo.Value = "请上传图片!"; return(false); } } if (fuPicture.PostedFile.ContentLength > 0) { string PictureType = SystemParamQuery.GetSystemParam("PictureType").ToLower(); string ExtensionName = Path.GetExtension(fuPicture.PostedFile.FileName).ToLower(); if (PictureType.IndexOf(ExtensionName) == -1) { hidInfo.Value = "请选择jpg、jpeg、gif、bmp、png类型的图片!"; return(false); } } if (string.IsNullOrEmpty(txtName.Text)) { hidInfo.Value = "请输入合作伙伴名称"; return(false); } if (string.IsNullOrEmpty(txtURL.Text)) { hidInfo.Value = "请输入超链接地址!"; return(false); } return(true); }
/// <summary> /// 验证页面数据 /// </summary> private bool CheckData() { if (this.CurOperation == (int)OperationEnum.INSERT) { if (fuPicture.PostedFile.ContentLength == 0) { hidInfo.Value = "请上传图片!"; return(false); } } if (fuPicture.PostedFile.ContentLength > 0) { string PictureType = SystemParamQuery.GetSystemParam("PictureType").ToLower(); string ExtensionName = Path.GetExtension(fuPicture.PostedFile.FileName).ToLower(); if (PictureType.IndexOf(ExtensionName) == -1) { hidInfo.Value = "请选择jpg、jpeg、gif、bmp、png类型的图片!"; return(false); } } if (string.IsNullOrEmpty(txtGiftName.Text)) { hidInfo.Value = "请输入礼品名称"; return(false); } if (string.IsNullOrEmpty(txtNeedPoints.Text)) { hidInfo.Value = "请输入兑换所需积分!"; return(false); } if (string.IsNullOrEmpty(txtRemainAmount.Text)) { hidInfo.Value = "请输入剩余礼品数量!"; return(false); } if (string.IsNullOrEmpty(txtDescription.Text)) { hidInfo.Value = "请输入礼品描述!"; return(false); } return(true); }