public ResponseStatus AddActivity(HttpRequestBase req) { //Add exception Activity atvy = null; ResponseStatus resp = ResponseStatus.NONE; /* * Verify v = new Verify(); * object[,] b = new object[,] { { 1, 1 }, { 2, 2 } }; * object[,] a = new object[,] { { 1, new object[,] { { 1, 1 }, { 2, 2 } } } }; * object[,] c = new object[,]{ * { VerifyType.REQUIRED, "内容必须填写" }, * { VerifyType.RANGE_LENGTH,"内容的长度必须在0~0个字符之间"} * }; * v.value_option_errMsg = new object[,] { * { req.Form["content"].ToString(), new object[,]{ * { VerifyType.REQUIRED, "标题必须填写" }, * { VerifyType.RANGE_LENGTH,"标题的长度必须在0~0个字符之间"} * } * }, * { Convert.ToDateTime(req.Form["prestart"]),new object[,]{ * { VerifyType.REQUIRED,"开始时间必须填写"}, * { VerifyType.TIME,"无效时间"} * } * }, * { Convert.ToDateTime(req.Form["overend"]),new object[,]{ * { VerifyType.REQUIRED,"结束时间必须填写"}, * { VerifyType.TIME,"无效时间"} * } * }, * { req.Form["contentdetails"].ToString(),new object[,]{ * { VerifyType.REQUIRED,"内容必须填写" }, * { VerifyType.RANGE_LENGTH,"内容的长度必须在0~0个字符之间"} * } * }, * {Convert.ToDateTime(req.Form["publish"]),new object[,]{ * { VerifyType.REQUIRED,"发布时间必须填写" }, * { VerifyType.TIME,"无效时间" } * } * } * }; */ if (this.CreateInstance(req, ref atvy)) { activityDal = new ActivityDAL(); resp = activityDal.Add(atvy) ? ResponseStatus.SUCCESS : ResponseStatus.FAILED; activityDal.ReturnUnitToPool(); } else { resp = ResponseStatus.FAILED; } return(resp); }