Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }