开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 319

TWT20161022/视频学习+在线考试+题库+直播

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (4)
标签 (8)
master
dev
beta
optimize
2.3
2.1.1.21041
2.0.8627
2.0.8499
2.0.8460
2.0.8384
2.0.8355
2.0Beta
master
分支 (4)
标签 (8)
master
dev
beta
optimize
2.3
2.1.1.21041
2.0.8627
2.0.8499
2.0.8460
2.0.8384
2.0.8355
2.0Beta
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (4)
标签 (8)
master
dev
beta
optimize
2.3
2.1.1.21041
2.0.8627
2.0.8499
2.0.8460
2.0.8384
2.0.8355
2.0Beta
Organization.cs 25.88 KB
一键复制 编辑 原始数据 按行查看 历史
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WeiSha.Core;
using Song.Entities;
using Song.ServiceInterfaces;
using Song.ViewData.Attri;
using System.IO;
using Ett = Song.Entities;
using Newtonsoft.Json.Linq;
using System.Web;
namespace Song.ViewData.Methods
{
/// <summary>
/// 机构管理
/// </summary>
[HttpPut, HttpGet]
public class Organization : ViewMethod, IViewAPI
{
//资源的虚拟路径和物理路径
public static string VirPath = WeiSha.Core.Upload.Get["Org"].Virtual;
public static string PhyPath = WeiSha.Core.Upload.Get["Org"].Physics;
#region 获取机构信息
/// <summary>
/// 机构的统计数据,例如学员数,等
/// </summary>
/// <param name="orgid"></param>
/// <returns></returns>
[Cache]
public JObject Statistics(int orgid)
{
if (orgid <= 0)
{
Ett.Organization org = Business.Do<IOrganization>().OrganCurrent();
orgid = org.Org_ID;
}
JObject jo = new JObject();
//学员数
JObject jacc = new JObject();
jacc.Add("total", Business.Do<IAccounts>().AccountsOfCount(orgid, null, -1)); //学员总数
jacc.Add("usecount", Business.Do<IAccounts>().AccountsOfCount(orgid, true, -1)); //启用的学员数
jacc.Add("man", Business.Do<IAccounts>().AccountsOfCount(orgid, true, 1)); //男性人数
jacc.Add("woman", Business.Do<IAccounts>().AccountsOfCount(orgid, true, 2)); //女性人数
jacc.Add("online", Song.ViewData.LoginAccount.CacheList().Count); //在线人数
jacc.Add("recharge", Business.Do<IAccounts>().MoneyForAccount(orgid, 2, 3)); //付费学员数,即充过值的人数
jacc.Add("pay", Business.Do<IAccounts>().MoneyForAccount(orgid, 1, 4)); //消费学员数,即购买过课程的人数
jacc.Add("course", Business.Do<IStudent>().ForCourseCount(orgid, false)); //正在学习的人数,即选修过课程的人数
jacc.Add("test", Business.Do<IStudent>().ForTestCount(orgid)); //参与过模拟测试的人数
jacc.Add("exam", Business.Do<IStudent>().ForExamCount(orgid)); //参加考试的人数
jacc.Add("exercise", Business.Do<IStudent>().ForExerciseCount(orgid)); //参与过试题练习的人数
jacc.Add("study", Business.Do<IStudent>().ForStudyCount(orgid)); //参与过视频学习的人数
jo.Add("account", jacc);
//课程
JObject jcoud = new JObject();
jcoud.Add("total", Business.Do<ICourse>().CourseOfCount(orgid, -1, -1, null, null)); //课程总数
jcoud.Add("usecount", Business.Do<ITeacher>().TeacherOfCount(orgid, true)); //可用课程数
jcoud.Add("free", Business.Do<ICourse>().CourseOfCount(orgid, -1, -1, null, true)); //免费的课程数
jcoud.Add("buycount", Business.Do<IStudent>().ForCourseCount(orgid, true)); //课程的选修人次
jo.Add("course", jcoud);
//考试
JObject jexam = new JObject();
jexam.Add("theme", Business.Do<IExamination>().ExamOfCount(orgid,null, true)); //考试主题数
jexam.Add("exam", Business.Do<IExamination>().ExamOfCount(orgid, null, false)); //考试场次数
jo.Add("exam", jexam);
//教师
JObject jteach = new JObject();
jteach.Add("total", Business.Do<ITeacher>().TeacherOfCount(orgid, null)); //教师总数
jteach.Add("usecount", Business.Do<ITeacher>().TeacherOfCount(orgid, true)); //启用的教师数
jo.Add("teacher", jteach);
//资源
JObject jres = new JObject();
jres.Add("video", Business.Do<IAccessory>().OfCount(orgid, string.Empty, "CourseVideo")); //视频数
jres.Add("document", Business.Do<IAccessory>().OfCount(orgid, string.Empty, "Course")); //资料数
jres.Add("testpaper", Business.Do<ITestPaper>().PaperOfCount(orgid, -1, -1, -1, null)); //试卷数
jres.Add("question", Business.Do<IQuestions>().QuesOfCount(orgid, -1, -1, -1, -1, -1, null)); //试题数
jres.Add("subject", Business.Do<ISubject>().SubjectOfCount(orgid, -1, null, true)); //专业数
jres.Add("news", Business.Do<IContents>().ArticleOfCount(orgid, null, true)); //新闻数
jres.Add("notice", Business.Do<INotice>().OfCount(orgid, true)); //通知数
jo.Add("resource", jres);
return jo;
}
/// <summary>
/// 通过机构id获取机构信息
/// </summary>
/// <param name="id">机构id</param>
/// <returns>机构实体</returns>
public Ett.Organization ForID(int id)
{
return _trans(Business.Do<IOrganization>().OrganSingle(id));
}
/// <summary>
/// 获取所有可用的机构
/// </summary>
/// <returns></returns>
public List<Ett.Organization> AllUse()
{
List<Ett.Organization> orgs = Business.Do<IOrganization>().OrganAll(true, -1, null);
for (int i = 0; i < orgs.Count; i++)
{
orgs[i] = _trans(orgs[i]);
}
return orgs;
}
/// <summary>
/// 获取所有机构
/// </summary>
/// <param name="use">是否启用</param>
/// <param name="lv">机构等级id</param>
/// <param name="name">按机构名称检索</param>
/// <returns></returns>
public List<Ett.Organization> All(bool? use, int lv, string name)
{
List<Ett.Organization> orgs = Business.Do<IOrganization>().OrganAll(use, lv, name);
for (int i = 0; i < orgs.Count; i++)
{
orgs[i] = _trans(orgs[i]);
}
return orgs;
}
/// <summary>
/// 当前机构是否重名
/// </summary>
/// <param name="name">机构的名称</param>
/// <param name="id">机构的id</param>
/// <returns></returns>
public bool ExistName(string name, int id)
{
return Business.Do<IOrganization>().ExistName(name, id);
}
/// <summary>
/// 机构平台名称是否重复
/// </summary>
/// <param name="name">机构的平台名称</param>
/// <param name="id">机构的id</param>
/// <returns></returns>
public bool ExistPlatform(string name, int id)
{
return Business.Do<IOrganization>().ExistPlatform(name, id);
}
/// <summary>
/// 机构的二级域否重复
/// </summary>
/// <param name="name"></param>
/// <param name="id">机构的id</param>
/// <returns></returns>
public bool ExistDomain(string name, int id)
{
return Business.Do<IOrganization>().ExistDomain(name, id);
}
/// <summary>
/// 二级域名是否允许使用,判断是否存在于保留域名中
/// </summary>
/// <param name="name">二级域名</param>
/// <returns>允许使用该域,即在限制域名中不存在,返回true,</returns>
public bool DomainAllow(string name)
{
return !Business.Do<ILimitDomain>().DomainIsExist(name, -1);
}
/// <summary>
/// 分页获取机构信息
/// </summary>
/// <param name="lvid"></param>
/// <param name="search"></param>
/// <param name="index"></param>
/// <param name="size"></param>
/// <returns></returns>
public ListResult Pager(int lvid, string search, int index, int size)
{
int sum = 0;
Ett.Organization[] orgs = Business.Do<IOrganization>().OrganPager(null, lvid, search, size, index, out sum);
for (int i = 0; i < orgs.Length; i++)
{
orgs[i] = _trans(orgs[i]);
}
Song.ViewData.ListResult result = new ListResult(orgs);
result.Index = index;
result.Size = size;
result.Total = sum;
return result;
}
/// <summary>
/// 当前机构
/// </summary>
/// <returns></returns>
[HttpPost]
public Ett.Organization Current()
{
return _trans(Business.Do<IOrganization>().OrganCurrent());
}
#endregion
#region 编辑机构信息
/// <summary>
/// 新增机构
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[SuperAdmin]
[HttpPost]
public bool Add(Ett.Organization entity)
{
Business.Do<IOrganization>().OrganAdd(entity);
return true;
}
/// <summary>
/// 根据id删除账号,可以有多个id,用逗号分隔
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost(Ignore = true), HttpDelete, SuperAdmin]
public int Delete(string id)
{
Ett.Organization org = Business.Do<IOrganization>().OrganCurrent();
int i = 0;
if (string.IsNullOrWhiteSpace(id)) return i;
string[] arr = id.Split(',');
foreach (string s in arr)
{
int idval = 0;
int.TryParse(s, out idval);
if (idval == 0) continue;
try
{
if (org != null && org.Org_ID == idval) throw new Exception("不可删除自身所有机构");
Business.Do<IOrganization>().OrganDelete(idval);
i++;
}
catch (Exception ex)
{
throw ex;
}
}
return i;
}
/// <summary>
/// 修改机构信息
/// </summary>
/// <param name="entity">机构对象</param>
/// <param name="exclude">不予修改的字段</param>
/// <returns></returns>
[HttpPost]
[HttpGet(Ignore = true)]
[Admin]
[HtmlClear(Not = "entity")]
[Upload(Extension = "jpg,png,gif", MaxSize = 1024, CannotEmpty = false)]
public bool Modify(Ett.Organization entity, string exclude)
{
Ett.Organization old = Business.Do<IOrganization>().OrganSingle(entity.Org_ID);
if (old == null) throw new Exception("Not found entity for Organization");
//机构的logo图片上传
string filename = string.Empty;
foreach (string key in this.Files)
{
HttpPostedFileBase file = this.Files[key];
filename = WeiSha.Core.Request.UniqueID() + Path.GetExtension(file.FileName);
file.SaveAs(PhyPath + filename);
break;
}
//如果有上传的图片,且之前也有图片,则删除原图片
if ((!string.IsNullOrWhiteSpace(filename) || string.IsNullOrWhiteSpace(entity.Org_Logo)) && !string.IsNullOrWhiteSpace(old.Org_Logo))
WeiSha.Core.Upload.Get["Org"].DeleteFile(old.Org_Logo);
old.Copy<Ett.Organization>(entity, "Org_Config," + exclude);
if (!string.IsNullOrWhiteSpace(filename)) old.Org_Logo = filename;
Business.Do<IOrganization>().OrganSave(old);
return true;
}
/// <summary>
/// 设置默认
/// </summary>
/// <param name="id">机构的id</param>
/// <returns></returns>
[SuperAdmin]
[HttpPost]
public bool SetDefault(int id)
{
Business.Do<IOrganization>().OrganSetDefault(id);
return true;
}
/// <summary>
/// 修改机构的关于我们的信息
/// </summary>
/// <param name="orgid">机构id</param>
/// <param name="text">图文信息的文本内容,为html</param>
/// <returns></returns>
[HtmlClear(Not = "text")][HttpPost][Admin]
public bool ModifyIntro(int orgid,string text)
{
Ett.Organization old = Business.Do<IOrganization>().OrganSingle(orgid);
if (old == null) throw new Exception("Not found entity for Organization");
old.Org_Intro = text;
Business.Do<IOrganization>().OrganSave(old);
return true;
}
/// <summary>
/// 编辑机构的附加代码
/// </summary>
/// <param name="orgid">机构id</param>
/// <param name="web">web端附加代码</param>
/// <param name="mobi">手机端的附加代码</param>
/// <returns></returns>
[HtmlClear(Not = "web,mobi")]
[HttpPost]
[Admin]
public bool ModifyExtra(int orgid,string web,string mobi)
{
if (orgid <= 0) return false;
Ett.Organization org = Business.Do<IOrganization>().OrganSingle(orgid);
if (org == null) throw new Exception("Not found entity for Organization");
org.Org_ExtraWeb = web;
org.Org_ExtraMobi = mobi;
Business.Do<IOrganization>().OrganSave(org);
return true;
}
#endregion
#region 公章管理
/// <summary>
/// 机构公章信息
/// </summary>
/// <param name="orgid">机构id</param>
/// <returns>path:公章图片路径;positon:位置</returns>
public Dictionary<string, string> Stamp(int orgid)
{
Dictionary<string, string> dic = new Dictionary<string, string>();
Ett.Organization org = Business.Do<IOrganization>().OrganSingle(orgid);
if (org == null) throw new Exception("Not found entity for Organization");
//公章
WeiSha.Core.CustomConfig config = CustomConfig.Load(org.Org_Config);
//公章显示位置
string positon = config["StampPosition"].Value.String;
if (string.IsNullOrEmpty(positon)) positon = "right-bottom";
dic.Add("positon", positon);
//公章图像信息
string stamp = config["Stamp"].Value.String;
string filepath = PhyPath + stamp;
dic.Add("path", !File.Exists(filepath) ? "" : VirPath + stamp);
return dic;
}
/// <summary>
/// 修改公章信息
/// </summary>
/// <param name="stamp"></param>
/// <param name="orgid">机构id</param>
/// <returns></returns>
[HttpPost, Admin]
[Upload(Extension = "png,gif", MaxSize = 1024, CannotEmpty = false)]
public bool StampUpdate(JObject stamp,int orgid)
{
Ett.Organization org = Business.Do<IOrganization>().OrganSingle(orgid);
if (org == null) throw new Exception("Not found entity for Organization");
WeiSha.Core.CustomConfig config = CustomConfig.Load(org.Org_Config);
//机构的logo图片上传
string filename = string.Empty;
foreach (string key in this.Files)
{
HttpPostedFileBase file = this.Files[key];
filename = WeiSha.Core.Request.UniqueID() + Path.GetExtension(file.FileName);
file.SaveAs(PhyPath + filename);
break;
}
//如果有上传的图片,且之前也有图片,则删除原图片
//之前的公章图像信息
string history_img = config["Stamp"].Value.String;
string upload_img = stamp["path"] ==null ? "" : stamp["path"].ToString();
if ((!string.IsNullOrWhiteSpace(filename) || string.IsNullOrWhiteSpace(upload_img)) && !string.IsNullOrWhiteSpace(history_img))
WeiSha.Core.Upload.Get["Org"].DeleteFile(config["Stamp"].Text);
if (!string.IsNullOrWhiteSpace(filename)) config["Stamp"].Text = filename;
config["StampPosition"].Text = stamp["positon"] == null ? "" : stamp["positon"].ToString();
try
{
org.Org_Config = config.XmlString;
Business.Do<IOrganization>().OrganSave(org);
return true;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 配置管理
/// <summary>
/// 当前机构的配置项
/// </summary>
/// <param name="orgid">机构id,如果小于等于0,则为当前机构</param>
/// <returns></returns>
public JObject Config(int orgid)
{
Song.Entities.Organization org;
if (orgid <= 0) org = Business.Do<IOrganization>().OrganCurrent();
else
org = Business.Do<IOrganization>().OrganSingle(orgid);
WeiSha.Core.CustomConfig config = CustomConfig.Load(org.Org_Config);
JObject jo = new JObject();
foreach (WeiSha.Core.CustomConfigItem item in config)
{
if (item.Text == "True" || item.Text == "False")
jo.Add(item.Key, Convert.ToBoolean(item.Text.ToLower()));
else
jo.Add(item.Key, item.Text);
}
return jo;
}
/// <summary>
/// 更改机构的配置项,如果递交的信息中包括配置项的键值对,则修改,否则跳过
/// </summary>
/// <param name="orgid">机构id</param>
/// <param name="config">配置项数据,如果递交的信息中包括配置项的键值对,则修改,否则跳过</param>
/// <returns></returns>
[HttpPost, Admin]
public bool ConfigUpdate(int orgid, JObject config)
{
Song.Entities.Organization org = null;
if (orgid > 0) org = Business.Do<IOrganization>().OrganSingle(orgid);
if (org == null) throw new Exception("Not found entity for Organization");
try
{
WeiSha.Core.CustomConfig history = CustomConfig.Load(org.Org_Config);
IEnumerable<JProperty> properties = config.Properties();
foreach (JProperty item in properties)
{
string key = item.Name;
string val = item.Value.ToString();
history[key].Text = val;
}
org.Org_Config = history.XmlString;
Business.Do<IOrganization>().OrganSave(org);
return true;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 私有方法
/// <summary>
/// 处理机构对外展示的信息
/// </summary>
/// <param name="org"></param>
/// <returns></returns>
private Ett.Organization _trans(Ett.Organization org)
{
if (org == null) return org;
org = (Ett.Organization)org.Clone();
org.Org_Logo = System.IO.File.Exists(PhyPath + org.Org_Logo) ? VirPath + org.Org_Logo : "";
return org;
}
#endregion
#region 机构等级
/// <summary>
/// 通过机构id获取机构等级
/// </summary>
/// <param name="id">机构id</param>
/// <returns>机构实体</returns>
public Ett.OrganLevel LevelForID(int id)
{
return Business.Do<IOrganization>().LevelSingle(id);
}
/// <summary>
/// 获取所有机构等级
/// </summary>
/// <param name="search">按等级名称检索</param>
/// <param name="use">是否启用的</param>
/// <returns></returns>
public Ett.OrganLevel[] LevelAll(string search, bool? use)
{
return Business.Do<IOrganization>().LevelAll(search, use);
}
/// <summary>
/// 批量删除机构等级
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpDelete]
public int LevelDelete(string id)
{
int i = 0;
if (string.IsNullOrWhiteSpace(id)) return i;
string[] arr = id.Split(',');
int[] idarr = new int[arr.Length];
for(int j = 0; j < arr.Length; j++)
{
int idval = 0;
int.TryParse(arr[j], out idval);
idarr[j] = idval;
if (idval > 0)
{
int count = Business.Do<IOrganization>().LevelOrganCount(idval);
if (count > 0)
{
throw new Exception("机构等级下有机构,不可以删除");
}
}
}
for (int j = 0; j < idarr.Length; j++)
{
if (idarr[j] > 0)
{
try
{
Business.Do<IOrganization>().LevelDelete(idarr[j]);
i++;
}
catch (Exception ex)
{
throw ex;
}
}
}
return i;
}
/// <summary>
/// 修改机构等级的信息
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[SuperAdmin]
[HttpPost]
public bool LevelModify(OrganLevel entity)
{
Ett.OrganLevel old = Business.Do<IOrganization>().LevelSingle(entity.Olv_ID);
if (old == null) throw new Exception("Not found entity for OrganLevel");
//账号,密码,登录状态值,不更改
old.Copy<Ett.OrganLevel>(entity);
Business.Do<IOrganization>().LevelSave(old);
return true;
}
/// <summary>
/// 新增机构等级
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[SuperAdmin]
[HttpPost]
public bool LevelAdd(OrganLevel entity)
{
Business.Do<IOrganization>().LevelAdd(entity);
return true;
}
/// <summary>
/// 机构等级名称是否存在
/// </summary>
/// <param name="name">机构等级名称</param>
/// <param name="id">机构等级id,如果对象已经存在,则不断判断自身</param>
/// <returns></returns>
[HttpGet]
public bool LevelNameExist(string name, int id)
{
return Business.Do<IOrganization>().LevelNameExist(name, id);
}
/// <summary>
/// 机构等级的tag标识是否重名
/// </summary>
/// <param name="tag">机构等级的tag标识</param>
/// <param name="id">机构等级的id</param>
/// <returns></returns>
[HttpGet]
public bool LevelTagExist(string tag, int id)
{
return Business.Do<IOrganization>().LevelTagExist(tag, id);
}
/// <summary>
/// 设置默认等级
/// </summary>
/// <param name="id">机构等级的id</param>
/// <returns></returns>
[SuperAdmin]
[HttpPost]
public bool LevelSetDefault(int id)
{
Business.Do<IOrganization>().LevelSetDefault(id);
return true;
}
/// <summary>
/// 机构等级下的机构数
/// </summary>
/// <param name="id">机构等级的id</param>
/// <returns></returns>
[HttpGet]
public int LevelOrgcount(int id)
{
return Business.Do<IOrganization>().LevelOrganCount(id);
}
/// <summary>
/// 更改排序
/// </summary>
/// <param name="items">数组</param>
/// <returns></returns>
[HttpPost]
[SuperAdmin]
public bool LevelModifyTaxis(Ett.OrganLevel[] items)
{
try
{
Business.Do<IOrganization>().LevelUpdateTaxis(items);
return true;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 统计数据
/// <summary>
/// 有多少课程被选修过
/// </summary>
/// <param name="orgid">机构id</param>
/// <param name="isfree">是否包括免费的</param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
public int CourseCountBuy(int orgid, bool? isfree, DateTime? start, DateTime? end)
{
return Business.Do<IOrganization>().CourseCountBuy(orgid, isfree, start, end);
}
/// <summary>
/// 有多少学员购买过课程
/// </summary>
/// <param name="orgid">机构id</param>
/// <param name="isfree">是否包括免费的</param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
public int StudentCountBuy(int orgid, bool? isfree, DateTime? start, DateTime? end)
{
return Business.Do<IOrganization>().StudentCountBuy(orgid, isfree, start, end);
}
/// <summary>
/// 购买课程的次数,即学员购买课程的次数
/// </summary>
/// <param name="orgid">机构id</param>
/// <param name="isfree">是否包括免费的</param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
public int CourseSumBuy(int orgid, bool? isfree, DateTime? start, DateTime? end)
{
return Business.Do<IOrganization>().CourseSumBuy(orgid, isfree, start, end);
}
#endregion
}
}
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

前后端分离,C#、Vue。web端采用ElementUI,手机端采用VantUI,管理后台采用WebdeskUI。直播、视频学习、试题练习、测试、考试、学习证明、成绩打印,实现"学、练、考"一体。
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/wtt2016/LearningSystem.git
git@gitee.com:wtt2016/LearningSystem.git
wtt2016
LearningSystem
视频学习+在线考试+题库+直播
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /