本文整理汇总了C#中ServiceInvokeDTO类的典型用法代码示例。如果您正苦于以下问题:C# ServiceInvokeDTO类的具体用法?C# ServiceInvokeDTO怎么用?C# ServiceInvokeDTO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceInvokeDTO类属于命名空间,在下文中一共展示了ServiceInvokeDTO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}