using System;
using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Web.Mvc;
using System.Collections.Generic;
using System.Linq;
using Learun.Application.Organization;
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
///
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-12-16 10:14
/// 描 述:长阳迎新
///
public class StuVolunteerPhoneController : MvcControllerBaseNoLogin
{
private StuVolunteerIBLL stuVolunteerIBLL = new StuVolunteerBLL();
#region 视图功能
///
/// 生成二维码
///
///
[HttpGet]
public ActionResult QRCode()
{
return View();
}
///
/// 生成二维码
///
///
[HttpGet]
public ActionResult Link()
{
return View();
}
///
/// 报名
///
///
[HttpGet]
public ActionResult FormApply()
{
return View();
}
///
/// 查询报名
///
///
[HttpGet]
public ActionResult Search()
{
return View();
}
///
/// 查询报名
///
///
[HttpGet]
public ActionResult SearchResult()
{
return View();
}
#endregion
#region 获取数据
///
/// 获取页面显示列表数据
///
/// 分页参数
/// 查询参数
///
[HttpGet]
[AjaxOnly]
public ActionResult GetPageList(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject();
var data = stuVolunteerIBLL.GetPageList(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}
///
/// 获取表单数据
///
/// 主键
///
[HttpGet]
[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
var StuVolunteerData = stuVolunteerIBLL.GetStuVolunteerEntity(keyValue);
var jsonData = new
{
StuVolunteer = StuVolunteerData,
};
return Success(jsonData);
}
#endregion
#region 提交数据
#endregion
#region 扩展数据
///
/// 登录查询
///
///
[HttpPost]
[AjaxOnly]
public ActionResult IsExist(string CardNo, string Password)
{
var entity = stuVolunteerIBLL.GetEntityByCardNo(CardNo);
if (entity == null)
{
return Fail("身份证号不存在!");
}
if (Password != CardNo.Substring(CardNo.Length - 6))
{
return Fail("密码错误!");
}
return Success("查询成功!");
}
///
/// 报名提交
///
///
///
///
[HttpPost]
[AjaxOnly]
public ActionResult SubmitForm(string keyValue, string strEntity)
{
StuVolunteerEntity entity = strEntity.ToObject();
entity.EnrollTime = DateTime.Now;
stuVolunteerIBLL.SubmitForm(keyValue, entity);
return Success("提交成功!");
}
//public ActionResult Search(string CardNo, string txtPass)
//{
// var StuVolunteerData = new StuVolunteerEntity();// stuVolunteerIBLL.IsEnrollByCard(CardNo);
// if (StuVolunteerData != null)
// {
// var jsonData = new
// {
// StuVolunteer = StuVolunteerData,
// };
// return Success(jsonData);
// }
// else
// {
// return Success(null);
// }
//}
[HttpGet]
[AjaxOnly]
public ActionResult SearchForm(string CardNo)
{
var StuVolunteerData = stuVolunteerIBLL.GetEntityByCardNo(CardNo);
return Success(StuVolunteerData);
}
public ActionResult SearchCard(string CardNo)
{
var StuVolunteerData = stuVolunteerIBLL.GetEntityByCardNo(CardNo);
var jsonData = new
{
StuVolunteer = StuVolunteerData,
};
return Success(jsonData);
}
#endregion
}
}