Commit 25a131f7 authored by 黄奎's avatar 黄奎

页面修改

parent 455a4f4b
......@@ -10,5 +10,24 @@ namespace Edu.Model.ViewModel.User
[Serializable]
public class RB_Manager_ViewModel : Model.Entity.User.RB_Manager
{
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 创建时间字符串
/// </summary>
public string CreateTimeStr { get { return Common.ConvertHelper.FormatTime(this.CreateTime); } }
/// <summary>
/// 更新人
/// </summary>
public string UpdateByName { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public string UpdateTimeStr { get { return Common.ConvertHelper.FormatTime(this.UpdateTime); } }
}
}
......@@ -66,6 +66,8 @@ namespace Edu.Module.Course
{nameof(RB_Course_Category_ViewModel.ParentId),model.ParentId },
{nameof(RB_Course_Category_ViewModel.CateName),model.CateName.Trim() },
{nameof(RB_Course_Category_ViewModel.SortNum),model.SortNum },
{nameof(RB_Course_Category_ViewModel.UpdateBy),model.UpdateBy },
{nameof(RB_Course_Category_ViewModel.UpdateTime),model.UpdateTime },
};
flag = categoryRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Category_ViewModel.CateId), model.CateId));
}
......
......@@ -80,15 +80,15 @@ namespace Edu.Module.User
/// <summary>
/// 删除管理者
/// </summary>
/// <param name="Mid"></param>
/// <param name="MId"></param>
/// <returns></returns>
public bool RemoveManagerModule(int Mid)
public bool RemoveManagerModule(int MId)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Manager_ViewModel.Status), (int)DateStateEnum.Delete}
};
bool flag = managerRepository.Update(fileds, new WhereHelper(nameof(RB_Manager_ViewModel.MId), Mid));
bool flag = managerRepository.Update(fileds, new WhereHelper(nameof(RB_Manager_ViewModel.MId), MId));
return flag;
}
}
......
......@@ -116,7 +116,7 @@ WHERE 1=1
}
if (query.AccountType > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.AccountType), query.AccountType);
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.AccountType), (int)query.AccountType);
}
if (query.Id > 0)
{
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Module.Course;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Edu.WebApi.Controllers.Course
{
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class CourseController : BaseController
{
/// <summary>
/// 课程分类处理类
/// </summary>
private readonly CourseCategoryModule categoryModule = new CourseCategoryModule();
#region 课程管理
/// <summary>
/// 获取课程分类分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCourseCategoryPageList()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Category_ViewModel>(RequestParm.Msg.ToString());
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
var list = categoryModule.GetCourseCategoryPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取课程分类列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCourseCategoryList()
{
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Category_ViewModel>(RequestParm.Msg.ToString());
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
var list = categoryModule.GetCourseCategoryListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 添加修改课程分类
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetCourseCategory()
{
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Category_ViewModel>(RequestParm.Msg.ToString());
extModel.CreateTime = DateTime.Now;
extModel.CreateBy = base.UserInfo.Id;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
bool flag = categoryModule.SetCourseCategoryModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取课程分类
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCourseCategory()
{
var CateId = base.ParmJObj.GetInt("CateId", 0);
var extModel = categoryModule.GetCourseCategoryModule(CateId);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 删除课程分类
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveCourseCategory()
{
var CateId = base.ParmJObj.GetInt("CateId", 0);
var flag = categoryModule.RemoveCourseCategoryModule(CateId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.System;
using Edu.Module.System;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Edu.WebApi.Controllers.Public
......@@ -120,7 +116,7 @@ namespace Edu.WebApi.Controllers.Public
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveStudent()
public ApiResult SetMenuStatus()
{
var MenuId = base.ParmJObj.GetInt("MenuId", 0);
int Status = base.ParmJObj.GetInt("Status", 0);
......
......@@ -529,9 +529,20 @@ namespace Edu.WebApi.Controllers.User
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
var list = managerModule.GetManagerPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
if (item.UpdateBy > 0)
{
item.UpdateByName = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.AccountName ?? "";
}
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: list);
return ApiResult.Success(data: pageModel);
}
/// <summary>
......@@ -560,6 +571,8 @@ namespace Edu.WebApi.Controllers.User
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.School_Id = base.UserInfo.School_Id;
bool flag = managerModule.SetManagerModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -583,8 +596,8 @@ namespace Edu.WebApi.Controllers.User
[HttpPost]
public ApiResult RemoveManager()
{
var Mid = base.ParmJObj.GetInt("Mid", 0);
var flag = managerModule.RemoveManagerModule(Mid);
var MId = base.ParmJObj.GetInt("MId", 0);
var flag = managerModule.RemoveManagerModule(MId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment