///Update
        public bool Update(DispatchPriorityEntity dispatchpriority)
        {
            bool res = false;

            try
            {
                var p = Param(dispatchpriority, "edit");
                res = (bool)unitOfWork.ProcedureExecute("ptgroup_DispatchPriority_Update", p);
                return(res);
            }
            catch (Exception ex)
            {
                Logging.PutError(ex.Message, ex);
                return(res);
            }
        }
        /// <summary>
        /// Saves a record to the Employee table.
        /// </summary>
        private DynamicParameters Param(DispatchPriorityEntity dispatchpriority, string action = "add")
        {
            var p = new DynamicParameters();

            if (action == "add")
            {
                p.Add("@Id", dbType: DbType.Int32, direction: ParameterDirection.Output);
            }
            else
            {
                p.Add("@Id", dispatchpriority.Id);
            }
            p.Add("@Name", dispatchpriority.Name);
            p.Add("@CreateDate", dispatchpriority.CreateDate);
            return(p);
        }
        public int Insert(DispatchPriorityEntity dispatchpriority)
        {
            int  res  = 0;
            bool flag = false;

            try
            {
                var p = Param(dispatchpriority);
                flag = (bool)unitOfWork.ProcedureExecute("ptgroup_DispatchPriority_Insert", p);
                if (flag)
                {
                    res = p.Get <int>("@Id");
                }
                else
                {
                    res = 0;
                }
            }
            catch (Exception ex)
            {
                Logging.PutError(ex.Message, ex);
            }
            return(res);
        }