|
|
@@ -0,0 +1,62 @@ |
|
|
|
using Learun.Application.Base.SystemModule; |
|
|
|
using Learun.Application.TwoDevelopment.EducationalAdministration; |
|
|
|
using Microsoft.Ajax.Utilities; |
|
|
|
using Nancy; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace Learun.Application.WebApi.Modules.Device |
|
|
|
{ |
|
|
|
public class LessonShow: BaseNoAuthentication |
|
|
|
{ |
|
|
|
|
|
|
|
public LessonShow() : base("/app/lesson") |
|
|
|
{ |
|
|
|
Get["/class/list"] = GetClassList; |
|
|
|
Get["/arrangelesson"] = GetLesson; |
|
|
|
Post["/class/bind"] = BindClass; |
|
|
|
} |
|
|
|
|
|
|
|
DataSourceIBLL dataSourceIBLL = new DataSourceBLL(); |
|
|
|
ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 班级列表 |
|
|
|
/// </summary> |
|
|
|
/// <param name="_"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public Response GetClassList(dynamic _) |
|
|
|
{ |
|
|
|
//var keyValue = this.GetReqData(); 1=1 AND CheckMark=1 order by classno desc |
|
|
|
var data = dataSourceIBLL.GetDataTable("bjsj", ""); |
|
|
|
return Success(data); |
|
|
|
} |
|
|
|
|
|
|
|
public Response BindClass(dynamic _) |
|
|
|
{ |
|
|
|
var k = this.GetReq<BindDevClass>(); |
|
|
|
classInfoIBLL.BindDevice(k.ClassNo, k.DeviceNo); |
|
|
|
return Success("操作成功"); |
|
|
|
} |
|
|
|
public class BindDevClass |
|
|
|
{ |
|
|
|
public string ClassNo { get; set; } |
|
|
|
|
|
|
|
public string DeviceNo { get; set; } |
|
|
|
} |
|
|
|
public Response GetLesson(dynamic _) |
|
|
|
{ |
|
|
|
var bj = this.GetReq<BindDevClass>(); |
|
|
|
var classInfo = classInfoIBLL.GetClassNoByDevice(bj.DeviceNo); |
|
|
|
if (classInfo == null) return Fail("未找到班级"); |
|
|
|
|
|
|
|
return Success(data); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |