public bool Update(BookMeetingEntity bookMeeting) { bool res = false; try { var p = Param(bookMeeting, "edit"); res = (bool)unitOfWork.ProcedureExecute("ptgroup_BookMeeting_Update", p); return(res); } catch (Exception ex) { Logging.PutError(ex.Message, ex); return(false); } }
public int Insert(BookMeetingEntity bookMeeting) { int res = 0; bool flag = false; try { var p = Param(bookMeeting); flag = (bool)unitOfWork.ProcedureExecute("ptgroup_BookMeeting_Insert", p); if (flag) { res = p.Get <int>("@Id"); } else { res = 0; } } catch (Exception ex) { Logging.PutError(ex.Message, ex); } return(res); }
public DynamicParameters Param(BookMeetingEntity bookMeeting, string action = "add") { var p = new DynamicParameters(); if (action == "edit") { p.Add("@Id", bookMeeting.Id); p.Add("@ModifierDate", bookMeeting.ModifierDate); } else { p.Add("@Id", dbType: DbType.Int32, direction: ParameterDirection.Output); p.Add("@CreateDate", bookMeeting.CreateDate); } p.Add("@DepartmentId", bookMeeting.DepartmentId); p.Add("@CreateDate", bookMeeting.CreateDate); p.Add("@EmployeeId", bookMeeting.EmployeeId); p.Add("@TimeStart", bookMeeting.TimeStart); p.Add("@TimeEnd", bookMeeting.TimeEnd); p.Add("@RoomId", bookMeeting.RoomID); return(p); }