AttendanceController.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. namespace lyfzAttendance.Controller
  7. {
  8. class AttendanceController : LYFZ.DAL.BaseDataOperate
  9. {
  10. #region 属性和字段
  11. private Model.AttendanceRecord model = new Model.AttendanceRecord();
  12. public Model.AttendanceRecord CurrentModel
  13. {
  14. get { return model; }
  15. set { model = value; }
  16. }
  17. public override object ObjModel
  18. {
  19. get
  20. {
  21. return this.CurrentModel;
  22. }
  23. }
  24. public override string TableName { get; set; } = "lonindata";
  25. public override string TableFieldNameString { get; set; } = "";
  26. #endregion
  27. #region 查询数据
  28. public Model.AttendanceRecord DataRowToModel(DataRow row)
  29. {
  30. return DataRowToModelObject(row) as Model.AttendanceRecord;
  31. }
  32. #endregion
  33. public bool Add(string overlookFieldList = "ID")
  34. {
  35. try
  36. {
  37. return base.Add(CurrentModel, overlookFieldList);
  38. }
  39. catch(Exception ex)
  40. {
  41. LogHelper.LogFatal(typeof(AttendanceController), "上传服务器失败", ex);
  42. }
  43. return false;
  44. }
  45. }
  46. }