Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9adc51e
优化API接口,增加执行时间的统计
weishakeji Mar 25, 2020
d13e3c6
修正:课程变更专业时,所属试题没有同步变更的问题
weishakeji Apr 2, 2020
0603cf8
修正:课程变更专业时,所属试题没有同步变更的问题
weishakeji Apr 2, 2020
3ecc001
增加章节管理中的批量操作
weishakeji Apr 28, 2020
447a088
修正:学员学习课程时,如果未登录,给出准确提示
weishakeji Apr 28, 2020
61d8f2c
修正:手机端视频播放时的全屏问题
weishakeji Apr 30, 2020
d4e882f
修正:手机端视频学习时的全屏问题
weishakeji Apr 30, 2020
8eb42a7
修正:手机端视频无法全屏问题
weishakeji May 9, 2020
d4254b1
修正:messagebox.js关闭事件的死循环问题
weishakeji May 12, 2020
842750d
修正:学员学习证明打印,学员可以选择指定的课程
weishakeji May 12, 2020
c2eb57b
修正:导入试题时,章节名称怀疑有制表位、回车符、换行符等不可见字符,增加了清理代码
weishakeji May 12, 2020
b241d61
修正:禁用“从上次进度播放”的提示
weishakeji May 12, 2020
5f932bd
修正:课程页“学习目标”图片未显示的问题
weishakeji May 12, 2020
43a99a6
修正:视频时长显示的计算错误
weishakeji May 12, 2020
a8efe19
修正:api.js错误状态返回
weishakeji May 13, 2020
38062ff
优化:restful接口返回增加异常信息,方便调试程序
weishakeji May 13, 2020
71855da
优化:restful接口返回增加异常信息,方便调试程序
weishakeji May 13, 2020
f07f901
优化:试题练习增加“折叠/展开”按钮
weishakeji May 13, 2020
bae502a
修正:网校版右上角学员姓名宽度
weishakeji May 13, 2020
3b513cd
修正:网校版右上角学员姓名宽度
weishakeji May 14, 2020
5c900d3
修正:视频学习时留言时实刷新
weishakeji May 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions Song.ServiceImpls/CourseCom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ public Course CourseBatchAdd(int orgid, int sbjid, string names)
//整理名称信息
names = names.Replace(",", ",");
List<string> listName = new List<string>();
foreach (string s in names.Split(','))
foreach (string str in names.Split(','))
{
string s = str.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "");
if (s.Trim() != "") listName.Add(s.Trim());
}
//
int pid = 0;
Song.Entities.Course last = null;
Expand Down Expand Up @@ -122,10 +125,18 @@ public void CourseSave(Course entity)
new Field[] { Student_Course._.Stc_EndTime }, new object[] { DateTime.Now },
Student_Course._.Cou_ID == entity.Cou_ID && Student_Course._.Stc_IsFree == true);
}
tran.Update<TestPaper>(
new Field[] { TestPaper._.Cou_Name, TestPaper._.Sbj_ID, TestPaper._.Sbj_Name },
new object[] { entity.Cou_Name, entity.Sbj_ID, entity.Sbj_Name },
TestPaper._.Cou_ID == entity.Cou_ID);
//如果课程更改了专业
if (old.Sbj_ID != entity.Sbj_ID)
{
tran.Update<Questions>(
new Field[] { Questions._.Sbj_ID, Questions._.Sbj_Name },
new object[] { entity.Sbj_ID, entity.Sbj_Name }, Questions._.Cou_ID == entity.Cou_ID);
tran.Update<Outline>(new Field[] { Outline._.Sbj_ID }, new object[] { entity.Sbj_ID }, Outline._.Cou_ID == entity.Cou_ID);
tran.Update<TestPaper>(
new Field[] { TestPaper._.Cou_Name, TestPaper._.Sbj_ID, TestPaper._.Sbj_Name },
new object[] { entity.Cou_Name, entity.Sbj_ID, entity.Sbj_Name },
TestPaper._.Cou_ID == entity.Cou_ID);
}
tran.Save<Course>(entity);
tran.Commit();
}
Expand Down
27 changes: 17 additions & 10 deletions Song.ServiceImpls/OutlineCom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void OutlineAdd(Outline entity)
{
Song.Entities.Organization org = Business.Do<IOrganization>().OrganCurrent();
if (org != null) entity.Org_ID = org.Org_ID;
}
}
//所属专业
if (entity.Sbj_ID <= 0 && entity.Cou_ID > 0)
{
Expand All @@ -46,8 +46,14 @@ public void OutlineAdd(Outline entity)
//计算排序号
object obj = tran.Max<Outline>(Outline._.Ol_Tax, Outline._.Cou_ID == entity.Cou_ID && Outline._.Ol_PID == entity.Ol_PID);
entity.Ol_Tax = obj is int ? (int)obj + 1 : 1;
if (string.IsNullOrWhiteSpace(entity.Ol_UID))
entity.Ol_UID = WeiSha.Common.Request.UniqueID();
//唯一id
string uid = string.IsNullOrWhiteSpace(entity.Ol_UID) ? WeiSha.Common.Request.UniqueID() : entity.Ol_UID;
do
{
uid = WeiSha.Common.Request.UniqueID();
} while (Gateway.Default.Count<Outline>(Outline._.Ol_UID == uid) > 0);
entity.Ol_UID = uid;

////层级
//entity.Ol_Level = _ClacLevel(entity);
//entity.Ol_XPath = _ClacXPath(entity);
Expand All @@ -60,13 +66,13 @@ public void OutlineAdd(Outline entity)
pili_sdk.pili.Stream stream = Business.Do<ILive>().StreamCreat(liveid);
entity.Ol_LiveID = stream.Title;
}
catch(Exception ex)
catch (Exception ex)
{
throw new Exception("无法创建直播流," + ex.Message);
}
}
tran.Update<Course>(Course._.Cou_ExistLive, true, Course._.Cou_ID == entity.Cou_ID);
}
tran.Save<Outline>(entity);
tran.Save<Outline>(entity);
tran.Commit();

