本文整理汇总了C#中ServiceInvokeDTO类的典型用法代码示例。如果您正苦于以下问题:C# ServiceInvokeDTO类的具体用法?C# ServiceInvokeDTO怎么用?C# ServiceInvokeDTO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceInvokeDTO类属于命名空间,在下文中一共展示了ServiceInvokeDTO类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddTeacher
/// <summary>
/// 添加老师
/// </summary>
public ServiceInvokeDTO AddTeacher(Teacher teacher)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
// Check user name
Teacher dbTeacher = teacherDAL.GetByUserName(teacher.UserName);
if (dbTeacher == null)
{
teacher.Password = SecurityUtil.MD5(teacher.Password + Constant.TEACHER_SALT_KEY);
teacherDAL.Insert(teacher);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.ACCOUNT_TEACHER_ACCOUNT_EXIST_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:SLOES,代码行数:31,代码来源:AccountDataService.cs
示例2: DeleteTeacher
/// <summary>
/// 删除老师
/// </summary>
public ServiceInvokeDTO DeleteTeacher(int teacherID)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
Teacher dbTeacher = teacherDAL.GetByID(teacherID);
if (dbTeacher != null)
{
// 系统管理员账号检测
if (dbTeacher.Level == TeacherLevel.SystemAdmin)
{
result = new ServiceInvokeDTO(InvokeCode.ACCOUNT_SYSTEM_ADMIN_NOT_DELETE_ERROR);
}
else
{
teacherDAL.DeleteByID(teacherID);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
}
else
{
result = new ServiceInvokeDTO(InvokeCode.SYS_OBJECT_NOT_EXIST_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:SLOES,代码行数:37,代码来源:AccountDataService.cs
示例3: AddTeacher
public ActionResult AddTeacher()
{
log.Debug(Constant.DEBUG_START);
string chineseName = ApiQueryUtil.QueryArgByPost("chinese_name");
string userName = ApiQueryUtil.QueryArgByPost("user_name");
string password = ApiQueryUtil.QueryArgByPost("password");
string isCanMarkPaperString = ApiQueryUtil.QueryArgByPost("is_can_mark_paper");
ServiceInvokeDTO result = null;
try
{
Teacher teacher = new Teacher();
teacher.ChineseName = chineseName;
teacher.UserName = userName;
teacher.Password = password;
teacher.Level = TeacherLevel.ItemAdmin;
teacher.IsCanMarkPaper = Convert.ToInt32(isCanMarkPaperString);
result = accountDataService.AddTeacher(teacher);
}
catch (Exception ex)
{
log.Error(ex);
result = new ServiceInvokeDTO(InvokeCode.SYS_INNER_ERROR);
}
string json = JsonConvert.SerializeObject(result, Formatting.Indented, Constant.TIME_CONVERTER);
log.Debug(Constant.DEBUG_END);
return Content(json, Constant.JSON_MIME_TYPE);
}
开发者ID:yienit,项目名称:SLOES,代码行数:32,代码来源:AccountController.cs
示例4: AddFeedBackRecord
/// <summary>
/// 添加用户意见反馈记录
/// </summary>
public ServiceInvokeDTO AddFeedBackRecord(FeedbackRecord feedback)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
// 验证参数
FeedbackValidator validator = new FeedbackValidator();
ValidationResult validatorResult = validator.Validate(feedback);
if (validatorResult.IsValid)
{
feedBackDAL.Insert(feedback);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.SYS_ARG_ERROR);
log.Error(string.Format(Constant.DEBUG_ARG_ERROR_FORMATER, validatorResult.Errors[0].ErrorMessage));
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:33,代码来源:RecordDataService.cs
示例5: AddAdmin
/// <summary>
/// 添加机构管理员
/// </summary>
public ServiceInvokeDTO AddAdmin(AgencyAdmin admin)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
AgencyAdmin dbAdmin = agencyAdminDAL.GetByPhone(admin.Phone);
if (dbAdmin == null)
{
admin.Password = SecurityUtil.MD5(SecurityUtil.MD5(admin.Phone) + Constant.ADMIN_SALT_KEY);
agencyAdminDAL.Insert(admin);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.ACCOUNT_ADMIN_PHONE_EXIST_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:30,代码来源:AgencyDataService.cs
示例6: CheckCaptcha
/// <summary>
/// 检测验证码是否正确
/// </summary>
public ServiceInvokeDTO CheckCaptcha(CaptchaCodeType type, string phone, string code)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
string dbCode = captchaRecordDAL.GetCode(type, phone, Config.CaptchaExpireTime);
if (!string.IsNullOrEmpty(dbCode) && dbCode.Equals(code))
{
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.SYS_CAPTCHA_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:28,代码来源:SecurityService.cs
示例7: AddChapter
/// <summary>
/// 添加章节
/// </summary>
public ServiceInvokeDTO AddChapter(Chapter chapter)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
// 检测章节名称是否存在
Chapter dbChapter = chapterDAL.GetByName(chapter.CourseID, chapter.Name);
if (dbChapter == null)
{
// 叠加章节序号
chapter.ChapterIndex = chapterDAL.GetLastChapterIndex(chapter.CourseID) + 1;
chapterDAL.Insert(chapter);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.ITEM_CHAPTER_NAME_EXIST_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:33,代码来源:ItemDataService.cs
示例8: AddUser
/// <summary>
/// 添加学生用户
/// </summary>
public ServiceInvokeDTO AddUser(User user)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
// 检测电话号码
User dbUserWithPhone = userDAL.GetByPhone(user.Phone);
if (dbUserWithPhone == null)
{
user.Password = SecurityUtil.MD5(SecurityUtil.MD5(user.Phone) + Constant.USER_SALT_KEY);
userDAL.Insert(user);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.ACCOUNT_USER_PHONE_EXIST_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:31,代码来源:UserDataService.cs
示例9: GetPaperByID
/// <summary>
/// 根据主键ID获取试卷信息
/// </summary>
public ServiceInvokeDTO<Paper> GetPaperByID(int id)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO<Paper> result = null;
try
{
Paper paper = paperDAL.GetByID(id);
result = new ServiceInvokeDTO<Paper>(InvokeCode.SYS_INVOKE_SUCCESS, paper);
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:SLOES,代码行数:21,代码来源:PaperDataService.cs
示例10: AddFenLu
/// <summary>
/// 添加分录题
/// </summary>
public ServiceInvokeDTO AddFenLu(FenLuItem fenlu, List<FenLuAnswer> answers)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
fenluDAL.Insert(fenlu, answers);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:21,代码来源:ItemDataService.cs
示例11: AddAdminDoRecord
/// <summary>
/// 添加管理员操作记录
/// </summary>
public ServiceInvokeDTO AddAdminDoRecord(AdminDoRecord doRecord)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
adminDoRecordDAL.Insert(doRecord);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
catch (Exception ex)
{
// 记录异常但不抛出
log.Error(ex);
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:21,代码来源:RecordDataService.cs
示例12: AddBlank
/// <summary>
/// 添加填空题
/// </summary>
public ServiceInvokeDTO AddBlank(BlankItem blank, List<BlankAnswer> answers)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
blankDAL.Insert(blank, answers);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:SLOES,代码行数:21,代码来源:ItemDataService.cs
示例13: DeleteUncertainSubChoice
/// <summary>
/// 删除不定项选择题子选择题
/// </summary>
public ServiceInvokeDTO DeleteUncertainSubChoice(int id)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
UncertainSubChoice dbSubChoice = uncertainSubChoiceDAL.GetByID(id);
if (dbSubChoice != null)
{
uncertainSubChoiceDAL.DeleteByID(id);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.SYS_OBJECT_NOT_EXIST_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:30,代码来源:ItemDataService.cs
示例14: DeleteNumberBlank
/// <summary>
/// 删除数字填空题
/// </summary>
public ServiceInvokeDTO DeleteNumberBlank(int id)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
NumberBlankItem dbNumberBlank = numberBlankDAL.GetByID(id);
if (dbNumberBlank != null)
{
numberBlankDAL.DeleteByID(id);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.SYS_OBJECT_NOT_EXIST_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:29,代码来源:ItemDataService.cs
示例15: DeleteChapter
/// <summary>
/// 删除章节
/// </summary>
public ServiceInvokeDTO DeleteChapter(int id)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
Chapter dbChapter = chapterDAL.GetByID(id);
if (dbChapter != null)
{
chapterDAL.DeleteByID(id);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.SYS_OBJECT_NOT_EXIST_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:29,代码来源:ItemDataService.cs
示例16: GetJudgeByID
/// <summary>
/// 根据主键ID获取判断题
/// </summary>
public ServiceInvokeDTO<JudgeItemDTO> GetJudgeByID(int id)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO<JudgeItemDTO> result = null;
try
{
JudgeItemDTO judgeDTO = null;
// --> DTO
JudgeItem judge = judgeDAL.GetByID(id);
if (judge != null)
{
judgeDTO = new JudgeItemDTO(judge);
judgeDTO.ChapterName = chapterDAL.GetByID(judge.ChapterID).Name;
}
result = new ServiceInvokeDTO<JudgeItemDTO>(InvokeCode.SYS_INVOKE_SUCCESS, judgeDTO);
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:29,代码来源:ItemDataService.cs
示例17: GetFenLuByID
/// <summary>
/// 根据主键ID获取分录题
/// </summary>
public ServiceInvokeDTO<FenLuItemDTO> GetFenLuByID(int id)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO<FenLuItemDTO> result = null;
try
{
FenLuItemDTO fenluDTO = null;
// --> DTO
FenLuItem fenlu = fenluDAL.GetByID(id);
if (fenlu != null)
{
fenluDTO = new FenLuItemDTO(fenlu);
fenluDTO.ChapterName = chapterDAL.GetByID(fenlu.ChapterID).Name;
fenluDTO.Answers = fenluDAL.GetAnswers(fenlu.ID);
}
result = new ServiceInvokeDTO<FenLuItemDTO>(InvokeCode.SYS_INVOKE_SUCCESS, fenluDTO);
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:30,代码来源:ItemDataService.cs
示例18: GetAgencyCourses
/// <summary>
/// 获取培训机构的所有考试科目信息
/// </summary>
public ServiceInvokeDTO<List<Course>> GetAgencyCourses(int agencyID)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO<List<Course>> result = null;
try
{
List<Course> courses = courseDAL.GetByAgencyID(agencyID);
result = new ServiceInvokeDTO<List<Course>>(InvokeCode.SYS_INVOKE_SUCCESS, courses);
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:21,代码来源:ItemDataService.cs
示例19: DownChapter
/// <summary>
/// 下调章节序号
/// </summary>
public ServiceInvokeDTO DownChapter(int id)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
Chapter currentChapter = chapterDAL.GetByID(id);
if (currentChapter != null)
{
// 后一个章节
Chapter afterChapter = chapterDAL.GetAfterChapter(currentChapter.CourseID, currentChapter.ChapterIndex);
if (afterChapter != null)
{
// 互换章节序号
chapterDAL.UpdateChapterIndex(currentChapter.ID, afterChapter.ChapterIndex);
chapterDAL.UpdateChapterIndex(afterChapter.ID, currentChapter.ChapterIndex);
}
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
else
{
result = new ServiceInvokeDTO(InvokeCode.SYS_OBJECT_NOT_EXIST_ERROR);
}
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:38,代码来源:ItemDataService.cs
示例20: DeleteUncertainSubChoiceInBatch
/// <summary>
/// 删除不定项选择题子选择题(批量删除)
/// </summary>
public ServiceInvokeDTO DeleteUncertainSubChoiceInBatch(List<int> ids)
{
log.Debug(Constant.DEBUG_START);
ServiceInvokeDTO result = null;
try
{
uncertainSubChoiceDAL.DeleteInBatch(ids);
result = new ServiceInvokeDTO(InvokeCode.SYS_INVOKE_SUCCESS);
}
catch (Exception ex)
{
log.Error(ex);
throw ex;
}
log.Debug(Constant.DEBUG_END);
return result;
}
开发者ID:yienit,项目名称:KST,代码行数:21,代码来源:ItemDataService.cs
注:本文中的ServiceInvokeDTO类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论