this.OnSave(null, EventArgs.Empty);
Expand All @@ -80,9 +86,7 @@ public void OutlineAdd(Outline entity)
{
tran.Close();
}

}

}
/// <summary>
/// 批量添加章节,可用于导入时
Expand All @@ -97,8 +101,11 @@ public Outline OutlineBatchAdd(int orgid, int sbjid, int couid, string names)
//整理名称信息
names = names.Replace(",", ",");
List<string> listName = new List<string>();
foreach (string s in names.Split(','))
foreach (string str in names.Split(','))
{
string s = str.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "");
if (s.Trim() != "") listName.Add(s.Trim());
}
//
int pid = 0;
Song.Entities.Outline last = null;
Expand All @@ -108,7 +115,7 @@ public Outline OutlineBatchAdd(int orgid, int sbjid, int couid, string names)
if (current == null)
{
current = new Outline();
current.Ol_Name = listName[i].Trim();
current.Ol_Name = listName[i];
current.Ol_IsUse = true;
current.Org_ID = orgid;
current.Sbj_ID = sbjid;
Expand Down
12 changes: 11 additions & 1 deletion Song.ServiceImpls/QuestionsCom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,17 @@ public Questions QuesSingle(int identify)
return qus;

}

/// <summary>
/// 获取单一实体对象,按主键ID;
/// </summary>
/// <param name="identify"></param>
/// <param name="cache">是否来自缓存</param>
/// <returns></returns>
public Questions QuesSingle(int identify, bool cache)
{
if (cache) return this.QuesSingle(identify);
return Gateway.Default.From<Questions>().Where(Questions._.Qus_ID == identify).ToFirst<Questions>();
}
public Questions QuesSingle(string uid)
{
if (uid == string.Empty) return null;
Expand Down
37 changes: 36 additions & 1 deletion Song.ServiceImpls/StudentCom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,42 @@ FROM [LogForStudentStudy] where {acid} group by ol_id
return null;
}
}

/// <summary>
/// 学员指定学习课程的记录
/// </summary>
/// <param name="stid"></param>
/// <param name="couids">课程id,逗号分隔</param>
/// <returns></returns>
public DataTable StudentStudyCourseLog(int stid, string couids)
{
DataTable dt = this.StudentStudyCourseLog(stid);
if (dt == null) return dt;
for (int i = 0; i < dt.Rows.Count; i++)
{
DataRow dr = dt.Rows[i];
//课程id
int couid = Convert.ToInt32(dr["Cou_ID"].ToString());
bool isexist = false;
foreach (string id in couids.Split(','))
{
if (string.IsNullOrWhiteSpace(id)) continue;
int sid = 0;
int.TryParse(id,out sid);
if (sid == 0) continue;
if (couid == sid)
{
isexist = true;
break;
}
}
if (!isexist)
{
dt.Rows.RemoveAt(i);
i--;
}
}
return dt;
}
/// <summary>
/// 学员学习某一门课程的完成度
/// </summary>
Expand Down
7 changes: 5 additions & 2 deletions Song.ServiceImpls/SubjectCom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ public Subject SubjectBatchAdd(int orgid, string names)
//整理名称信息
names = names.Replace(",", ",");
List<string> listName = new List<string>();
foreach (string s in names.Split(','))
foreach (string str in names.Split(','))
{
string s = str.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "");
if (s.Trim() != "") listName.Add(s.Trim());
}
//
int pid = 0;
Song.Entities.Subject last = null;
Expand All @@ -58,7 +61,7 @@ public Subject SubjectBatchAdd(int orgid, string names)
if (current == null)
{
current = new Subject();
current.Sbj_Name = listName[i].Trim();
current.Sbj_Name = listName[i];
current.Sbj_IsUse = true;
current.Org_ID = orgid;
current.Sbj_PID = pid;
Expand Down
7 changes: 7 additions & 0 deletions Song.ServiceInterfaces/IQuestions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ public interface IQuestions : WeiSha.Common.IBusinessInterface
/// <returns></returns>
Questions QuesSingle(int identify);
/// <summary>
/// ��ȡ��һʵ����󣬰�����ID��
/// </summary>
/// <param name="identify"></param>
/// <param name="cache">�Ƿ����Ի���</param>
/// <returns></returns>
Questions QuesSingle(int identify,bool cache);
/// <summary>
/// ��ȡ��һʵ����󣬰�UID
/// </summary>
/// <param name="uid">ȫ��Ψһid</param>
Expand Down
7 changes: 7 additions & 0 deletions Song.ServiceInterfaces/IStudent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,13 @@ public interface IStudent : WeiSha.Common.IBusinessInterface
/// <returns>datatable��LastTime��Ϊѧϰʱ�䣻studyTime��ѧϰʱ��</returns>
DataTable StudentStudyCourseLog(int stid);
/// <summary>
/// ѧԱָ��ѧϰ�γ̵ļ�¼
/// </summary>
/// <param name="stid"></param>
/// <param name="couids">�γ�id,���ŷָ�</param>
/// <returns></returns>
DataTable StudentStudyCourseLog(int stid,string couids);
/// <summary>
/// ѧԱ����ѧϰijһ�γ̵ļ�¼
/// </summary>
/// <param name="stid">ѧԱid</param>
Expand Down
4 changes: 2 additions & 2 deletions Song.Site/Manage/Course/Courses_Outline.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ protected void btnEnter_Click(object sender, EventArgs e)
ol.Cou_ID = couid;
Song.Entities.Course cou = Business.Do<ICourse>().CourseSingle(couid);
if (cou != null) ol.Sbj_ID = cou.Sbj_ID;
//全局唯一ID
ol.Ol_UID = getUID();
////全局唯一ID
//ol.Ol_UID = getUID();
try
{
if (olid < 1)
Expand Down
13 changes: 12 additions & 1 deletion Song.Site/Manage/Course/Courses_Outlines.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
<uc2:toolsBar ID="ToolsBar1" runat="server" WinPath="Outline_Edit.aspx"
AddButtonOpen="true" GvName="GridView1" WinWidth="80" DelButtonVisible="false"
WinHeight="80" InputButtonVisible="false" OutputButtonVisible="false" />
<span class="btnarea"><asp:Button ID="btnUse" CssClass="btnModfiy" runat="server" OnClick="btnModfiy_Click" Text="启用" />
<asp:Button ID="btnFinish" OnClick="btnFinish_Click" CssClass="btnGeneral" runat="server" Text="完结" />
<asp:Button ID="btnFree" OnClick="btnFree_Click" CssClass="btnModfiy" runat="server" Text="免费" />
<asp:Button ID="btnNofree" OnClick="btnNofree_Click" CssClass="btnGeneral" runat="server" Text="收费" />
</span>
<%-- <asp:Button ID="btnAdd" runat="server" Text="新增" CssClass="btnAdd toolsBtn outlineName" />--%></div>
<div loyout="row" overflow="auto">
<cc1:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" SelectBoxKeyName="SelectBox"
ShowSelectBox="false" IsEncrypt="False">
ShowSelectBox="true" IsEncrypt="False">
<EmptyDataTemplate>
<div style="text-align: center">
当前课程还没有添加章节</div>
Expand All @@ -28,6 +33,12 @@
</ItemTemplate>
<ItemStyle CssClass="center" Width="50px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="序号">
<ItemTemplate>
<%# Eval("Ol_Tax")%></span>
</ItemTemplate>
<ItemStyle CssClass="center" Width="50px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="课程章节">
<ItemTemplate>
<span class="treeIco">
Expand Down
64 changes: 64 additions & 0 deletions Song.Site/Manage/Course/Courses_Outlines.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,69 @@ protected void btnAddSub_Click(object sender, EventArgs e)
GridView1.DataBind();
}
#endregion

#region 上方的按钮事件
/// <summary>
/// 批量启用章节
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnModfiy_Click(object sender, EventArgs e)
{
string keys = GridView1.GetKeyValues;
foreach (string s in keys.Split(','))
{
int id = 0;
int.TryParse(s, out id);
Song.Entities.Outline entity = Business.Do<IOutline>().OutlineSingle(id);
if (entity == null) continue;
entity.Ol_IsUse = !entity.Ol_IsUse;
Business.Do<IOutline>().OutlineSave(entity);
}
BindData(null, null);
}
protected void btnFinish_Click(object sender, EventArgs e)
{
string keys = GridView1.GetKeyValues;
foreach (string s in keys.Split(','))
{
int id = 0;
int.TryParse(s, out id);
Song.Entities.Outline entity = Business.Do<IOutline>().OutlineSingle(id);
if (entity == null) continue;
entity.Ol_IsFinish = !entity.Ol_IsFinish;
Business.Do<IOutline>().OutlineSave(entity);
}
BindData(null, null);
}
protected void btnFree_Click(object sender, EventArgs e)
{
string keys = GridView1.GetKeyValues;
foreach (string s in keys.Split(','))
{
int id = 0;
int.TryParse(s, out id);
Song.Entities.Outline entity = Business.Do<IOutline>().OutlineSingle(id);
if (entity == null) continue;
entity.Ol_IsFree = true;
Business.Do<IOutline>().OutlineSave(entity);
}
BindData(null, null);
}
protected void btnNofree_Click(object sender, EventArgs e)
{
string keys = GridView1.GetKeyValues;
foreach (string s in keys.Split(','))
{
int id = 0;
int.TryParse(s, out id);
Song.Entities.Outline entity = Business.Do<IOutline>().OutlineSingle(id);
if (entity == null) continue;
entity.Ol_IsFree = false;
Business.Do<IOutline>().OutlineSave(entity);
}
BindData(null, null);
}
#endregion
}
}
36 changes: 36 additions & 0 deletions Song.Site/Manage/Course/Courses_Outlines.aspx.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Song.Site/Manage/Course/Outline_Edit.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<cc1:DropDownTree ID="ddlOutline" runat="server" IdKeyName="Ol_ID" ParentIdKeyName="Ol_PID"
TaxKeyName="Ol_Tax" Width="350">
</cc1:DropDownTree>
&nbsp; 排序号:
<asp:TextBox ID="Ol_Tax" runat="server" Width="80" group="ent" datatype='uint'
MaxLength="200"></asp:TextBox>
</td>
</tr>
<tr >
Expand Down
Loading